Skip to content

Commit

Permalink
Update validateBackendRef invalid group error conditions (#800)
Browse files Browse the repository at this point in the history
* Reverse order for validateBackendRef error conditions

* Instead of reversing order, change condition reason for invalid group
  • Loading branch information
ciarams87 authored Jun 28, 2023
1 parent b322ce1 commit 1f8a416
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/state/graph/backend_refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func validateBackendRef(

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())
return false, conditions.NewRouteBackendRefInvalidKind(valErr.Error())
}

if ref.Kind != nil && *ref.Kind != "Service" {
Expand Down
2 changes: 1 addition & 1 deletion internal/state/graph/backend_refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestValidateBackendRef(t *testing.T) {
return backend
}),
expectedValid: false,
expectedCondition: conditions.NewRouteBackendRefUnsupportedValue(
expectedCondition: conditions.NewRouteBackendRefInvalidKind(
`test.group: Unsupported value: "invalid": supported values: "core", ""`,
),
},
Expand Down

0 comments on commit 1f8a416

Please sign in to comment.