From 1f8a4161c79fe26da014cec309b1a98dc3e3249e Mon Sep 17 00:00:00 2001 From: Ciara Stacke <18287516+ciarams87@users.noreply.github.com> Date: Wed, 28 Jun 2023 21:15:06 +0100 Subject: [PATCH] Update validateBackendRef invalid group error conditions (#800) * Reverse order for validateBackendRef error conditions * Instead of reversing order, change condition reason for invalid group --- internal/state/graph/backend_refs.go | 2 +- internal/state/graph/backend_refs_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/state/graph/backend_refs.go b/internal/state/graph/backend_refs.go index a4b0b9dc8f..61402604f9 100644 --- a/internal/state/graph/backend_refs.go +++ b/internal/state/graph/backend_refs.go @@ -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" { diff --git a/internal/state/graph/backend_refs_test.go b/internal/state/graph/backend_refs_test.go index 054e874f1d..8169104c70 100644 --- a/internal/state/graph/backend_refs_test.go +++ b/internal/state/graph/backend_refs_test.go @@ -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", ""`, ), },