Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validateBackendRef invalid group error conditions #800

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions internal/state/graph/backend_refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ func validateBackendRef(
) (valid bool, cond conditions.Condition) {
// Because all errors cause same condition but different reasons, we return as soon as we find an error

if ref.Group != nil && !(*ref.Group == "core" || *ref.Group == "") {
valErr := field.NotSupported(path.Child("group"), *ref.Group, []string{"core", ""})
return false, conditions.NewRouteBackendRefUnsupportedValue(valErr.Error())
}

if ref.Kind != nil && *ref.Kind != "Service" {
ciarams87 marked this conversation as resolved.
Show resolved Hide resolved
valErr := field.NotSupported(path.Child("kind"), *ref.Kind, []string{"Service"})
return false, conditions.NewRouteBackendRefInvalidKind(valErr.Error())
}

if ref.Group != nil && !(*ref.Group == "core" || *ref.Group == "") {
valErr := field.NotSupported(path.Child("group"), *ref.Group, []string{"core", ""})
return false, conditions.NewRouteBackendRefUnsupportedValue(valErr.Error())
}

// no need to validate ref.Name

if ref.Namespace != nil && string(*ref.Namespace) != routeNs {
Expand Down