Skip to content

Commit

Permalink
linter/compilation fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed May 18, 2023
1 parent 9b5a6d3 commit aa78c12
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions internal/dag/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down
4 changes: 2 additions & 2 deletions internal/dag/gatewayapi_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
})
}
Expand Down
2 changes: 1 addition & 1 deletion internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
Expand Down

0 comments on commit aa78c12

Please sign in to comment.