diff --git a/apis/v1alpha2/gateway_types.go b/apis/v1alpha2/gateway_types.go index 915742991f..c8830cce1d 100644 --- a/apis/v1alpha2/gateway_types.go +++ b/apis/v1alpha2/gateway_types.go @@ -24,7 +24,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,shortName=gtw // +kubebuilder:subresource:status -// +kubebuilder:storageversion +// +kubebuilder:unservedversion // +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` // +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value` // +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status` diff --git a/apis/v1alpha2/gatewayclass_types.go b/apis/v1alpha2/gatewayclass_types.go index e73b6b36dd..0d7a252222 100644 --- a/apis/v1alpha2/gatewayclass_types.go +++ b/apis/v1alpha2/gatewayclass_types.go @@ -25,7 +25,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc // +kubebuilder:subresource:status -// +kubebuilder:storageversion +// +kubebuilder:unservedversion // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` // +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` diff --git a/apis/v1alpha2/httproute_types.go b/apis/v1alpha2/httproute_types.go index c7b45e007b..13b982229a 100644 --- a/apis/v1alpha2/httproute_types.go +++ b/apis/v1alpha2/httproute_types.go @@ -24,7 +24,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status -// +kubebuilder:storageversion +// +kubebuilder:unservedversion // +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` diff --git a/apis/v1beta1/gateway_types.go b/apis/v1beta1/gateway_types.go index 0dbb30f0fb..3ff65f0f70 100644 --- a/apis/v1beta1/gateway_types.go +++ b/apis/v1beta1/gateway_types.go @@ -23,6 +23,7 @@ import ( // +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,shortName=gtw +// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` // +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value` diff --git a/apis/v1beta1/gatewayclass_types.go b/apis/v1beta1/gatewayclass_types.go index 76c10631ac..2cc57e6fdc 100644 --- a/apis/v1beta1/gatewayclass_types.go +++ b/apis/v1beta1/gatewayclass_types.go @@ -24,6 +24,7 @@ import ( // +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc +// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` // +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` diff --git a/apis/v1beta1/httproute_types.go b/apis/v1beta1/httproute_types.go index 02faedad8d..be9e36d94c 100644 --- a/apis/v1beta1/httproute_types.go +++ b/apis/v1beta1/httproute_types.go @@ -23,6 +23,7 @@ import ( // +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api +// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` diff --git a/config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml b/config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml index ca55ba2d7a..012e5b04bc 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml @@ -217,8 +217,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -419,7 +419,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml b/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml index 2ab4e837d7..630f7bdba6 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml @@ -711,8 +711,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -1406,7 +1406,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml index acf6caf7f2..571ca22b60 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml @@ -1627,8 +1627,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -3230,7 +3230,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml b/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml index 6bc3bb1496..b85fc19dcf 100644 --- a/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml @@ -217,8 +217,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -419,7 +419,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/config/crd/standard/gateway.networking.k8s.io_gateways.yaml b/config/crd/standard/gateway.networking.k8s.io_gateways.yaml index b17b04139c..a89184286d 100644 --- a/config/crd/standard/gateway.networking.k8s.io_gateways.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_gateways.yaml @@ -711,8 +711,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -1406,7 +1406,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml index e260dc9744..cfe406d0c0 100644 --- a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml @@ -1356,8 +1356,8 @@ spec: required: - spec type: object - served: true - storage: true + served: false + storage: false subresources: status: {} - additionalPrinterColumns: @@ -2688,7 +2688,7 @@ spec: - spec type: object served: true - storage: false + storage: true subresources: status: {} status: diff --git a/conformance/base/manifests.yaml b/conformance/base/manifests.yaml index 9d5a508e98..1b2c2181dd 100644 --- a/conformance/base/manifests.yaml +++ b/conformance/base/manifests.yaml @@ -13,7 +13,7 @@ metadata: labels: gateway-conformance: infra --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: same-namespace @@ -28,7 +28,7 @@ spec: namespaces: from: Same --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: all-namespaces @@ -43,7 +43,7 @@ spec: namespaces: from: All --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: backend-namespaces diff --git a/conformance/conformance_test.go b/conformance/conformance_test.go index e5a1a52ca8..417daf5f90 100644 --- a/conformance/conformance_test.go +++ b/conformance/conformance_test.go @@ -21,6 +21,7 @@ import ( "testing" "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/tests" "sigs.k8s.io/gateway-api/conformance/utils/flags" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -40,6 +41,7 @@ func TestConformance(t *testing.T) { t.Fatalf("Error initializing Kubernetes client: %v", err) } v1alpha2.AddToScheme(client.Scheme()) + v1beta1.AddToScheme(client.Scheme()) t.Logf("Running conformance tests with %s GatewayClass", *flags.GatewayClassName) diff --git a/conformance/tests/gateway-secret-invalid-reference-grant.go b/conformance/tests/gateway-secret-invalid-reference-grant.go index 7b1522fe9a..4ae38fd55f 100644 --- a/conformance/tests/gateway-secret-invalid-reference-grant.go +++ b/conformance/tests/gateway-secret-invalid-reference-grant.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -40,16 +40,16 @@ var GatewaySecretInvalidReferenceGrant = suite.ConformanceTest{ gwNN := types.NamespacedName{Name: "gateway-secret-invalid-reference-grant", Namespace: "gateway-conformance-infra"} t.Run("Gateway listener should have a false ResolvedRefs condition with reason RefNotPermitted", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("https"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), + listeners := []v1beta1.ListenerStatus{{ + Name: v1beta1.SectionName("https"), + SupportedKinds: []v1beta1.RouteGroupKind{{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), + Kind: v1beta1.Kind("HTTPRoute"), }}, Conditions: []metav1.Condition{{ - Type: string(v1alpha2.ListenerConditionResolvedRefs), + Type: string(v1beta1.ListenerConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.ListenerReasonRefNotPermitted), + Reason: string(v1beta1.ListenerReasonRefNotPermitted), }}, }} diff --git a/conformance/tests/gateway-secret-invalid-reference-grant.yaml b/conformance/tests/gateway-secret-invalid-reference-grant.yaml index e93e6cdee5..51b719202b 100644 --- a/conformance/tests/gateway-secret-invalid-reference-grant.yaml +++ b/conformance/tests/gateway-secret-invalid-reference-grant.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway-secret-invalid-reference-grant diff --git a/conformance/tests/gateway-secret-missing-reference-grant.go b/conformance/tests/gateway-secret-missing-reference-grant.go index d626de1997..76fcf6e3ca 100644 --- a/conformance/tests/gateway-secret-missing-reference-grant.go +++ b/conformance/tests/gateway-secret-missing-reference-grant.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -40,16 +40,16 @@ var GatewaySecretMissingReferenceGrant = suite.ConformanceTest{ gwNN := types.NamespacedName{Name: "gateway-secret-missing-reference-grant", Namespace: "gateway-conformance-infra"} t.Run("Gateway listener should have a false ResolvedRefs condition with reason RefNotPermitted", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("https"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), + listeners := []v1beta1.ListenerStatus{{ + Name: v1beta1.SectionName("https"), + SupportedKinds: []v1beta1.RouteGroupKind{{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), + Kind: v1beta1.Kind("HTTPRoute"), }}, Conditions: []metav1.Condition{{ - Type: string(v1alpha2.ListenerConditionResolvedRefs), + Type: string(v1beta1.ListenerConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.ListenerReasonRefNotPermitted), + Reason: string(v1beta1.ListenerReasonRefNotPermitted), }}, }} diff --git a/conformance/tests/gateway-secret-missing-reference-grant.yaml b/conformance/tests/gateway-secret-missing-reference-grant.yaml index aede0d07cd..a3c53abe1a 100644 --- a/conformance/tests/gateway-secret-missing-reference-grant.yaml +++ b/conformance/tests/gateway-secret-missing-reference-grant.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway-secret-missing-reference-grant diff --git a/conformance/tests/gateway-secret-missing-referenced-secret.go b/conformance/tests/gateway-secret-missing-referenced-secret.go index d41fbd3501..919a21484d 100644 --- a/conformance/tests/gateway-secret-missing-referenced-secret.go +++ b/conformance/tests/gateway-secret-missing-referenced-secret.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -39,16 +39,16 @@ var GatewaySecretMissingReferencedSecret = suite.ConformanceTest{ gwNN := types.NamespacedName{Name: "gateway-secret-missing-referenced-secret", Namespace: "gateway-conformance-infra"} t.Run("Gateway listener should have a false ResolvedRefs condition with reason InvalidCertificateRef", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("https"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), + listeners := []v1beta1.ListenerStatus{{ + Name: v1beta1.SectionName("https"), + SupportedKinds: []v1beta1.RouteGroupKind{{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), + Kind: v1beta1.Kind("HTTPRoute"), }}, Conditions: []metav1.Condition{{ - Type: string(v1alpha2.ListenerConditionResolvedRefs), + Type: string(v1beta1.ListenerConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.ListenerReasonInvalidCertificateRef), + Reason: string(v1beta1.ListenerReasonInvalidCertificateRef), }}, }} diff --git a/conformance/tests/gateway-secret-missing-referenced-secret.yaml b/conformance/tests/gateway-secret-missing-referenced-secret.yaml index bfdbd2b4e6..8c52c8e67e 100644 --- a/conformance/tests/gateway-secret-missing-referenced-secret.yaml +++ b/conformance/tests/gateway-secret-missing-referenced-secret.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway-secret-missing-referenced-secret diff --git a/conformance/tests/gateway-secret-reference-grant-all-in-namespace.go b/conformance/tests/gateway-secret-reference-grant-all-in-namespace.go index 8ba87ecd6c..2507a836ad 100644 --- a/conformance/tests/gateway-secret-reference-grant-all-in-namespace.go +++ b/conformance/tests/gateway-secret-reference-grant-all-in-namespace.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -40,17 +40,17 @@ var GatewaySecretReferenceGrantAllInNamespace = suite.ConformanceTest{ gwNN := types.NamespacedName{Name: "gateway-secret-reference-grant", Namespace: "gateway-conformance-infra"} t.Run("Gateway listener should have a true ResolvedRefs condition and a true Ready condition", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("https"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), + listeners := []v1beta1.ListenerStatus{{ + Name: v1beta1.SectionName("https"), + SupportedKinds: []v1beta1.RouteGroupKind{{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), + Kind: v1beta1.Kind("HTTPRoute"), }}, Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: metav1.ConditionTrue, - Reason: string(v1alpha2.ListenerReasonReady), + Reason: string(v1beta1.ListenerReasonReady), }, }, }} diff --git a/conformance/tests/gateway-secret-reference-grant-all-in-namespace.yaml b/conformance/tests/gateway-secret-reference-grant-all-in-namespace.yaml index 222854aadc..57e7faed3e 100644 --- a/conformance/tests/gateway-secret-reference-grant-all-in-namespace.yaml +++ b/conformance/tests/gateway-secret-reference-grant-all-in-namespace.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway-secret-reference-grant diff --git a/conformance/tests/gateway-secret-reference-grant-specific.go b/conformance/tests/gateway-secret-reference-grant-specific.go index b5765b7dad..fffbceb5ef 100644 --- a/conformance/tests/gateway-secret-reference-grant-specific.go +++ b/conformance/tests/gateway-secret-reference-grant-specific.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -40,17 +40,17 @@ var GatewaySecretReferenceGrantSpecific = suite.ConformanceTest{ gwNN := types.NamespacedName{Name: "gateway-secret-reference-grant", Namespace: "gateway-conformance-infra"} t.Run("Gateway listener should have a true ResolvedRefs condition and a true Ready condition", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("https"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), + listeners := []v1beta1.ListenerStatus{{ + Name: v1beta1.SectionName("https"), + SupportedKinds: []v1beta1.RouteGroupKind{{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), + Kind: v1beta1.Kind("HTTPRoute"), }}, Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: metav1.ConditionTrue, - Reason: string(v1alpha2.ListenerReasonReady), + Reason: string(v1beta1.ListenerReasonReady), }, }, }} diff --git a/conformance/tests/gateway-secret-reference-grant-specific.yaml b/conformance/tests/gateway-secret-reference-grant-specific.yaml index 8caa0270a1..e604f5da5c 100644 --- a/conformance/tests/gateway-secret-reference-grant-specific.yaml +++ b/conformance/tests/gateway-secret-reference-grant-specific.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway-secret-reference-grant diff --git a/conformance/tests/httproute-cross-namespace.yaml b/conformance/tests/httproute-cross-namespace.yaml index 37460e319b..97aee27f54 100644 --- a/conformance/tests/httproute-cross-namespace.yaml +++ b/conformance/tests/httproute-cross-namespace.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: cross-namespace diff --git a/conformance/tests/httproute-disallowed-kind.go b/conformance/tests/httproute-disallowed-kind.go index e96e0e0823..736f9410d1 100644 --- a/conformance/tests/httproute-disallowed-kind.go +++ b/conformance/tests/httproute-disallowed-kind.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -49,7 +49,7 @@ var HTTPRouteDisallowedKind = suite.ConformanceTest{ }) t.Run("Gateway should have 0 Routes attached", func(t *testing.T) { - gw := &v1alpha2.Gateway{} + gw := &v1beta1.Gateway{} err := suite.Client.Get(context.TODO(), gwName, gw) require.NoError(t, err, "error fetching Gateway") // There are two valid ways to represent this: diff --git a/conformance/tests/httproute-disallowed-kind.yaml b/conformance/tests/httproute-disallowed-kind.yaml index ac896aced6..ed12bb0fdc 100644 --- a/conformance/tests/httproute-disallowed-kind.yaml +++ b/conformance/tests/httproute-disallowed-kind.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: tlsroutes-only @@ -17,7 +17,7 @@ spec: kinds: - kind: TLSRoute --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: disallowed-kind diff --git a/conformance/tests/httproute-exact-path-matching.yaml b/conformance/tests/httproute-exact-path-matching.yaml index b6326871b4..b670cb1a64 100644 --- a/conformance/tests/httproute-exact-path-matching.yaml +++ b/conformance/tests/httproute-exact-path-matching.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: exact-matching diff --git a/conformance/tests/httproute-header-matching.yaml b/conformance/tests/httproute-header-matching.yaml index b9009615bf..ef74e9de84 100644 --- a/conformance/tests/httproute-header-matching.yaml +++ b/conformance/tests/httproute-header-matching.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: header-matching diff --git a/conformance/tests/httproute-hostname-intersection.go b/conformance/tests/httproute-hostname-intersection.go index a62e8acd36..9e4f4d2bbe 100644 --- a/conformance/tests/httproute-hostname-intersection.go +++ b/conformance/tests/httproute-hostname-intersection.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -192,14 +192,14 @@ var HTTPRouteHostnameIntersection = suite.ConformanceTest{ gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeReady(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN)) routeName := types.NamespacedName{Namespace: ns, Name: "no-intersecting-hosts"} - parents := []v1alpha2.RouteParentStatus{{ + parents := []v1beta1.RouteParentStatus{{ ParentRef: parentRefTo(gwNN), - ControllerName: v1alpha2.GatewayController(suite.ControllerName), + ControllerName: v1beta1.GatewayController(suite.ControllerName), Conditions: []metav1.Condition{ { - Type: string(v1alpha2.RouteConditionAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonNoMatchingListenerHostname), + Reason: string(v1beta1.RouteReasonNoMatchingListenerHostname), }, }, }} @@ -230,15 +230,15 @@ var HTTPRouteHostnameIntersection = suite.ConformanceTest{ }, } -func parentRefTo(gateway types.NamespacedName) v1alpha2.ParentReference { +func parentRefTo(gateway types.NamespacedName) v1beta1.ParentReference { var ( - group = v1alpha2.Group(v1alpha2.GroupName) - kind = v1alpha2.Kind("Gateway") - namespace = v1alpha2.Namespace(gateway.Namespace) - name = v1alpha2.ObjectName(gateway.Name) + group = v1beta1.Group(v1beta1.GroupName) + kind = v1beta1.Kind("Gateway") + namespace = v1beta1.Namespace(gateway.Namespace) + name = v1beta1.ObjectName(gateway.Name) ) - return v1alpha2.ParentReference{ + return v1beta1.ParentReference{ Group: &group, Kind: &kind, Namespace: &namespace, diff --git a/conformance/tests/httproute-hostname-intersection.yaml b/conformance/tests/httproute-hostname-intersection.yaml index 2f05159ea3..abbb32eddb 100644 --- a/conformance/tests/httproute-hostname-intersection.yaml +++ b/conformance/tests/httproute-hostname-intersection.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: httproute-hostname-intersection diff --git a/conformance/tests/httproute-invalid-backendref-nonexistent.go b/conformance/tests/httproute-invalid-backendref-nonexistent.go index e01a6fa1c5..318922f8e9 100644 --- a/conformance/tests/httproute-invalid-backendref-nonexistent.go +++ b/conformance/tests/httproute-invalid-backendref-nonexistent.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -45,9 +45,9 @@ var HTTPRouteInvalidNonExistentBackendRef = suite.ConformanceTest{ t.Run("HTTPRoute with only a nonexistent BackendRef has a ResolvedRefs Condition with status False and Reason BackendNotFound", func(t *testing.T) { resolvedRefsCond := metav1.Condition{ - Type: string(v1alpha2.RouteConditionResolvedRefs), + Type: string(v1beta1.RouteConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonBackendNotFound), + Reason: string(v1beta1.RouteReasonBackendNotFound), } kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, resolvedRefsCond) diff --git a/conformance/tests/httproute-invalid-backendref-nonexistent.yaml b/conformance/tests/httproute-invalid-backendref-nonexistent.yaml index 726ac1c95a..2bf55aafc2 100644 --- a/conformance/tests/httproute-invalid-backendref-nonexistent.yaml +++ b/conformance/tests/httproute-invalid-backendref-nonexistent.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: invalid-nonexistent-backend-ref diff --git a/conformance/tests/httproute-invalid-backendref-unknown-kind.go b/conformance/tests/httproute-invalid-backendref-unknown-kind.go index 63ae140a1e..740e65f5c2 100644 --- a/conformance/tests/httproute-invalid-backendref-unknown-kind.go +++ b/conformance/tests/httproute-invalid-backendref-unknown-kind.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -46,9 +46,9 @@ var HTTPRouteInvalidBackendRefUnknownKind = suite.ConformanceTest{ // The Route must have a ResolvedRefs Condition with a InvalidKind Reason. t.Run("HTTPRoute with Invalid Kind has a ResolvedRefs Condition with status False and Reason InvalidKind", func(t *testing.T) { resolvedRefsCond := metav1.Condition{ - Type: string(v1alpha2.RouteConditionResolvedRefs), + Type: string(v1beta1.RouteConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonInvalidKind), + Reason: string(v1beta1.RouteReasonInvalidKind), } kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, resolvedRefsCond) diff --git a/conformance/tests/httproute-invalid-backendref-unknown-kind.yaml b/conformance/tests/httproute-invalid-backendref-unknown-kind.yaml index 2ff3bbedd9..b01aa1224f 100644 --- a/conformance/tests/httproute-invalid-backendref-unknown-kind.yaml +++ b/conformance/tests/httproute-invalid-backendref-unknown-kind.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: invalid-backend-ref-unknown-kind diff --git a/conformance/tests/httproute-invalid-cross-namespace-backend-ref.go b/conformance/tests/httproute-invalid-cross-namespace-backend-ref.go index 496c42525d..a1f2caff2e 100644 --- a/conformance/tests/httproute-invalid-cross-namespace-backend-ref.go +++ b/conformance/tests/httproute-invalid-cross-namespace-backend-ref.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -49,9 +49,9 @@ var HTTPRouteInvalidCrossNamespaceBackendRef = suite.ConformanceTest{ t.Run("HTTPRoute with a cross-namespace BackendRef and no ReferenceGrant has a ResolvedRefs Condition with status False and Reason RefNotPermitted", func(t *testing.T) { resolvedRefsCond := metav1.Condition{ - Type: string(v1alpha2.RouteConditionResolvedRefs), + Type: string(v1beta1.RouteConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonRefNotPermitted), + Reason: string(v1beta1.RouteReasonRefNotPermitted), } kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, resolvedRefsCond) diff --git a/conformance/tests/httproute-invalid-cross-namespace-backend-ref.yaml b/conformance/tests/httproute-invalid-cross-namespace-backend-ref.yaml index 6503d57ee8..9c81c1a4b2 100644 --- a/conformance/tests/httproute-invalid-cross-namespace-backend-ref.yaml +++ b/conformance/tests/httproute-invalid-cross-namespace-backend-ref.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: invalid-cross-namespace-backend-ref diff --git a/conformance/tests/httproute-invalid-cross-namespace-parent-ref.go b/conformance/tests/httproute-invalid-cross-namespace-parent-ref.go index df14df7ea9..75484d3d07 100644 --- a/conformance/tests/httproute-invalid-cross-namespace-parent-ref.go +++ b/conformance/tests/httproute-invalid-cross-namespace-parent-ref.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" ) @@ -47,7 +47,7 @@ var HTTPRouteInvalidCrossNamespaceParentRef = suite.ConformanceTest{ t.Run("Gateway should have 0 Routes attached", func(t *testing.T) { require.Eventually(t, func() bool { - gw := &v1alpha2.Gateway{} + gw := &v1beta1.Gateway{} if err := suite.Client.Get(context.TODO(), gwName, gw); err != nil { t.Logf("error fetching gateway: %v", err) return false diff --git a/conformance/tests/httproute-invalid-cross-namespace-parent-ref.yaml b/conformance/tests/httproute-invalid-cross-namespace-parent-ref.yaml index 9239422836..7e5810b3ff 100644 --- a/conformance/tests/httproute-invalid-cross-namespace-parent-ref.yaml +++ b/conformance/tests/httproute-invalid-cross-namespace-parent-ref.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: invalid-cross-namespace-parent-ref diff --git a/conformance/tests/httproute-invalid-reference-grant.go b/conformance/tests/httproute-invalid-reference-grant.go index cba28c4b85..1089e0db88 100644 --- a/conformance/tests/httproute-invalid-reference-grant.go +++ b/conformance/tests/httproute-invalid-reference-grant.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -49,9 +49,9 @@ var HTTPRouteInvalidReferenceGrant = suite.ConformanceTest{ t.Run("HTTPRoute with BackendRef in another namespace and no ReferenceGrant covering the Service has a ResolvedRefs Condition with status False and Reason RefNotPermitted", func(t *testing.T) { resolvedRefsCond := metav1.Condition{ - Type: string(v1alpha2.RouteConditionResolvedRefs), + Type: string(v1beta1.RouteConditionResolvedRefs), Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonRefNotPermitted), + Reason: string(v1beta1.RouteReasonRefNotPermitted), } kubernetes.HTTPRouteMustHaveCondition(t, s.Client, s.TimeoutConfig, routeNN, gwNN, resolvedRefsCond) diff --git a/conformance/tests/httproute-invalid-reference-grant.yaml b/conformance/tests/httproute-invalid-reference-grant.yaml index 144109a288..562a6f6a05 100644 --- a/conformance/tests/httproute-invalid-reference-grant.yaml +++ b/conformance/tests/httproute-invalid-reference-grant.yaml @@ -13,7 +13,7 @@ spec: kind: Service name: app-backend-v1 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: invalid-reference-grant diff --git a/conformance/tests/httproute-listener-hostname-matching.yaml b/conformance/tests/httproute-listener-hostname-matching.yaml index 109ec89444..f00c9786d1 100644 --- a/conformance/tests/httproute-listener-hostname-matching.yaml +++ b/conformance/tests/httproute-listener-hostname-matching.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: httproute-listener-hostname-matching @@ -35,7 +35,7 @@ spec: from: Same hostname: "*.foo.com" --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: backend-v1 @@ -50,7 +50,7 @@ spec: - name: infra-backend-v1 port: 8080 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: backend-v2 @@ -65,7 +65,7 @@ spec: - name: infra-backend-v2 port: 8080 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: backend-v3 diff --git a/conformance/tests/httproute-matching-across-routes.yaml b/conformance/tests/httproute-matching-across-routes.yaml index 013630519c..f06e30d8b8 100644 --- a/conformance/tests/httproute-matching-across-routes.yaml +++ b/conformance/tests/httproute-matching-across-routes.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: matching-part1 @@ -21,7 +21,7 @@ spec: - name: infra-backend-v1 port: 8080 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: matching-part2 diff --git a/conformance/tests/httproute-matching.yaml b/conformance/tests/httproute-matching.yaml index 0032ea5e60..b35171ed7e 100644 --- a/conformance/tests/httproute-matching.yaml +++ b/conformance/tests/httproute-matching.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: matching diff --git a/conformance/tests/httproute-query-param-matching.yaml b/conformance/tests/httproute-query-param-matching.yaml index c5eefea574..c4ddfe206c 100644 --- a/conformance/tests/httproute-query-param-matching.yaml +++ b/conformance/tests/httproute-query-param-matching.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: query-param-matching diff --git a/conformance/tests/httproute-reference-grant.yaml b/conformance/tests/httproute-reference-grant.yaml index 6dbbd273c4..16828b016a 100644 --- a/conformance/tests/httproute-reference-grant.yaml +++ b/conformance/tests/httproute-reference-grant.yaml @@ -13,7 +13,7 @@ spec: kind: Service name: web-backend --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: reference-grant diff --git a/conformance/tests/httproute-request-header-modifier.yaml b/conformance/tests/httproute-request-header-modifier.yaml index 7e036a664e..ad41b16d33 100644 --- a/conformance/tests/httproute-request-header-modifier.yaml +++ b/conformance/tests/httproute-request-header-modifier.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: request-header-modifier diff --git a/conformance/tests/httproute-simple-same-namespace.go b/conformance/tests/httproute-simple-same-namespace.go index d3402ee766..0cdbf92a44 100644 --- a/conformance/tests/httproute-simple-same-namespace.go +++ b/conformance/tests/httproute-simple-same-namespace.go @@ -21,7 +21,7 @@ import ( "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -36,7 +36,7 @@ var HTTPRouteSimpleSameNamespace = suite.ConformanceTest{ Description: "A single HTTPRoute in the gateway-conformance-infra namespace attaches to a Gateway in the same namespace", Manifests: []string{"tests/httproute-simple-same-namespace.yaml"}, Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { - ns := v1alpha2.Namespace("gateway-conformance-infra") + ns := v1beta1.Namespace("gateway-conformance-infra") routeNN := types.NamespacedName{Name: "gateway-conformance-infra-test", Namespace: string(ns)} gwNN := types.NamespacedName{Name: "same-namespace", Namespace: string(ns)} gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeReady(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) diff --git a/conformance/tests/httproute-simple-same-namespace.yaml b/conformance/tests/httproute-simple-same-namespace.yaml index a23c16ac65..5129a51a07 100644 --- a/conformance/tests/httproute-simple-same-namespace.yaml +++ b/conformance/tests/httproute-simple-same-namespace.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: gateway-conformance-infra-test diff --git a/conformance/utils/kubernetes/apply.go b/conformance/utils/kubernetes/apply.go index 62897f72e6..9ff3f4b5ad 100644 --- a/conformance/utils/kubernetes/apply.go +++ b/conformance/utils/kubernetes/apply.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/util/yaml" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance" "sigs.k8s.io/gateway-api/conformance/utils/config" ) @@ -48,12 +48,12 @@ type Applier struct { // For example, given two Gateways, each with 2 listeners, there should be // four ValidUniqueListenerPorts. // If empty or nil, ports are not modified. - ValidUniqueListenerPorts []v1alpha2.PortNumber + ValidUniqueListenerPorts []v1beta1.PortNumber } // prepareGateway adjusts both listener ports and the gatewayClassName. It // returns an index pointing to the next valid listener port. -func prepareGateway(t *testing.T, uObj *unstructured.Unstructured, gatewayClassName string, validListenerPorts []v1alpha2.PortNumber, portIndex int) int { +func prepareGateway(t *testing.T, uObj *unstructured.Unstructured, gatewayClassName string, validListenerPorts []v1beta1.PortNumber, portIndex int) int { err := unstructured.SetNestedField(uObj.Object, gatewayClassName, "spec", "gatewayClassName") require.NoErrorf(t, err, "error setting `spec.gatewayClassName` on %s Gateway resource", uObj.GetName()) diff --git a/conformance/utils/kubernetes/apply_test.go b/conformance/utils/kubernetes/apply_test.go index 6a37ae5634..3ee201fbe1 100644 --- a/conformance/utils/kubernetes/apply_test.go +++ b/conformance/utils/kubernetes/apply_test.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/yaml" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" _ "sigs.k8s.io/gateway-api/conformance/utils/flags" ) @@ -108,7 +108,7 @@ metadata: name: "no listener ports given", applier: Applier{}, given: ` -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: test @@ -124,7 +124,7 @@ spec: `, expected: []unstructured.Unstructured{{ Object: map[string]interface{}{ - "apiVersion": "gateway.networking.k8s.io/v1alpha2", + "apiVersion": "gateway.networking.k8s.io/v1beta1", "kind": "Gateway", "metadata": map[string]interface{}{ "name": "test", @@ -149,10 +149,10 @@ spec: }, { name: "multiple gateways each with multiple listeners", applier: Applier{ - ValidUniqueListenerPorts: []v1alpha2.PortNumber{8000, 8001, 8002, 8003}, + ValidUniqueListenerPorts: []v1beta1.PortNumber{8000, 8001, 8002, 8003}, }, given: ` -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: test @@ -172,7 +172,7 @@ spec: namespaces: from: Same --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: test2 @@ -194,7 +194,7 @@ spec: `, expected: []unstructured.Unstructured{{ Object: map[string]interface{}{ - "apiVersion": "gateway.networking.k8s.io/v1alpha2", + "apiVersion": "gateway.networking.k8s.io/v1beta1", "kind": "Gateway", "metadata": map[string]interface{}{ "name": "test", @@ -227,7 +227,7 @@ spec: }, }, { Object: map[string]interface{}{ - "apiVersion": "gateway.networking.k8s.io/v1alpha2", + "apiVersion": "gateway.networking.k8s.io/v1beta1", "kind": "Gateway", "metadata": map[string]interface{}{ "name": "test2", diff --git a/conformance/utils/kubernetes/helpers.go b/conformance/utils/kubernetes/helpers.go index c28c1ea7a0..fb54c0c1d1 100644 --- a/conformance/utils/kubernetes/helpers.go +++ b/conformance/utils/kubernetes/helpers.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/config" ) @@ -41,19 +41,19 @@ import ( // relying on a specific api version. type GatewayRef struct { types.NamespacedName - listenerNames []*v1alpha2.SectionName + listenerNames []*v1beta1.SectionName } // NewGatewayRef creates a GatewayRef resource. ListenerNames are optional. func NewGatewayRef(nn types.NamespacedName, listenerNames ...string) GatewayRef { - var listeners []*v1alpha2.SectionName + var listeners []*v1beta1.SectionName if len(listenerNames) == 0 { listenerNames = append(listenerNames, "") } for _, listener := range listenerNames { - sectionName := v1alpha2.SectionName(listener) + sectionName := v1beta1.SectionName(listener) listeners = append(listeners, §ionName) } return GatewayRef{ @@ -74,7 +74,7 @@ func GWCMustBeAccepted(t *testing.T, c client.Client, timeoutConfig config.Timeo ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - gwc := &v1alpha2.GatewayClass{} + gwc := &v1beta1.GatewayClass{} err := c.Get(ctx, types.NamespacedName{Name: gwcName}, gwc) if err != nil { return false, fmt.Errorf("error fetching GatewayClass: %w", err) @@ -100,7 +100,7 @@ func NamespacesMustBeReady(t *testing.T, c client.Client, timeoutConfig config.T defer cancel() for _, ns := range namespaces { - gwList := &v1alpha2.GatewayList{} + gwList := &v1beta1.GatewayList{} err := c.List(ctx, gwList, client.InNamespace(ns)) if err != nil { t.Errorf("Error listing Gateways: %v", err) @@ -142,8 +142,8 @@ func GatewayAndHTTPRoutesMustBeReady(t *testing.T, c client.Client, timeoutConfi gwAddr, err := WaitForGatewayAddress(t, c, timeoutConfig, gw.NamespacedName) require.NoErrorf(t, err, "timed out waiting for Gateway address to be assigned") - ns := v1alpha2.Namespace(gw.Namespace) - kind := v1alpha2.Kind("Gateway") + ns := v1beta1.Namespace(gw.Namespace) + kind := v1beta1.Kind("Gateway") for _, routeNN := range routeNNs { namespaceRequired := true @@ -151,22 +151,22 @@ func GatewayAndHTTPRoutesMustBeReady(t *testing.T, c client.Client, timeoutConfi namespaceRequired = false } - var parents []v1alpha2.RouteParentStatus + var parents []v1beta1.RouteParentStatus for _, listener := range gw.listenerNames { - parents = append(parents, v1alpha2.RouteParentStatus{ - ParentRef: v1alpha2.ParentReference{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), + parents = append(parents, v1beta1.RouteParentStatus{ + ParentRef: v1beta1.ParentReference{ + Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group), Kind: &kind, - Name: v1alpha2.ObjectName(gw.Name), + Name: v1beta1.ObjectName(gw.Name), Namespace: &ns, SectionName: listener, }, - ControllerName: v1alpha2.GatewayController(controllerName), + ControllerName: v1beta1.GatewayController(controllerName), Conditions: []metav1.Condition{ { - Type: string(v1alpha2.RouteConditionAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: metav1.ConditionTrue, - Reason: string(v1alpha2.RouteReasonAccepted), + Reason: string(v1beta1.RouteReasonAccepted), }, }, }) @@ -187,7 +187,7 @@ func WaitForGatewayAddress(t *testing.T, client client.Client, timeoutConfig con ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - gw := &v1alpha2.Gateway{} + gw := &v1beta1.Gateway{} err := client.Get(ctx, gwName, gw) if err != nil { t.Logf("error fetching Gateway: %v", err) @@ -198,7 +198,7 @@ func WaitForGatewayAddress(t *testing.T, client client.Client, timeoutConfig con // TODO: Support more than IPAddress for _, address := range gw.Status.Addresses { - if address.Type != nil && *address.Type == v1alpha2.IPAddressType { + if address.Type != nil && *address.Type == v1beta1.IPAddressType { ipAddr = address.Value return true, nil } @@ -215,13 +215,13 @@ func WaitForGatewayAddress(t *testing.T, client client.Client, timeoutConfig con func HTTPRouteMustHaveNoAcceptedParents(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, routeName types.NamespacedName) { t.Helper() - var actual []v1alpha2.RouteParentStatus + var actual []v1beta1.RouteParentStatus emptyChecked := false waitErr := wait.PollImmediate(1*time.Second, timeoutConfig.HTTPRouteMustNotHaveParents, func() (bool, error) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - route := &v1alpha2.HTTPRoute{} + route := &v1beta1.HTTPRoute{} err := client.Get(ctx, routeName, route) if err != nil { return false, fmt.Errorf("error fetching HTTPRoute: %w", err) @@ -243,7 +243,7 @@ func HTTPRouteMustHaveNoAcceptedParents(t *testing.T, client client.Client, time return false, nil } return conditionsMatch(t, []metav1.Condition{{ - Type: string(v1alpha2.RouteConditionAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: "False", }}, actual[0].Conditions), nil }) @@ -253,15 +253,15 @@ func HTTPRouteMustHaveNoAcceptedParents(t *testing.T, client client.Client, time // HTTPRouteMustHaveParents waits for the specified HTTPRoute to have parents // in status that match the expected parents. This will cause the test to halt // if the specified timeout is exceeded. -func HTTPRouteMustHaveParents(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, routeName types.NamespacedName, parents []v1alpha2.RouteParentStatus, namespaceRequired bool) { +func HTTPRouteMustHaveParents(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, routeName types.NamespacedName, parents []v1beta1.RouteParentStatus, namespaceRequired bool) { t.Helper() - var actual []v1alpha2.RouteParentStatus + var actual []v1beta1.RouteParentStatus waitErr := wait.PollImmediate(1*time.Second, timeoutConfig.HTTPRouteMustHaveParents, func() (bool, error) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - route := &v1alpha2.HTTPRoute{} + route := &v1beta1.HTTPRoute{} err := client.Get(ctx, routeName, route) if err != nil { return false, fmt.Errorf("error fetching HTTPRoute: %w", err) @@ -274,7 +274,7 @@ func HTTPRouteMustHaveParents(t *testing.T, client client.Client, timeoutConfig require.NoErrorf(t, waitErr, "error waiting for HTTPRoute to have parents matching expectations") } -func parentsMatch(t *testing.T, expected, actual []v1alpha2.RouteParentStatus, namespaceRequired bool) bool { +func parentsMatch(t *testing.T, expected, actual []v1beta1.RouteParentStatus, namespaceRequired bool) bool { t.Helper() if len(expected) != len(actual) { @@ -319,15 +319,15 @@ func parentsMatch(t *testing.T, expected, actual []v1alpha2.RouteParentStatus, n // GatewayStatusMustHaveListeners waits for the specified Gateway to have listeners // in status that match the expected listeners. This will cause the test to halt // if the specified timeout is exceeded. -func GatewayStatusMustHaveListeners(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, gwNN types.NamespacedName, listeners []v1alpha2.ListenerStatus) { +func GatewayStatusMustHaveListeners(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, gwNN types.NamespacedName, listeners []v1beta1.ListenerStatus) { t.Helper() - var actual []v1alpha2.ListenerStatus + var actual []v1beta1.ListenerStatus waitErr := wait.PollImmediate(1*time.Second, timeoutConfig.GatewayStatusMustHaveListeners, func() (bool, error) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - gw := &v1alpha2.Gateway{} + gw := &v1beta1.Gateway{} err := client.Get(ctx, gwNN, gw) if err != nil { return false, fmt.Errorf("error fetching Gateway: %w", err) @@ -349,7 +349,7 @@ func HTTPRouteMustHaveCondition(t *testing.T, client client.Client, timeoutConfi ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - route := &v1alpha2.HTTPRoute{} + route := &v1beta1.HTTPRoute{} err := client.Get(ctx, routeNN, route) if err != nil { return false, fmt.Errorf("error fetching HTTPRoute: %w", err) @@ -359,7 +359,7 @@ func HTTPRouteMustHaveCondition(t *testing.T, client client.Client, timeoutConfi var conditionFound bool for _, parent := range parents { - if parent.ParentRef.Name == v1alpha2.ObjectName(gwNN.Name) && (parent.ParentRef.Namespace == nil || string(*parent.ParentRef.Namespace) == gwNN.Namespace) { + if parent.ParentRef.Name == v1beta1.ObjectName(gwNN.Name) && (parent.ParentRef.Namespace == nil || string(*parent.ParentRef.Namespace) == gwNN.Namespace) { if findConditionInList(t, parent.Conditions, condition.Type, string(condition.Status), condition.Reason) { conditionFound = true } @@ -373,7 +373,7 @@ func HTTPRouteMustHaveCondition(t *testing.T, client client.Client, timeoutConfi } // TODO(mikemorris): this and parentsMatch could possibly be rewritten as a generic function? -func listenersMatch(t *testing.T, expected, actual []v1alpha2.ListenerStatus) bool { +func listenersMatch(t *testing.T, expected, actual []v1beta1.ListenerStatus) bool { t.Helper() if len(expected) != len(actual) { diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go index b8718c3771..0a0e2eeda1 100644 --- a/conformance/utils/suite/suite.go +++ b/conformance/utils/suite/suite.go @@ -22,7 +22,7 @@ import ( "golang.org/x/exp/slices" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/config" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/roundtripper" @@ -81,7 +81,7 @@ type Options struct { // For example, given two Gateways, each with 2 listeners, there should be // four ValidUniqueListenerPorts. // If empty or nil, ports are not modified. - ValidUniqueListenerPorts []v1alpha2.PortNumber + ValidUniqueListenerPorts []v1beta1.PortNumber // CleanupBaseResources indicates whether or not the base test // resources such as Gateways should be cleaned up after the run. diff --git a/examples/experimental/v1alpha2/basic-tcp.yaml b/examples/experimental/basic-tcp.yaml similarity index 94% rename from examples/experimental/v1alpha2/basic-tcp.yaml rename to examples/experimental/basic-tcp.yaml index b7a25260a0..2df273869c 100644 --- a/examples/experimental/v1alpha2/basic-tcp.yaml +++ b/examples/experimental/basic-tcp.yaml @@ -1,6 +1,6 @@ #$ Used in: #$ - site-src/v1alpha2/guides/tcp.md -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: my-tcp-gateway diff --git a/examples/experimental/v1alpha2/destination-port-matching-tcp.yaml b/examples/experimental/destination-port-matching-tcp.yaml similarity index 100% rename from examples/experimental/v1alpha2/destination-port-matching-tcp.yaml rename to examples/experimental/destination-port-matching-tcp.yaml diff --git a/examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-full.yaml b/examples/experimental/http-redirect-rewrite/httproute-redirect-full.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-full.yaml rename to examples/experimental/http-redirect-rewrite/httproute-redirect-full.yaml diff --git a/examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-https.yaml b/examples/experimental/http-redirect-rewrite/httproute-redirect-https.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-https.yaml rename to examples/experimental/http-redirect-rewrite/httproute-redirect-https.yaml diff --git a/examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-prefix.yaml b/examples/experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect-rewrite/httproute-redirect-prefix.yaml rename to examples/experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml diff --git a/examples/experimental/v1beta1/http-redirect-rewrite/httproute-rewrite-path.yaml b/examples/experimental/http-redirect-rewrite/httproute-rewrite-path.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect-rewrite/httproute-rewrite-path.yaml rename to examples/experimental/http-redirect-rewrite/httproute-rewrite-path.yaml diff --git a/examples/experimental/v1beta1/http-redirect-rewrite/httproute-rewrite.yaml b/examples/experimental/http-redirect-rewrite/httproute-rewrite.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect-rewrite/httproute-rewrite.yaml rename to examples/experimental/http-redirect-rewrite/httproute-rewrite.yaml diff --git a/examples/experimental/v1beta1/http-redirect.yaml b/examples/experimental/http-redirect.yaml similarity index 100% rename from examples/experimental/v1beta1/http-redirect.yaml rename to examples/experimental/http-redirect.yaml diff --git a/examples/experimental/v1beta1/http-rewrite.yaml b/examples/experimental/http-rewrite.yaml similarity index 100% rename from examples/experimental/v1beta1/http-rewrite.yaml rename to examples/experimental/http-rewrite.yaml diff --git a/examples/experimental/v1alpha2/reference-grant.yaml b/examples/experimental/reference-grant.yaml similarity index 100% rename from examples/experimental/v1alpha2/reference-grant.yaml rename to examples/experimental/reference-grant.yaml diff --git a/examples/experimental/v1alpha2/tls-cert-cross-namespace.yaml b/examples/experimental/tls-cert-cross-namespace.yaml similarity index 93% rename from examples/experimental/v1alpha2/tls-cert-cross-namespace.yaml rename to examples/experimental/tls-cert-cross-namespace.yaml index 15821388cf..4926da0350 100644 --- a/examples/experimental/v1alpha2/tls-cert-cross-namespace.yaml +++ b/examples/experimental/tls-cert-cross-namespace.yaml @@ -1,6 +1,6 @@ #$ Used in: #$ - site-src/v1alpha2/guides/tls.md -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: cross-namespace-tls-gateway diff --git a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-full.yaml b/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-full.yaml deleted file mode 100644 index a25671ea61..0000000000 --- a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-full.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-redirect -spec: - hostnames: - - redirect.example - rules: - - matches: - - path: - type: PathPrefix - value: /cayenne - filters: - - type: RequestRedirect - requestRedirect: - path: - type: ReplaceFullPath - replaceFullPath: /paprika - statusCode: 302 - backendRefs: - - name: example-svc - weight: 1 - port: 80 diff --git a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-https.yaml b/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-https.yaml deleted file mode 100644 index 3c6da65d3a..0000000000 --- a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-https.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-redirect -spec: - hostnames: - - redirect.example - rules: - - filters: - - type: RequestRedirect - requestRedirect: - scheme: https - statusCode: 301 - backendRefs: - - name: example-svc - weight: 1 - port: 80 diff --git a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-prefix.yaml b/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-prefix.yaml deleted file mode 100644 index 48fee0656b..0000000000 --- a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-redirect-prefix.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-redirect -spec: - hostnames: - - redirect.example - rules: - - matches: - - path: - type: PathPrefix - value: /cayenne - filters: - - type: RequestRedirect - requestRedirect: - path: - type: ReplacePrefixMatch - replacePrefixMatch: /paprika - statusCode: 302 - backendRefs: - - name: example-svc - weight: 1 - port: 80 diff --git a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite-path.yaml b/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite-path.yaml deleted file mode 100644 index ea407c9917..0000000000 --- a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite-path.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-rewrite -spec: - hostnames: - - rewrite.example - rules: - - matches: - - path: - type: PathPrefix - value: /cardamom - filters: - - type: URLRewrite - urlRewrite: - hostname: elsewhere.example - path: - type: ReplaceFullPath - replaceFullPath: /fennel - backendRefs: - - name: example-svc - weight: 1 - port: 80 diff --git a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite.yaml b/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite.yaml deleted file mode 100644 index 788a678434..0000000000 --- a/examples/experimental/v1alpha2/http-redirect-rewrite/httproute-rewrite.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-rewrite -spec: - hostnames: - - rewrite.example - rules: - - filters: - - type: URLRewrite - urlRewrite: - hostname: elsewhere.example - backendRefs: - - name: example-svc - weight: 1 - port: 80 diff --git a/examples/experimental/v1alpha2/http-redirect.yaml b/examples/experimental/v1alpha2/http-redirect.yaml deleted file mode 100644 index 87db55e6fc..0000000000 --- a/examples/experimental/v1alpha2/http-redirect.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-1 - namespace: gateway-api-example-ns1 -spec: - parentRefs: - - name: my-filter-gateway - sectionName: http - hostnames: - - my-filter.example.com - rules: - - filters: - - type: RequestRedirect - requestRedirect: - path: - type: ReplaceFullPath - replaceFullPath: /foo diff --git a/examples/experimental/v1alpha2/http-rewrite.yaml b/examples/experimental/v1alpha2/http-rewrite.yaml deleted file mode 100644 index fa61b8064e..0000000000 --- a/examples/experimental/v1alpha2/http-rewrite.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-1 - namespace: gateway-api-example-ns1 -spec: - parentRefs: - - name: my-filter-gateway - sectionName: http - hostnames: - - my-filter.example.com - rules: - - filters: - - type: URLRewrite - urlRewrite: - path: - type: ReplaceFullPath - replaceFullPath: /foo diff --git a/examples/v1alpha2/0-namespaces.yaml b/examples/standard/0-namespaces.yaml similarity index 100% rename from examples/v1alpha2/0-namespaces.yaml rename to examples/standard/0-namespaces.yaml diff --git a/examples/v1beta1/basic-http.yaml b/examples/standard/basic-http.yaml similarity index 100% rename from examples/v1beta1/basic-http.yaml rename to examples/standard/basic-http.yaml diff --git a/examples/v1beta1/cross-namespace-routing/0-namespaces.yaml b/examples/standard/cross-namespace-routing/0-namespaces.yaml similarity index 100% rename from examples/v1beta1/cross-namespace-routing/0-namespaces.yaml rename to examples/standard/cross-namespace-routing/0-namespaces.yaml diff --git a/examples/v1beta1/cross-namespace-routing/gateway.yaml b/examples/standard/cross-namespace-routing/gateway.yaml similarity index 100% rename from examples/v1beta1/cross-namespace-routing/gateway.yaml rename to examples/standard/cross-namespace-routing/gateway.yaml diff --git a/examples/v1beta1/cross-namespace-routing/site-route.yaml b/examples/standard/cross-namespace-routing/site-route.yaml similarity index 100% rename from examples/v1beta1/cross-namespace-routing/site-route.yaml rename to examples/standard/cross-namespace-routing/site-route.yaml diff --git a/examples/v1beta1/cross-namespace-routing/store-route.yaml b/examples/standard/cross-namespace-routing/store-route.yaml similarity index 100% rename from examples/v1beta1/cross-namespace-routing/store-route.yaml rename to examples/standard/cross-namespace-routing/store-route.yaml diff --git a/examples/v1beta1/default-match-http.yaml b/examples/standard/default-match-http.yaml similarity index 100% rename from examples/v1beta1/default-match-http.yaml rename to examples/standard/default-match-http.yaml diff --git a/examples/v1beta1/http-filter.yaml b/examples/standard/http-filter.yaml similarity index 100% rename from examples/v1beta1/http-filter.yaml rename to examples/standard/http-filter.yaml diff --git a/examples/v1beta1/http-redirect.yaml b/examples/standard/http-redirect.yaml similarity index 100% rename from examples/v1beta1/http-redirect.yaml rename to examples/standard/http-redirect.yaml diff --git a/examples/v1beta1/http-route-attachment/gateway-namespaces.yaml b/examples/standard/http-route-attachment/gateway-namespaces.yaml similarity index 100% rename from examples/v1beta1/http-route-attachment/gateway-namespaces.yaml rename to examples/standard/http-route-attachment/gateway-namespaces.yaml diff --git a/examples/v1beta1/http-route-attachment/gateway-strict.yaml b/examples/standard/http-route-attachment/gateway-strict.yaml similarity index 100% rename from examples/v1beta1/http-route-attachment/gateway-strict.yaml rename to examples/standard/http-route-attachment/gateway-strict.yaml diff --git a/examples/v1beta1/http-route-attachment/httproute.yaml b/examples/standard/http-route-attachment/httproute.yaml similarity index 100% rename from examples/v1beta1/http-route-attachment/httproute.yaml rename to examples/standard/http-route-attachment/httproute.yaml diff --git a/examples/v1beta1/http-routing/bar-httproute.yaml b/examples/standard/http-routing/bar-httproute.yaml similarity index 100% rename from examples/v1beta1/http-routing/bar-httproute.yaml rename to examples/standard/http-routing/bar-httproute.yaml diff --git a/examples/v1beta1/http-routing/foo-httproute.yaml b/examples/standard/http-routing/foo-httproute.yaml similarity index 100% rename from examples/v1beta1/http-routing/foo-httproute.yaml rename to examples/standard/http-routing/foo-httproute.yaml diff --git a/examples/v1beta1/http-routing/gateway.yaml b/examples/standard/http-routing/gateway.yaml similarity index 100% rename from examples/v1beta1/http-routing/gateway.yaml rename to examples/standard/http-routing/gateway.yaml diff --git a/examples/v1beta1/simple-gateway/gateway.yaml b/examples/standard/simple-gateway/gateway.yaml similarity index 100% rename from examples/v1beta1/simple-gateway/gateway.yaml rename to examples/standard/simple-gateway/gateway.yaml diff --git a/examples/v1beta1/simple-gateway/httproute.yaml b/examples/standard/simple-gateway/httproute.yaml similarity index 100% rename from examples/v1beta1/simple-gateway/httproute.yaml rename to examples/standard/simple-gateway/httproute.yaml diff --git a/examples/v1beta1/tls-basic.yaml b/examples/standard/tls-basic.yaml similarity index 100% rename from examples/v1beta1/tls-basic.yaml rename to examples/standard/tls-basic.yaml diff --git a/examples/v1beta1/traffic-splitting/simple-split.yaml b/examples/standard/traffic-splitting/simple-split.yaml similarity index 100% rename from examples/v1beta1/traffic-splitting/simple-split.yaml rename to examples/standard/traffic-splitting/simple-split.yaml diff --git a/examples/v1beta1/traffic-splitting/traffic-split-1.yaml b/examples/standard/traffic-splitting/traffic-split-1.yaml similarity index 100% rename from examples/v1beta1/traffic-splitting/traffic-split-1.yaml rename to examples/standard/traffic-splitting/traffic-split-1.yaml diff --git a/examples/v1beta1/traffic-splitting/traffic-split-2.yaml b/examples/standard/traffic-splitting/traffic-split-2.yaml similarity index 100% rename from examples/v1beta1/traffic-splitting/traffic-split-2.yaml rename to examples/standard/traffic-splitting/traffic-split-2.yaml diff --git a/examples/v1beta1/traffic-splitting/traffic-split-3.yaml b/examples/standard/traffic-splitting/traffic-split-3.yaml similarity index 100% rename from examples/v1beta1/traffic-splitting/traffic-split-3.yaml rename to examples/standard/traffic-splitting/traffic-split-3.yaml diff --git a/examples/v1beta1/wildcard-tls-gateway.yaml b/examples/standard/wildcard-tls-gateway.yaml similarity index 100% rename from examples/v1beta1/wildcard-tls-gateway.yaml rename to examples/standard/wildcard-tls-gateway.yaml diff --git a/examples/v1alpha2/basic-http.yaml b/examples/v1alpha2/basic-http.yaml deleted file mode 100644 index dfdf9a78d1..0000000000 --- a/examples/v1alpha2/basic-http.yaml +++ /dev/null @@ -1,55 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: GatewayClass -metadata: - name: acme-lb -spec: - controllerName: acme.io/gateway-controller - parametersRef: - name: acme-lb - group: acme.io - kind: Parameters ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: my-gateway -spec: - gatewayClassName: acme-lb - listeners: # Use GatewayClass defaults for listener definition. - - name: http - protocol: HTTP - port: 80 ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-app-1 -spec: - parentRefs: - - name: my-gateway - hostnames: - - "foo.com" - rules: - - matches: - - path: - type: PathPrefix - value: /bar - backendRefs: - - name: my-service1 - port: 8080 - - matches: - - headers: - - type: Exact - name: magic - value: foo - queryParams: - - type: Exact - name: great - value: example - path: - type: PathPrefix - value: /some/thing - method: GET - backendRefs: - - name: my-service2 - port: 8080 diff --git a/examples/v1alpha2/cross-namespace-routing/0-namespaces.yaml b/examples/v1alpha2/cross-namespace-routing/0-namespaces.yaml deleted file mode 100644 index bab5690750..0000000000 --- a/examples/v1alpha2/cross-namespace-routing/0-namespaces.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: infra-ns - labels: - shared-gateway-access: "true" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: site-ns - labels: - shared-gateway-access: "true" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: store-ns - labels: - shared-gateway-access: "true" ---- -apiVersion: v1 -kind: Namespace -metadata: - name: no-external-access diff --git a/examples/v1alpha2/cross-namespace-routing/gateway.yaml b/examples/v1alpha2/cross-namespace-routing/gateway.yaml deleted file mode 100644 index 049f59365f..0000000000 --- a/examples/v1alpha2/cross-namespace-routing/gateway.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: shared-gateway - namespace: infra-ns -spec: - gatewayClassName: shared-gateway-class - listeners: - - name: https - hostname: "foo.example.com" - protocol: HTTPS - port: 443 - allowedRoutes: - namespaces: - from: Selector - selector: - matchLabels: - shared-gateway-access: "true" - tls: - certificateRefs: - - name: foo-example-com diff --git a/examples/v1alpha2/cross-namespace-routing/site-route.yaml b/examples/v1alpha2/cross-namespace-routing/site-route.yaml deleted file mode 100644 index 885e98cd7e..0000000000 --- a/examples/v1alpha2/cross-namespace-routing/site-route.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: home - namespace: site-ns -spec: - parentRefs: - - name: shared-gateway - namespace: infra-ns - rules: - - backendRefs: - - name: home - port: 8080 ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: login - namespace: site-ns -spec: - parentRefs: - - name: shared-gateway - namespace: infra-ns - rules: - - matches: - - path: - value: /login - backendRefs: - - name: login-v1 - port: 8080 - weight: 90 - - name: login-v2 - port: 8080 - weight: 10 diff --git a/examples/v1alpha2/cross-namespace-routing/store-route.yaml b/examples/v1alpha2/cross-namespace-routing/store-route.yaml deleted file mode 100644 index 03d411c8e6..0000000000 --- a/examples/v1alpha2/cross-namespace-routing/store-route.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: store - namespace: store-ns -spec: - parentRefs: - - name: shared-gateway - namespace: infra-ns - rules: - - matches: - - path: - value: /store - backendRefs: - - name: store - port: 8080 diff --git a/examples/v1alpha2/default-match-http.yaml b/examples/v1alpha2/default-match-http.yaml deleted file mode 100644 index f4794850c0..0000000000 --- a/examples/v1alpha2/default-match-http.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: GatewayClass -metadata: - name: default-match-example -spec: - controllerName: acme.io/gateway-controller ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: default-match-gw -spec: - gatewayClassName: default-match-example - listeners: - - name: http - protocol: HTTP - port: 80 ---- -# This HTTPRoute demonstrates patch match defaulting. If no path match is -# specified, CRD defaults adds a default PathPrefix match on the path "/". This -# matches every HTTP request and ensures that route rules always have at -# least one valid match. -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: default-match-route - labels: - app: default-match -spec: - parentRefs: - - name: default-match-gw - hostnames: - - default-match.com - rules: - - matches: - - headers: - - type: Exact - name: magic - value: default-match - backendRefs: - - group: acme.io - kind: CustomBackend - name: my-custom-resource - port: 8080 - - matches: - - path: - type: Exact - value: /example/exact - backendRefs: - - name: my-service-2 - port: 8080 diff --git a/examples/v1alpha2/http-filter.yaml b/examples/v1alpha2/http-filter.yaml deleted file mode 100644 index 541db904d0..0000000000 --- a/examples/v1alpha2/http-filter.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-1 -spec: - hostnames: - - my.filter.com - rules: - - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - add: - - name: my-header - value: foo - backendRefs: - - name: my-filter-svc1 - weight: 1 - port: 80 diff --git a/examples/v1alpha2/http-redirect.yaml b/examples/v1alpha2/http-redirect.yaml deleted file mode 100644 index 80629c6eb8..0000000000 --- a/examples/v1alpha2/http-redirect.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: GatewayClass -metadata: - name: filter-lb -spec: - controllerName: acme.io/gateway-controller - parametersRef: - name: acme-lb - group: acme.io - kind: Parameters ---- -apiVersion: v1 -kind: Namespace -metadata: - name: gateway-api-example-ns1 ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: my-filter-gateway - namespace: gateway-api-example-ns1 -spec: - gatewayClassName: filter-lb - listeners: - - name: http - protocol: HTTP - port: 80 - - name: https - protocol: HTTPS - port: 443 ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-1 - namespace: gateway-api-example-ns1 -spec: - parentRefs: - - name: my-filter-gateway - sectionName: http - hostnames: - - my-filter.example.com - rules: - - filters: - - type: RequestRedirect - requestRedirect: - scheme: https ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: http-filter-2 - namespace: gateway-api-example-ns1 -spec: - parentRefs: - - name: my-filter-gateway - sectionName: https - hostnames: - - my-filter.example.com - rules: - - matches: - - path: - type: PathPrefix - value: / - backendRefs: - - name: my-filter-svc1 - weight: 1 - port: 80 diff --git a/examples/v1alpha2/http-route-attachment/gateway-namespaces.yaml b/examples/v1alpha2/http-route-attachment/gateway-namespaces.yaml deleted file mode 100644 index eb7e5c2f46..0000000000 --- a/examples/v1alpha2/http-route-attachment/gateway-namespaces.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: prod-gateway - namespace: gateway-api-example-ns1 -spec: - gatewayClassName: foo-lb - listeners: - - name: prod-web - port: 80 - protocol: HTTP - allowedRoutes: - kinds: - - kind: HTTPRoute - namespaces: - from: Selector - selector: - matchLabels: - expose-apps: "true" diff --git a/examples/v1alpha2/http-route-attachment/gateway-strict.yaml b/examples/v1alpha2/http-route-attachment/gateway-strict.yaml deleted file mode 100644 index 8d518c9bd2..0000000000 --- a/examples/v1alpha2/http-route-attachment/gateway-strict.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: foo-gateway - namespace: gateway-api-example-ns1 -spec: - gatewayClassName: foo-lb - listeners: - - name: prod-web - port: 80 - protocol: HTTP - allowedRoutes: - kinds: - - kind: HTTPRoute - namespaces: - from: Selector - selector: - matchLabels: - # This label is added automatically as of K8s 1.22 - # to all namespaces - kubernetes.io/metadata.name: gateway-api-example-ns2 diff --git a/examples/v1alpha2/http-route-attachment/httproute.yaml b/examples/v1alpha2/http-route-attachment/httproute.yaml deleted file mode 100644 index f0cc853dbe..0000000000 --- a/examples/v1alpha2/http-route-attachment/httproute.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: my-route - namespace: gateway-api-example-ns2 -spec: - parentRefs: - - kind: Gateway - name: foo-gateway - namespace: gateway-api-example-ns1 - rules: - - backendRefs: - - name: foo-svc - port: 8080 diff --git a/examples/v1alpha2/http-routing/bar-httproute.yaml b/examples/v1alpha2/http-routing/bar-httproute.yaml deleted file mode 100644 index 633c42980f..0000000000 --- a/examples/v1alpha2/http-routing/bar-httproute.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: bar-route -spec: - parentRefs: - - name: example-gateway - hostnames: - - "bar.example.com" - rules: - - matches: - - headers: - - type: Exact - name: env - value: canary - backendRefs: - - name: bar-svc-canary - port: 8080 - - backendRefs: - - name: bar-svc - port: 8080 diff --git a/examples/v1alpha2/http-routing/foo-httproute.yaml b/examples/v1alpha2/http-routing/foo-httproute.yaml deleted file mode 100644 index a611719ce8..0000000000 --- a/examples/v1alpha2/http-routing/foo-httproute.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo-route -spec: - parentRefs: - - name: example-gateway - hostnames: - - "foo.example.com" - rules: - - matches: - - path: - type: PathPrefix - value: /login - backendRefs: - - name: foo-svc - port: 8080 diff --git a/examples/v1alpha2/http-routing/gateway.yaml b/examples/v1alpha2/http-routing/gateway.yaml deleted file mode 100644 index ad3b30ea0d..0000000000 --- a/examples/v1alpha2/http-routing/gateway.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: example-gateway -spec: - gatewayClassName: example-gateway-class - listeners: - - name: http - protocol: HTTP - port: 80 ---- -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: example-route -spec: - parentRefs: - - name: example-gateway - hostnames: - - "example.com" - rules: - - backendRefs: - - name: example-svc - port: 80 diff --git a/examples/v1alpha2/simple-gateway/gateway.yaml b/examples/v1alpha2/simple-gateway/gateway.yaml deleted file mode 100644 index 565ae1c7bc..0000000000 --- a/examples/v1alpha2/simple-gateway/gateway.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: prod-web -spec: - gatewayClassName: acme-lb - listeners: - - protocol: HTTP - port: 80 - name: prod-web-gw - allowedRoutes: - namespaces: - from: Same diff --git a/examples/v1alpha2/simple-gateway/httproute.yaml b/examples/v1alpha2/simple-gateway/httproute.yaml deleted file mode 100644 index 15c2c00c5d..0000000000 --- a/examples/v1alpha2/simple-gateway/httproute.yaml +++ /dev/null @@ -1,13 +0,0 @@ -#$ Used in: -#$ - site-src/blog/2021/introducing-v1alpha2.md -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo -spec: - parentRefs: - - name: prod-web - rules: - - backendRefs: - - name: foo-svc - port: 8080 diff --git a/examples/v1alpha2/tls-basic.yaml b/examples/v1alpha2/tls-basic.yaml deleted file mode 100644 index 2827df2fee..0000000000 --- a/examples/v1alpha2/tls-basic.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: tls-basic -spec: - gatewayClassName: acme-lb - listeners: - - name: foo-https - protocol: HTTPS - port: 443 - hostname: foo.example.com - tls: - certificateRefs: - - kind: Secret - group: "" - name: foo-example-com-cert - - name: bar-https - protocol: HTTPS - port: 443 - hostname: bar.example.com - tls: - certificateRefs: - - kind: Secret - group: "" - name: bar-example-com-cert diff --git a/examples/v1alpha2/traffic-splitting/simple-split.yaml b/examples/v1alpha2/traffic-splitting/simple-split.yaml deleted file mode 100644 index 981dd8e753..0000000000 --- a/examples/v1alpha2/traffic-splitting/simple-split.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: simple-split -spec: - rules: - - backendRefs: - - name: foo-v1 - port: 8080 - weight: 90 - - name: foo-v2 - port: 8080 - weight: 10 diff --git a/examples/v1alpha2/traffic-splitting/traffic-split-1.yaml b/examples/v1alpha2/traffic-splitting/traffic-split-1.yaml deleted file mode 100644 index d95b4dabbf..0000000000 --- a/examples/v1alpha2/traffic-splitting/traffic-split-1.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo-route - labels: - gateway: prod-web-gw -spec: - hostnames: - - foo.example.com - rules: - - backendRefs: - - name: foo-v1 - port: 8080 - - matches: - - headers: - - name: traffic - value: test - backendRefs: - - name: foo-v2 - port: 8080 diff --git a/examples/v1alpha2/traffic-splitting/traffic-split-2.yaml b/examples/v1alpha2/traffic-splitting/traffic-split-2.yaml deleted file mode 100644 index 5794d55fac..0000000000 --- a/examples/v1alpha2/traffic-splitting/traffic-split-2.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo-route - labels: - gateway: prod-web-gw -spec: - hostnames: - - foo.example.com - rules: - - backendRefs: - - name: foo-v1 - port: 8080 - weight: 90 - - name: foo-v2 - port: 8080 - weight: 10 diff --git a/examples/v1alpha2/traffic-splitting/traffic-split-3.yaml b/examples/v1alpha2/traffic-splitting/traffic-split-3.yaml deleted file mode 100644 index 6da146619f..0000000000 --- a/examples/v1alpha2/traffic-splitting/traffic-split-3.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: HTTPRoute -metadata: - name: foo-route - labels: - gateway: prod-web-gw -spec: - hostnames: - - foo.example.com - rules: - - backendRefs: - - name: foo-v1 - port: 8080 - weight: 0 - - name: foo-v2 - port: 8080 - weight: 1 diff --git a/examples/v1alpha2/wildcard-tls-gateway.yaml b/examples/v1alpha2/wildcard-tls-gateway.yaml deleted file mode 100644 index 7d4bcb46e6..0000000000 --- a/examples/v1alpha2/wildcard-tls-gateway.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 -kind: Gateway -metadata: - name: wildcard-tls-gateway -spec: - gatewayClassName: acme-lb - listeners: - - name: foo-https - protocol: HTTPS - port: 443 - hostname: foo.example.com - tls: - certificateRefs: - - kind: Secret - group: "" - name: foo-example-com-cert - - name: wildcard-https - protocol: HTTPS - port: 443 - hostname: "*.example.com" - tls: - certificateRefs: - - kind: Secret - group: "" - name: wildcard-example-com-cert diff --git a/examples/v1beta1/0-namespaces.yaml b/examples/v1beta1/0-namespaces.yaml deleted file mode 100644 index 9bc699f869..0000000000 --- a/examples/v1beta1/0-namespaces.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# These namespaces can be used for examples without recreating them each time. ---- -apiVersion: v1 -kind: Namespace -metadata: - name: gateway-api-example-ns1 ---- -apiVersion: v1 -kind: Namespace -metadata: - name: gateway-api-example-ns2 diff --git a/hack/verify-examples-kind.sh b/hack/verify-examples-kind.sh index 1baf601766..c80961aa22 100755 --- a/hack/verify-examples-kind.sh +++ b/hack/verify-examples-kind.sh @@ -79,13 +79,12 @@ for CHANNEL in experimental standard; do # Temporary workaround for https://github.com/kubernetes/kubernetes/issues/104090 sleep 8 - # Install all example gateway-api resources. - kubectl apply --recursive -f examples/v1alpha2 || res=$? + kubectl apply --recursive -f examples/standard || res=$? # Install all experimental example gateway-api resources when experimental mode is enabled if [[ "${CHANNEL}" == "experimental" ]] ; then echo "Experimental mode enabled: deploying experimental examples" - kubectl apply --recursive -f examples/experimental/v1alpha2 || res=$? + kubectl apply --recursive -f examples/experimental || res=$? fi # Install invalid gateway-api resources. @@ -106,6 +105,9 @@ for CHANNEL in experimental standard; do echo Examples failed as expected done +# Undo workaround from earlier +sed -i 's/latest/v0.5.0/g' config/webhook/admission_webhook.yaml + # Clean up and exit cleanup || res=$? exit $res diff --git a/site-src/api-types/httproute.md b/site-src/api-types/httproute.md index 7895d56877..92d55cb026 100644 --- a/site-src/api-types/httproute.md +++ b/site-src/api-types/httproute.md @@ -111,7 +111,7 @@ strategies, rate-limiting, and traffic shaping. The following example adds header "my-header: foo" to HTTP requests with Host header "my.filter.com". ```yaml -{% include 'v1beta1/http-filter.yaml' %} +{% include 'standard/http-filter.yaml' %} ``` API conformance is defined based on the filter type. The effects of ordering @@ -143,14 +143,14 @@ The following example forwards HTTP requests for prefix `/bar` to service "my-service1" on port `8080` and HTTP requests for prefix `/some/thing` with header `magic: foo` to service "my-service2" on port `8080`: ```yaml -{% include 'v1beta1/basic-http.yaml' %} +{% include 'standard/basic-http.yaml' %} ``` The following example uses the `weight` field to forward 90% of HTTP requests to `foo.example.com` to the "foo-v1" Service and the other 10% to the "foo-v2" Service: ```yaml -{% include 'v1beta1/traffic-splitting/traffic-split-2.yaml' %} +{% include 'standard/traffic-splitting/traffic-split-2.yaml' %} ``` Reference the [backendRef][backendRef] API documentation for additional details diff --git a/site-src/blog/2021/introducing-v1alpha2.md b/site-src/blog/2021/introducing-v1alpha2.md index 9b3140acbf..cc880bef01 100644 --- a/site-src/blog/2021/introducing-v1alpha2.md +++ b/site-src/blog/2021/introducing-v1alpha2.md @@ -42,7 +42,17 @@ For example, the following HTTPRoute uses the `parentRefs` field to attach itself to the `prod-web-gw` Gateway. ```yaml -{% include 'v1alpha2/simple-gateway/httproute.yaml' %} +apiVersion: gateway.networking.k8s.io/v1alpha2 +kind: HTTPRoute +metadata: + name: foo +spec: + parentRefs: + - name: prod-web + rules: + - backendRefs: + - name: foo-svc + port: 8080 ``` This is covered in more detail in [GEP 724](https://gateway-api.sigs.k8s.io/geps/gep-709/). @@ -73,7 +83,7 @@ namespace to forward traffic to Services wherever this ReferenceGrant was installed: ```yaml -{% include 'experimental/v1alpha2/reference-grant.yaml' %} +{% include 'experimental/reference-grant.yaml' %} ``` This is covered in more detail in [GEP 709](https://gateway-api.sigs.k8s.io/geps/gep-709/). diff --git a/site-src/blog/index.md b/site-src/blog/index.md index 3bbcd415b9..5585756c3e 100644 --- a/site-src/blog/index.md +++ b/site-src/blog/index.md @@ -15,7 +15,7 @@ rewrites. [:octicons-arrow-right-24: Continue reading][Gateway API Graduates to Beta] -[Gateway API Graduates to Beta]:/site-src/blog/2022/graduating-to-beta +[Gateway API Graduates to Beta]:/blog/2022/graduating-to-beta ## [Introducing Gateway API v1alpha2] @@ -30,4 +30,4 @@ the highlights. [:octicons-arrow-right-24: Continue reading][Introducing Gateway API v1alpha2] -[Introducing Gateway API v1alpha2]: /site-src/blog/2021/introducing-v1alpha2 +[Introducing Gateway API v1alpha2]: /blog/2021/introducing-v1alpha2 diff --git a/site-src/concepts/api-overview.md b/site-src/concepts/api-overview.md index 6335636390..350eb35ec7 100644 --- a/site-src/concepts/api-overview.md +++ b/site-src/concepts/api-overview.md @@ -239,20 +239,20 @@ The following `my-route` Route wants to attach to the `foo-gateway` in the attachment from HTTPRoutes in the namespace `gateway-api-example-ns2`. ```yaml -{% include 'v1beta1/http-route-attachment/httproute.yaml' %} +{% include 'standard/http-route-attachment/httproute.yaml' %} ``` This `foo-gateway` allows the `my-route` HTTPRoute to attach. ```yaml -{% include 'v1beta1/http-route-attachment/gateway-strict.yaml' %} +{% include 'standard/http-route-attachment/gateway-strict.yaml' %} ``` For a more permissive example, the below Gateway will allow all HTTPRoute resources to attach from Namespaces with the "expose-apps: true" label. ```yaml -{% include 'v1beta1/http-route-attachment/gateway-namespaces.yaml' %} +{% include 'standard/http-route-attachment/gateway-namespaces.yaml' %} ``` ### Combined types diff --git a/site-src/concepts/security-model.md b/site-src/concepts/security-model.md index eaf581f755..5ebcc1f36e 100644 --- a/site-src/concepts/security-model.md +++ b/site-src/concepts/security-model.md @@ -118,7 +118,7 @@ the "prod" namespace to HTTPRoutes that are deployed in the same namespace as the ReferenceGrant. ```yaml -{% include 'experimental/v1alpha2/reference-grant.yaml' %} +{% include 'experimental/reference-grant.yaml' %} ``` For more information on ReferenceGrant, refer to our [detailed documentation diff --git a/site-src/guides/http-redirect-rewrite.md b/site-src/guides/http-redirect-rewrite.md index e151b09c54..0058da55f2 100644 --- a/site-src/guides/http-redirect-rewrite.md +++ b/site-src/guides/http-redirect-rewrite.md @@ -21,7 +21,7 @@ example, to issue a permanent redirect (301) from HTTP to HTTPS, configure `requestRedirect.statusCode=301` and `requestRedirect.scheme="https"`: ```yaml -{% include 'experimental/v1beta1/http-redirect-rewrite/httproute-redirect-https.yaml' %} +{% include 'experimental/http-redirect-rewrite/httproute-redirect-https.yaml' %} ``` Redirects change configured URL components to match the redirect configuration @@ -44,7 +44,7 @@ prefixes. For example, the HTTPRoute below will issue a 302 redirect to all `redirect.example` requests whose path begins with `/cayenne` to `/paprika`: ```yaml -{% include 'experimental/v1beta1/http-redirect-rewrite/httproute-redirect-full.yaml' %} +{% include 'experimental/http-redirect-rewrite/httproute-redirect-full.yaml' %} ``` Both requests to @@ -56,7 +56,7 @@ The other path redirect type, `ReplacePrefixMatch`, replaces only the path portion matching `matches.path.value`. Changing the filter in the above to: ```yaml -{% include 'experimental/v1beta1/http-redirect-rewrite/httproute-redirect-prefix.yaml' %} +{% include 'experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml' %} ``` will result in redirects with `location: @@ -81,7 +81,7 @@ following HTTPRoute will accept a request for rewrite.example`. ```yaml -{% include 'experimental/v1beta1/http-redirect-rewrite/httproute-rewrite.yaml' %} +{% include 'experimental/http-redirect-rewrite/httproute-rewrite.yaml' %} ``` Path rewrites also make use of HTTP Path Modifiers. The HTTPRoute below @@ -91,5 +91,5 @@ Instead using `type: ReplacePrefixMatch` and `replacePrefixMatch: /fennel` will request `https://elsewhere.example/fennel/smidgen` upstream. ```yaml -{% include 'experimental/v1beta1/http-redirect-rewrite/httproute-rewrite.yaml' %} +{% include 'experimental/http-redirect-rewrite/httproute-rewrite.yaml' %} ``` diff --git a/site-src/guides/http-routing.md b/site-src/guides/http-routing.md index faaf1c0895..e2f7083b0c 100644 --- a/site-src/guides/http-routing.md +++ b/site-src/guides/http-routing.md @@ -28,7 +28,7 @@ should be attached to. The following example shows how the combination of `Gateway` and `HTTPRoute` would be configured to serve HTTP traffic: ```yaml -{% include 'v1beta1/http-routing/gateway.yaml' %} +{% include 'standard/http-routing/gateway.yaml' %} ``` An HTTPRoute can match against a [single set of hostnames][spec]. @@ -44,7 +44,7 @@ forwarded. Traffic to any other paths that do not begin with `/login` will not be matched by this Route. ```yaml -{% include 'v1beta1/http-routing/foo-httproute.yaml' %} +{% include 'standard/http-routing/foo-httproute.yaml' %} ``` Similarly, the `bar-route` HTTPRoute matches traffic for `bar.example.com`. All @@ -54,7 +54,7 @@ canary` header will be forwarded to `bar-svc-canary` and if the header is missing or not `canary` then it'll be forwarded to `bar-svc`. ```yaml -{% include 'v1beta1/http-routing/bar-httproute.yaml' %} +{% include 'standard/http-routing/bar-httproute.yaml' %} ``` [gateway]: /references/spec/#gateway.networking.k8s.io/v1beta1.Gateway diff --git a/site-src/guides/multiple-ns.md b/site-src/guides/multiple-ns.md index 94c72b45f5..a50a18ec7a 100644 --- a/site-src/guides/multiple-ns.md +++ b/site-src/guides/multiple-ns.md @@ -72,7 +72,7 @@ The infrastructure team deploys the `shared-gateway` Gateway into the `infra-ns` Namespace: ```yaml -{% include 'v1beta1/cross-namespace-routing/gateway.yaml' %} +{% include 'standard/cross-namespace-routing/gateway.yaml' %} ``` The `https` listener in the above Gateway matches traffic for the @@ -114,7 +114,7 @@ a `parentRef` for `infra-ns/shared-gateway`, it would be ignored by the Gateway because the attachment constraint (Namespace label) was not met. ```yaml -{% include 'v1beta1/cross-namespace-routing/0-namespaces.yaml' %} +{% include 'standard/cross-namespace-routing/0-namespaces.yaml' %} ``` Note that attachment constraints on the Gateway are not required, but they are @@ -130,7 +130,7 @@ The store team deploys their route for the `store` Service in the `store-ns` Namespace: ```yaml -{% include 'v1beta1/cross-namespace-routing/store-route.yaml' %} +{% include 'standard/cross-namespace-routing/store-route.yaml' %} ``` This Route has straightforward routing logic as it just matches for @@ -151,7 +151,7 @@ specifies `gateway/shared-gateway` in the `infra-ns` Namespace as the only Gateway that these Routes want to attach to. ```yaml -{% include 'v1beta1/cross-namespace-routing/site-route.yaml' %} +{% include 'standard/cross-namespace-routing/site-route.yaml' %} ``` After these three Routes are deployed, they will all be attached to the diff --git a/site-src/guides/simple-gateway.md b/site-src/guides/simple-gateway.md index d60029dc39..eba28c57d6 100644 --- a/site-src/guides/simple-gateway.md +++ b/site-src/guides/simple-gateway.md @@ -9,7 +9,7 @@ match all HTTP traffic and directs it to a single Service named `foo-svc`. ![Simple Gateway](/images/single-service-gateway.png) ```yaml -{% include 'v1beta1/simple-gateway/gateway.yaml' %} +{% include 'standard/simple-gateway/gateway.yaml' %} ``` The Gateway represents the instantation of a logical load balancer. It's @@ -30,7 +30,7 @@ will match all HTTP traffic that arrives at port 80 of the load balancer and send it to the `foo-svc` Pods. ```yaml -{% include 'v1beta1/simple-gateway/httproute.yaml' %} +{% include 'standard/simple-gateway/httproute.yaml' %} ``` While Route resources are often used to filter traffic to many different diff --git a/site-src/guides/tcp.md b/site-src/guides/tcp.md index 2080f62752..3ee6b982a0 100644 --- a/site-src/guides/tcp.md +++ b/site-src/guides/tcp.md @@ -20,7 +20,7 @@ in order to route them to two separate backend `TCPRoutes`, note that the `protocol` set for the `listeners` on the `Gateway` is `TCP`: ```yaml -{% include 'experimental/v1alpha2/basic-tcp.yaml' %} +{% include 'experimental/basic-tcp.yaml' %} ``` In the above example we separate the traffic for the two separate backend TCP diff --git a/site-src/guides/tls.md b/site-src/guides/tls.md index da438dcce1..9d40bccdb0 100644 --- a/site-src/guides/tls.md +++ b/site-src/guides/tls.md @@ -75,7 +75,7 @@ In this example, the Gateway is configured to serve the `foo.example.com` and in the Gateway. ```yaml -{% include 'v1beta1/tls-basic.yaml' %} +{% include 'standard/tls-basic.yaml' %} ``` #### Wildcard TLS listeners @@ -87,7 +87,7 @@ Since a specific match takes priority, the Gateway will serve `wildcard-example-com-cert` for all other requests. ```yaml -{% include 'v1beta1/wildcard-tls-gateway.yaml' %} +{% include 'standard/wildcard-tls-gateway.yaml' %} ``` #### Cross namespace certificate references @@ -98,7 +98,7 @@ target namespace. Without that ReferenceGrant, the cross-namespace reference would be invalid. ```yaml -{% include 'experimental/v1alpha2/tls-cert-cross-namespace.yaml' %} +{% include 'experimental/tls-cert-cross-namespace.yaml' %} ``` ## Extensions diff --git a/site-src/guides/traffic-splitting.md b/site-src/guides/traffic-splitting.md index 3848d7fa50..fa960d9de2 100644 --- a/site-src/guides/traffic-splitting.md +++ b/site-src/guides/traffic-splitting.md @@ -12,7 +12,7 @@ will split traffic 90% to `foo-v1` and 10% to `foo-v2`. ![Traffic splitting](/images/simple-split.png) ```yaml -{% include 'v1beta1/traffic-splitting/simple-split.yaml' %} +{% include 'standard/traffic-splitting/simple-split.yaml' %} ``` `weight` indicates a proportional split of traffic (rather than percentage) @@ -30,7 +30,7 @@ is used to manage the gradual splitting of traffic from v1 to v2. This example assumes that the following Gateway is deployed: ```yaml -{% include 'v1beta1/simple-gateway/gateway.yaml' %} +{% include 'standard/simple-gateway/gateway.yaml' %} ``` ## Canary traffic rollout @@ -49,7 +49,7 @@ ensures that all traffic with the matching host and header ```yaml -{% include 'v1beta1/traffic-splitting/traffic-split-1.yaml' %} +{% include 'standard/traffic-splitting/traffic-split-1.yaml' %} ``` ## Blue-green traffic rollout @@ -65,7 +65,7 @@ as a backend along with weights. The weights add up to a total of 100 so ```yaml -{% include 'v1beta1/traffic-splitting/traffic-split-2.yaml' %} +{% include 'standard/traffic-splitting/traffic-split-2.yaml' %} ``` ## Completing the rollout @@ -78,7 +78,7 @@ Finally, if all signals are positive, it is time to fully shift traffic to ```yaml -{% include 'v1beta1/traffic-splitting/traffic-split-3.yaml' %} +{% include 'standard/traffic-splitting/traffic-split-3.yaml' %} ``` At this point 100% of the traffic is being routed to `foo-v2` and the