diff --git a/apis/v1/object_reference_types.go b/apis/v1/object_reference_types.go index 421572aceb..0d84035747 100644 --- a/apis/v1/object_reference_types.go +++ b/apis/v1/object_reference_types.go @@ -27,6 +27,8 @@ package v1 type LocalObjectReference struct { // Group is the group of the referent. For example, "gateway.networking.k8s.io". // When unspecified or empty string, core API group is inferred. + // + // +optional Group Group `json:"group"` // Kind is kind of the referent. For example "HTTPRoute" or "Service". diff --git a/config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml b/config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml index 8a589b7e95..bf045b1bc5 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml @@ -211,7 +211,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object diff --git a/config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml b/config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml index f0c6cbc77d..ece38ff327 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_grpcroutes.yaml @@ -573,7 +573,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -1293,7 +1292,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -3033,7 +3031,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -3753,7 +3750,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object diff --git a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml index e72d02c694..1f3a497bb9 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml @@ -565,7 +565,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -1626,7 +1625,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -4032,7 +4030,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -5093,7 +5090,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object diff --git a/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml b/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml index d11f0b279b..80e68ab86e 100644 --- a/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml @@ -544,7 +544,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -1218,7 +1217,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -2755,7 +2753,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -3429,7 +3426,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object diff --git a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml index 88aacdec03..25134ee864 100644 --- a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml @@ -536,7 +536,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -1551,7 +1550,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -3646,7 +3644,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object @@ -4661,7 +4658,6 @@ spec: minLength: 1 type: string required: - - group - kind - name type: object diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 6508bd7717..e010cc4948 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -5156,7 +5156,7 @@ func schema_sigsk8sio_gateway_api_apis_v1_LocalObjectReference(ref common.Refere }, }, }, - Required: []string{"group", "kind", "name"}, + Required: []string{"kind", "name"}, }, }, } diff --git a/pkg/test/cel/grpcroute_experimental_test.go b/pkg/test/cel/grpcroute_experimental_test.go index 781a1947c0..4897e5c137 100644 --- a/pkg/test/cel/grpcroute_experimental_test.go +++ b/pkg/test/cel/grpcroute_experimental_test.go @@ -55,7 +55,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { rules []gatewayv1.GRPCRouteRule }{ { - name: "GRPCRoute - Invalid because both percent and fraction are specified", + name: "GRPCRoute - Invalid because both percent and fraction are specified", wantErrors: []string{"Only one of percent or fraction may be specified in HTTPRequestMirrorFilter"}, rules: []gatewayv1.GRPCRouteRule{{ Filters: []gatewayv1.GRPCRouteFilter{{ @@ -67,7 +67,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { }, Percent: &percent, Fraction: &gatewayv1.Fraction{ - Numerator: 83, + Numerator: 83, Denominator: &denominator, }, }, @@ -75,7 +75,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "GRPCRoute - Invalid fraction - numerator greater than denominator", + name: "GRPCRoute - Invalid fraction - numerator greater than denominator", wantErrors: []string{"numerator must be less than or equal to denominator"}, rules: []gatewayv1.GRPCRouteRule{{ Filters: []gatewayv1.GRPCRouteFilter{{ @@ -86,7 +86,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 1001, + Numerator: 1001, Denominator: &denominator, }, }, @@ -94,7 +94,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "GRPCRoute - Invalid fraction - denominator is 0", + name: "GRPCRoute - Invalid fraction - denominator is 0", wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.denominator in body should be greater than or equal to 1"}, rules: []gatewayv1.GRPCRouteRule{{ Filters: []gatewayv1.GRPCRouteFilter{{ @@ -105,7 +105,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 0, + Numerator: 0, Denominator: &bad_denominator, }, }, @@ -113,7 +113,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "GRPCRoute - Invalid fraction - numerator is negative", + name: "GRPCRoute - Invalid fraction - numerator is negative", wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.numerator in body should be greater than or equal to 0"}, rules: []gatewayv1.GRPCRouteRule{{ Filters: []gatewayv1.GRPCRouteFilter{{ @@ -124,7 +124,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: -1, + Numerator: -1, Denominator: &denominator, }, }, @@ -157,7 +157,7 @@ func TestGRPCRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 83, + Numerator: 83, Denominator: &denominator, }, }, diff --git a/pkg/test/cel/httproute_experimental_test.go b/pkg/test/cel/httproute_experimental_test.go index a141899e37..f6ff0d455b 100644 --- a/pkg/test/cel/httproute_experimental_test.go +++ b/pkg/test/cel/httproute_experimental_test.go @@ -444,7 +444,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { rules []gatewayv1.HTTPRouteRule }{ { - name: "HTTPRoute - Invalid because both percent and fraction are specified", + name: "HTTPRoute - Invalid because both percent and fraction are specified", wantErrors: []string{"Only one of percent or fraction may be specified in HTTPRequestMirrorFilter"}, rules: []gatewayv1.HTTPRouteRule{{ Filters: []gatewayv1.HTTPRouteFilter{{ @@ -456,7 +456,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { }, Percent: &percent, Fraction: &gatewayv1.Fraction{ - Numerator: 83, + Numerator: 83, Denominator: &denominator, }, }, @@ -464,7 +464,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "HTTPRoute - Invalid fraction - numerator greater than denominator", + name: "HTTPRoute - Invalid fraction - numerator greater than denominator", wantErrors: []string{"numerator must be less than or equal to denominator"}, rules: []gatewayv1.HTTPRouteRule{{ Filters: []gatewayv1.HTTPRouteFilter{{ @@ -475,7 +475,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 1001, + Numerator: 1001, Denominator: &denominator, }, }, @@ -483,7 +483,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "HTTPRoute - Invalid fraction - denominator is 0", + name: "HTTPRoute - Invalid fraction - denominator is 0", wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.denominator in body should be greater than or equal to 1"}, rules: []gatewayv1.HTTPRouteRule{{ Filters: []gatewayv1.HTTPRouteFilter{{ @@ -494,7 +494,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 0, + Numerator: 0, Denominator: &bad_denominator, }, }, @@ -502,7 +502,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { }}, }, { - name: "HTTPRoute - Invalid fraction - numerator is negative", + name: "HTTPRoute - Invalid fraction - numerator is negative", wantErrors: []string{"spec.rules[0].filters[0].requestMirror.fraction.numerator in body should be greater than or equal to 0"}, rules: []gatewayv1.HTTPRouteRule{{ Filters: []gatewayv1.HTTPRouteFilter{{ @@ -513,7 +513,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: -1, + Numerator: -1, Denominator: &denominator, }, }, @@ -546,7 +546,7 @@ func TestHTTPRequestMirrorFilterExperimental(t *testing.T) { Port: ptrTo(gatewayv1.PortNumber(8081)), }, Fraction: &gatewayv1.Fraction{ - Numerator: 83, + Numerator: 83, Denominator: &denominator, }, },