Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-osborn committed Sep 26, 2024
1 parent 8979e48 commit 1cfbac5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/mode/static/state/dataplane/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
},
Expand Down Expand Up @@ -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",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/state/graph/common_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestValidateFilter(t *testing.T) {
{
filter: Filter{
RouteType: RouteTypeHTTP,
FilterType: "RequestMirror",
FilterType: FilterRequestMirror,
},
expectErrCount: 1,
name: "unsupported HTTP filter type",
Expand Down
3 changes: 2 additions & 1 deletion internal/mode/static/state/graph/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion internal/mode/static/state/graph/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ func TestBuildHTTPRoute(t *testing.T) {
"hr",
gatewayNsName.Name,
"example.com",
invalidPath, "/filter", "/",
invalidPath,
"/filter",
"/",
)
addFilterToPath(hrDroppedInvalidMatchesAndInvalidFilters, "/filter", invalidFilter)

Expand Down

0 comments on commit 1cfbac5

Please sign in to comment.