Skip to content

Commit

Permalink
Update HTTPRequestRedirectPolicy tests to use RedirectResponseCode
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Schulze <[email protected]>
  • Loading branch information
billyjs committed Nov 26, 2024
1 parent 4af6a40 commit f4e4e33
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apis/projectcontour/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/dag/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12395,7 +12395,7 @@ func TestDAGInsert(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
},
}},
},
Expand Down Expand Up @@ -12438,7 +12438,7 @@ func TestDAGInsert(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
},
}},
},
Expand Down Expand Up @@ -12490,7 +12490,7 @@ func TestDAGInsert(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
},
}},
},
Expand Down Expand Up @@ -12643,7 +12643,7 @@ func TestDAGInsert(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/dag/httpproxy_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1951,7 +1951,7 @@ func redirectRoutePolicy(redirect *contour_v1.HTTPRequestRedirectPolicy) (*Redir

var statusCode int
if redirect.StatusCode != nil {
statusCode = *redirect.StatusCode
statusCode = int(*redirect.StatusCode)
}

if redirect.Path != nil && redirect.Prefix != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/featuretests/v3/redirectroutepolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestRedirectResponsePolicy_HTTProxy(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
Path: ptr.To("/blog"),
},
}},
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestRedirectResponsePolicy_HTTProxy(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
Prefix: ptr.To("/blogprefix"),
},
}},
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestRedirectResponsePolicy_HTTProxy(t *testing.T) {
Scheme: ptr.To("https"),
Hostname: ptr.To("envoyproxy.io"),
Port: ptr.To(int32(443)),
StatusCode: ptr.To(301),
StatusCode: ptr.To(contour_v1.RedirectResponseCode(301)),
Prefix: ptr.To("/blogprefix"),
Path: ptr.To("/blogprefix"),
},
Expand Down

0 comments on commit f4e4e33

Please sign in to comment.