diff --git a/internal/dag/builder_test.go b/internal/dag/builder_test.go index 999bcd1b07d..d24f7f834bb 100644 --- a/internal/dag/builder_test.go +++ b/internal/dag/builder_test.go @@ -5501,8 +5501,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterRequestHeaderModifier, RequestHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "custom-header-add", Value: "foo-bar"}, @@ -5516,8 +5516,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterRequestHeaderModifier, RequestHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "ignored"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar-ignored.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "ignored"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar-ignored.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "custom-header-add", Value: "ignored"}, @@ -5580,8 +5580,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterResponseHeaderModifier, ResponseHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "custom-header-add", Value: "foo-bar"}, @@ -5594,8 +5594,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterResponseHeaderModifier, ResponseHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "ignored"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar-ignored.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "ignored"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar-ignored.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "custom-header-add", Value: "ignored"}, @@ -5658,8 +5658,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterRequestHeaderModifier, RequestHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "!invalid-header-add", Value: "foo-bar"}, @@ -5720,8 +5720,8 @@ func TestDAGInsertGatewayAPI(t *testing.T) { Type: gatewayapi_v1alpha2.GRPCRouteFilterResponseHeaderModifier, ResponseHeaderModifier: &gatewayapi_v1alpha2.HTTPHeaderFilter{ Set: []gatewayapi_v1alpha2.HTTPHeader{ - {Name: gatewayapi_v1alpha2.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, - {Name: gatewayapi_v1alpha2.HTTPHeaderName("Host"), Value: "bar.com"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("custom-header-set"), Value: "foo-bar"}, + {Name: gatewayapi_v1beta1.HTTPHeaderName("Host"), Value: "bar.com"}, }, Add: []gatewayapi_v1alpha2.HTTPHeader{ {Name: "!invalid-header-add", Value: "foo-bar"}, diff --git a/internal/dag/gatewayapi_processor.go b/internal/dag/gatewayapi_processor.go index a5b1a99a738..f248e31f663 100644 --- a/internal/dag/gatewayapi_processor.go +++ b/internal/dag/gatewayapi_processor.go @@ -1665,7 +1665,7 @@ func gatewayHeaderMatchConditions(matches []gatewayapi_v1beta1.HTTPHeaderMatch) func gatewayQueryParamMatchConditions(matches []gatewayapi_v1beta1.HTTPQueryParamMatch) ([]QueryParamMatchCondition, error) { var dagMatchConditions []QueryParamMatchCondition - seenNames := sets.New[string]() + seenNames := sets.New[gatewayapi_v1beta1.HTTPHeaderName]() for _, match := range matches { var matchType string @@ -1690,7 +1690,7 @@ func gatewayQueryParamMatchConditions(matches []gatewayapi_v1beta1.HTTPQueryPara dagMatchConditions = append(dagMatchConditions, QueryParamMatchCondition{ MatchType: matchType, - Name: match.Name, + Name: string(match.Name), Value: match.Value, }) } diff --git a/internal/gatewayapi/helpers.go b/internal/gatewayapi/helpers.go index 4bc551d8536..fa0ee23711c 100644 --- a/internal/gatewayapi/helpers.go +++ b/internal/gatewayapi/helpers.go @@ -98,7 +98,7 @@ func HTTPQueryParamMatches(namesAndValues map[string]string) []gatewayapi_v1beta for name, val := range namesAndValues { matches = append(matches, gatewayapi_v1beta1.HTTPQueryParamMatch{ Type: ref.To(gatewayapi_v1beta1.QueryParamMatchExact), - Name: name, + Name: gatewayapi_v1beta1.HTTPHeaderName(name), Value: val, }) }