Skip to content

Commit

Permalink
fix the linter error
Browse files Browse the repository at this point in the history
Signed-off-by: slayer321 <[email protected]>
  • Loading branch information
slayer321 committed Jul 9, 2023
1 parent aa0a7a8 commit caa509f
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions apis/v1beta1/validation/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,49 +1147,50 @@ func TestValidateRequestRedirectFiltersWithNoBackendRef(t *testing.T) {
name string
rules []gatewayv1b1.HTTPRouteRule
errCount int
}{{
name: "backendref with request redirect httpRoute filter",
errCount: 1,
rules: []gatewayv1b1.HTTPRouteRule{
{
Filters: []gatewayv1b1.HTTPRouteFilter{
{
Type: gatewayv1b1.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayv1b1.HTTPRequestRedirectFilter{
Scheme: ptrTo("https"),
StatusCode: ptrTo(301),
}{
{
name: "backendref with request redirect httpRoute filter",
errCount: 1,
rules: []gatewayv1b1.HTTPRouteRule{
{
Filters: []gatewayv1b1.HTTPRouteFilter{
{
Type: gatewayv1b1.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayv1b1.HTTPRequestRedirectFilter{
Scheme: ptrTo("https"),
StatusCode: ptrTo(301),
},
},
},
},
BackendRefs: []gatewayv1b1.HTTPBackendRef{
{
BackendRef: gatewayv1b1.BackendRef{
BackendObjectReference: gatewayv1b1.BackendObjectReference{
Name: testService,
Port: ptrTo(gatewayv1b1.PortNumber(80)),
BackendRefs: []gatewayv1b1.HTTPBackendRef{
{
BackendRef: gatewayv1b1.BackendRef{
BackendObjectReference: gatewayv1b1.BackendObjectReference{
Name: testService,
Port: ptrTo(gatewayv1b1.PortNumber(80)),
},
},
},
},
},
},
},
}, {
name: "request redirect without backendref in httpRoute filter",
errCount: 0,
rules: []gatewayv1b1.HTTPRouteRule{
{
Filters: []gatewayv1b1.HTTPRouteFilter{
{
Type: gatewayv1b1.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayv1b1.HTTPRequestRedirectFilter{
Scheme: ptrTo("https"),
StatusCode: ptrTo(301),
}, {
name: "request redirect without backendref in httpRoute filter",
errCount: 0,
rules: []gatewayv1b1.HTTPRouteRule{
{
Filters: []gatewayv1b1.HTTPRouteFilter{
{
Type: gatewayv1b1.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayv1b1.HTTPRequestRedirectFilter{
Scheme: ptrTo("https"),
StatusCode: ptrTo(301),
},
},
},
},
},
},
},
}

for _, tc := range tests {
Expand Down

0 comments on commit caa509f

Please sign in to comment.