diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml index 1408cc0eae..10a378a589 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml @@ -73,10 +73,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter already configures request header: add-header-1 to be added, ignoring second entry" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml index 011724c456..c23b542567 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml @@ -83,11 +83,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - # Currently only one invalid value status will be set. If there are multiple, then only the latest is displayed until that issue is resolved. - message: "RequestHeaderModifier Filter already configures request header: set-header-4 to be added/set, ignoring second entry" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml index 003288773a..01c33fa8d5 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -69,10 +69,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter already configures request header: rem-header-1 to be removed, ignoring second entry" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml index 7123200aff..bde4b77b6f 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml @@ -64,10 +64,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter already configures request header: some-header-1 to be removed, ignoring second entry" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml index 238545928d..ae0cd811ca 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml @@ -69,10 +69,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter cannot set a header with an empty name" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml index e8d0ff0954..29a0545904 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml @@ -69,10 +69,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter cannot set headers with a '/' or ':' character in them. Header: 'example:1'" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml index a63a937bb2..3892e0bc6c 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml @@ -64,10 +64,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "RequestHeaderModifier Filter did not provide valid configuration to add/set/remove any headers" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml index 7a210ae376..3127021f04 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml @@ -63,10 +63,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "Unknown custom filter type: UnsupportedType" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml index a663120def..630f9fb75e 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml @@ -63,10 +63,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "Scheme: unknown is unsupported, only 'https' and 'http' are supported" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml index 998d188aa3..dbb2df4af0 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml @@ -63,10 +63,6 @@ httpRoutes: status: "True" reason: Accepted message: Route is accepted - - type: ResolvedRefs - status: "False" - reason: UnsupportedValue - message: "Status code 666 is invalid, only 302 and 301 are supported" xdsIR: envoy-gateway-gateway-1: http: diff --git a/internal/gatewayapi/translator.go b/internal/gatewayapi/translator.go index 71e3ef9a11..0d4db0be7e 100644 --- a/internal/gatewayapi/translator.go +++ b/internal/gatewayapi/translator.go @@ -779,7 +779,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways // Can't have two redirects for the same route if redirectResponse != nil { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, "Cannot configure multiple requestRedirect filters for a single HTTPRouteRule", @@ -801,7 +801,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways } else { errMsg := fmt.Sprintf("Scheme: %s is unsupported, only 'https' and 'http' are supported", *redirect.Scheme) parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, errMsg, @@ -813,7 +813,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways if redirect.Hostname != nil { if err := isValidHostname(string(*redirect.Hostname)); err != nil { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, err.Error(), @@ -842,7 +842,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways default: errMsg := fmt.Sprintf("Redirect path type: %s is invalid, only \"ReplaceFullPath\" and \"ReplacePrefixMatch\" are supported", redirect.Path.Type) parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, errMsg, @@ -859,7 +859,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways } else { errMsg := fmt.Sprintf("Status code %d is invalid, only 302 and 301 are supported", redirectCode) parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, errMsg, @@ -891,7 +891,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways emptyFilterConfig = false if addHeader.Name == "" { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, "RequestHeaderModifier Filter cannot add a header with an empty name", @@ -902,7 +902,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways // Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names if strings.Contains(string(addHeader.Name), "/") || strings.Contains(string(addHeader.Name), ":") { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, fmt.Sprintf("RequestHeaderModifier Filter cannot set headers with a '/' or ':' character in them. Header: %q", string(addHeader.Name)), @@ -920,12 +920,6 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways } if !canAddHeader { - parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, - metav1.ConditionFalse, - v1beta1.RouteReasonUnsupportedValue, - fmt.Sprintf("RequestHeaderModifier Filter already configures request header: %s to be added, ignoring second entry", headerKey), - ) continue } @@ -948,7 +942,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways if setHeader.Name == "" { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, "RequestHeaderModifier Filter cannot set a header with an empty name", @@ -958,7 +952,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways // Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names if strings.Contains(string(setHeader.Name), "/") || strings.Contains(string(setHeader.Name), ":") { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, fmt.Sprintf("RequestHeaderModifier Filter cannot set headers with a '/' or ':' character in them. Header: '%s'", string(setHeader.Name)), @@ -976,12 +970,6 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways } } if !canAddHeader { - parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, - metav1.ConditionFalse, - v1beta1.RouteReasonUnsupportedValue, - fmt.Sprintf("RequestHeaderModifier Filter already configures request header: %s to be added/set, ignoring second entry", headerKey), - ) continue } newHeader := ir.AddHeader{ @@ -1004,7 +992,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways for _, removedHeader := range headersToRemove { if removedHeader == "" { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, "RequestHeaderModifier Filter cannot remove a header with an empty name", @@ -1020,12 +1008,6 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways } } if !canRemHeader { - parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, - metav1.ConditionFalse, - v1beta1.RouteReasonUnsupportedValue, - fmt.Sprintf("RequestHeaderModifier Filter already configures request header: %s to be removed, ignoring second entry", removedHeader), - ) continue } @@ -1037,7 +1019,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways // Update the status if the filter failed to configure any valid headers to add/remove if len(addRequestHeaders) == 0 && len(removeRequestHeaders) == 0 && !emptyFilterConfig { parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, "RequestHeaderModifier Filter did not provide valid configuration to add/set/remove any headers", @@ -1048,7 +1030,7 @@ func (t *Translator) ProcessHTTPRoutes(httpRoutes []*v1beta1.HTTPRoute, gateways // Instead, requests that would have been processed by that filter MUST receive a HTTP error response." errMsg := fmt.Sprintf("Unknown custom filter type: %s", filter.Type) parentRef.SetCondition(httpRoute, - v1beta1.RouteConditionResolvedRefs, + v1beta1.RouteConditionAccepted, metav1.ConditionFalse, v1beta1.RouteReasonUnsupportedValue, errMsg,