diff --git a/internal/mode/static/state/dataplane/configuration_test.go b/internal/mode/static/state/dataplane/configuration_test.go index ebca43e07..b0eea67b4 100644 --- a/internal/mode/static/state/dataplane/configuration_test.go +++ b/internal/mode/static/state/dataplane/configuration_test.go @@ -2518,7 +2518,7 @@ func TestCreateFilters(t *testing.T) { ngfAPI.NginxContextHTTPServerLocation: "location snippet 1", ngfAPI.NginxContextMain: "main snippet 1", ngfAPI.NginxContextHTTPServer: "server snippet 1", - ngfAPI.NginxContextHTTP: "main snippet 1", + ngfAPI.NginxContextHTTP: "http snippet 1", }, }, }, @@ -2546,7 +2546,7 @@ func TestCreateFilters(t *testing.T) { ngfAPI.NginxContextHTTPServerLocation: "location snippet 2", ngfAPI.NginxContextMain: "main snippet 2", ngfAPI.NginxContextHTTPServer: "server snippet 2", - ngfAPI.NginxContextHTTP: "main snippet 2", + ngfAPI.NginxContextHTTP: "http snippet 2", }, }, }, diff --git a/internal/mode/static/state/graph/common_filter_test.go b/internal/mode/static/state/graph/common_filter_test.go index 87310977c..1d9a2d1fa 100644 --- a/internal/mode/static/state/graph/common_filter_test.go +++ b/internal/mode/static/state/graph/common_filter_test.go @@ -73,7 +73,7 @@ func TestValidateFilter(t *testing.T) { { filter: Filter{ RouteType: RouteTypeHTTP, - FilterType: "RequestMirror", + FilterType: FilterRequestMirror, }, expectErrCount: 1, name: "unsupported HTTP filter type", diff --git a/internal/mode/static/state/graph/httproute.go b/internal/mode/static/state/graph/httproute.go index 31f5f425d..8cc3b66ea 100644 --- a/internal/mode/static/state/graph/httproute.go +++ b/internal/mode/static/state/graph/httproute.go @@ -278,7 +278,8 @@ func validatePathMatch( if *path.Type != v1.PathMatchPathPrefix && *path.Type != v1.PathMatchExact { valErr := field.NotSupported( - fieldPath.Child("type"), *path.Type, + fieldPath.Child("type"), + *path.Type, []string{string(v1.PathMatchExact), string(v1.PathMatchPathPrefix)}, ) allErrs = append(allErrs, valErr) diff --git a/internal/mode/static/state/graph/httproute_test.go b/internal/mode/static/state/graph/httproute_test.go index 3a7efb8ef..a655364e6 100644 --- a/internal/mode/static/state/graph/httproute_test.go +++ b/internal/mode/static/state/graph/httproute_test.go @@ -268,7 +268,9 @@ func TestBuildHTTPRoute(t *testing.T) { "hr", gatewayNsName.Name, "example.com", - invalidPath, "/filter", "/", + invalidPath, + "/filter", + "/", ) addFilterToPath(hrDroppedInvalidMatchesAndInvalidFilters, "/filter", invalidFilter)