Skip to content

Commit 1f8a416

Browse files
authored
Update validateBackendRef invalid group error conditions (#800)
* Reverse order for validateBackendRef error conditions * Instead of reversing order, change condition reason for invalid group
1 parent b322ce1 commit 1f8a416

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/state/graph/backend_refs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func validateBackendRef(
171171

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

177177
if ref.Kind != nil && *ref.Kind != "Service" {

internal/state/graph/backend_refs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func TestValidateBackendRef(t *testing.T) {
123123
return backend
124124
}),
125125
expectedValid: false,
126-
expectedCondition: conditions.NewRouteBackendRefUnsupportedValue(
126+
expectedCondition: conditions.NewRouteBackendRefInvalidKind(
127127
`test.group: Unsupported value: "invalid": supported values: "core", ""`,
128128
),
129129
},

0 commit comments

Comments
 (0)