Skip to content

Commit

Permalink
Merge pull request #837 from howardjohn/mirror/backend-required
Browse files Browse the repository at this point in the history
Make MirrorFilter.BackendRef required
  • Loading branch information
k8s-ci-robot authored Aug 30, 2021
2 parents bd2a154 + 4c171a6 commit a4fc2e2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
4 changes: 1 addition & 3 deletions apis/v1alpha2/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,7 @@ type HTTPRequestMirrorFilter struct {
//
// Support: Extended for Kubernetes Service
// Support: Custom for any other resource
//
// +optional
BackendRef *BackendObjectReference `json:"backendRef,omitempty"`
BackendRef BackendObjectReference `json:"backendRef"`
}

// HTTPBackendRef defines how a HTTPRoute should forward an HTTP request.
Expand Down
16 changes: 8 additions & 8 deletions apis/v1alpha2/validation/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8081),
},
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8080),
},
Expand All @@ -121,7 +121,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: specialService,
Port: portNumberPtr(8080),
},
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8080),
},
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8080),
},
Expand All @@ -225,7 +225,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8080),
},
Expand All @@ -245,7 +245,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: specialService,
Port: portNumberPtr(8080),
},
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestValidateHTTPRoute(t *testing.T) {
{
Type: gatewayv1a2.HTTPRouteFilterRequestMirror,
RequestMirror: &gatewayv1a2.HTTPRequestMirrorFilter{
BackendRef: &gatewayv1a2.BackendObjectReference{
BackendRef: gatewayv1a2.BackendObjectReference{
Name: testService,
Port: portNumberPtr(8080),
},
Expand Down
6 changes: 1 addition & 5 deletions apis/v1alpha2/zz_generated.deepcopy.go

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

4 changes: 4 additions & 0 deletions config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml

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

0 comments on commit a4fc2e2

Please sign in to comment.