Skip to content

Commit 5f296d8

Browse files
committed
Beta resources: Setting storage version to v1beta1, not serving v1alpha2
This affects resources that graduated to v1beta1 in the v0.5.0 release. Although that specific change is relatively small, it required a lot of related work: * Restructuring examples to remove v1alpha2 examples where they were no longer useful and their installation would fail * Updating conformance tests to use v1beta1 where possible * Some related fixes to v1alpha2 blog post to account for removal of v1alpha2 example
1 parent a3f769e commit 5f296d8

File tree

130 files changed

+231
-910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+231
-910
lines changed

apis/v1alpha2/gateway_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api,shortName=gtw
2626
// +kubebuilder:subresource:status
27-
// +kubebuilder:storageversion
27+
// +kubebuilder:unservedversion
2828
// +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName`
2929
// +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value`
3030
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`

apis/v1alpha2/gatewayclass_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
// +kubebuilder:object:root=true
2626
// +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc
2727
// +kubebuilder:subresource:status
28-
// +kubebuilder:storageversion
28+
// +kubebuilder:unservedversion
2929
// +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName`
3030
// +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status`
3131
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

apis/v1alpha2/httproute_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api
2626
// +kubebuilder:subresource:status
27-
// +kubebuilder:storageversion
27+
// +kubebuilder:unservedversion
2828
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
2929
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
3030

apis/v1beta1/gateway_types.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
// +genclient
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api,shortName=gtw
26+
// +kubebuilder:storageversion
2627
// +kubebuilder:subresource:status
2728
// +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName`
2829
// +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value`

apis/v1beta1/gatewayclass_types.go

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
// +genclient:nonNamespaced
2525
// +kubebuilder:object:root=true
2626
// +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc
27+
// +kubebuilder:storageversion
2728
// +kubebuilder:subresource:status
2829
// +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName`
2930
// +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status`

apis/v1beta1/httproute_types.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
// +genclient
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api
26+
// +kubebuilder:storageversion
2627
// +kubebuilder:subresource:status
2728
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
2829
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

config/crd/experimental/gateway.networking.k8s.io_gatewayclasses.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_gateways.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/standard/gateway.networking.k8s.io_gateways.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/standard/gateway.networking.k8s.io_httproutes.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conformance/base/manifests.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
labels:
1414
gateway-conformance: infra
1515
---
16-
apiVersion: gateway.networking.k8s.io/v1alpha2
16+
apiVersion: gateway.networking.k8s.io/v1beta1
1717
kind: Gateway
1818
metadata:
1919
name: same-namespace
@@ -28,7 +28,7 @@ spec:
2828
namespaces:
2929
from: Same
3030
---
31-
apiVersion: gateway.networking.k8s.io/v1alpha2
31+
apiVersion: gateway.networking.k8s.io/v1beta1
3232
kind: Gateway
3333
metadata:
3434
name: all-namespaces
@@ -43,7 +43,7 @@ spec:
4343
namespaces:
4444
from: All
4545
---
46-
apiVersion: gateway.networking.k8s.io/v1alpha2
46+
apiVersion: gateway.networking.k8s.io/v1beta1
4747
kind: Gateway
4848
metadata:
4949
name: backend-namespaces

conformance/conformance_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"testing"
2222

2323
"sigs.k8s.io/gateway-api/apis/v1alpha2"
24+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2425
"sigs.k8s.io/gateway-api/conformance/tests"
2526
"sigs.k8s.io/gateway-api/conformance/utils/flags"
2627
"sigs.k8s.io/gateway-api/conformance/utils/suite"
@@ -40,6 +41,7 @@ func TestConformance(t *testing.T) {
4041
t.Fatalf("Error initializing Kubernetes client: %v", err)
4142
}
4243
v1alpha2.AddToScheme(client.Scheme())
44+
v1beta1.AddToScheme(client.Scheme())
4345

4446
t.Logf("Running conformance tests with %s GatewayClass", *flags.GatewayClassName)
4547

conformance/tests/gateway-secret-invalid-reference-grant.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
"k8s.io/apimachinery/pkg/types"
2424

25-
"sigs.k8s.io/gateway-api/apis/v1alpha2"
25+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2626
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
2727
"sigs.k8s.io/gateway-api/conformance/utils/suite"
2828
)
@@ -40,16 +40,16 @@ var GatewaySecretInvalidReferenceGrant = suite.ConformanceTest{
4040
gwNN := types.NamespacedName{Name: "gateway-secret-invalid-reference-grant", Namespace: "gateway-conformance-infra"}
4141

4242
t.Run("Gateway listener should have a false ResolvedRefs condition with reason RefNotPermitted", func(t *testing.T) {
43-
listeners := []v1alpha2.ListenerStatus{{
44-
Name: v1alpha2.SectionName("https"),
45-
SupportedKinds: []v1alpha2.RouteGroupKind{{
46-
Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group),
47-
Kind: v1alpha2.Kind("HTTPRoute"),
43+
listeners := []v1beta1.ListenerStatus{{
44+
Name: v1beta1.SectionName("https"),
45+
SupportedKinds: []v1beta1.RouteGroupKind{{
46+
Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group),
47+
Kind: v1beta1.Kind("HTTPRoute"),
4848
}},
4949
Conditions: []metav1.Condition{{
50-
Type: string(v1alpha2.ListenerConditionResolvedRefs),
50+
Type: string(v1beta1.ListenerConditionResolvedRefs),
5151
Status: metav1.ConditionFalse,
52-
Reason: string(v1alpha2.ListenerReasonRefNotPermitted),
52+
Reason: string(v1beta1.ListenerReasonRefNotPermitted),
5353
}},
5454
}}
5555

conformance/tests/gateway-secret-invalid-reference-grant.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway-secret-invalid-reference-grant

conformance/tests/gateway-secret-missing-reference-grant.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
"k8s.io/apimachinery/pkg/types"
2424

25-
"sigs.k8s.io/gateway-api/apis/v1alpha2"
25+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2626
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
2727
"sigs.k8s.io/gateway-api/conformance/utils/suite"
2828
)
@@ -40,16 +40,16 @@ var GatewaySecretMissingReferenceGrant = suite.ConformanceTest{
4040
gwNN := types.NamespacedName{Name: "gateway-secret-missing-reference-grant", Namespace: "gateway-conformance-infra"}
4141

4242
t.Run("Gateway listener should have a false ResolvedRefs condition with reason RefNotPermitted", func(t *testing.T) {
43-
listeners := []v1alpha2.ListenerStatus{{
44-
Name: v1alpha2.SectionName("https"),
45-
SupportedKinds: []v1alpha2.RouteGroupKind{{
46-
Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group),
47-
Kind: v1alpha2.Kind("HTTPRoute"),
43+
listeners := []v1beta1.ListenerStatus{{
44+
Name: v1beta1.SectionName("https"),
45+
SupportedKinds: []v1beta1.RouteGroupKind{{
46+
Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group),
47+
Kind: v1beta1.Kind("HTTPRoute"),
4848
}},
4949
Conditions: []metav1.Condition{{
50-
Type: string(v1alpha2.ListenerConditionResolvedRefs),
50+
Type: string(v1beta1.ListenerConditionResolvedRefs),
5151
Status: metav1.ConditionFalse,
52-
Reason: string(v1alpha2.ListenerReasonRefNotPermitted),
52+
Reason: string(v1beta1.ListenerReasonRefNotPermitted),
5353
}},
5454
}}
5555

conformance/tests/gateway-secret-missing-reference-grant.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway-secret-missing-reference-grant

conformance/tests/gateway-secret-missing-referenced-secret.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
"k8s.io/apimachinery/pkg/types"
2424

25-
"sigs.k8s.io/gateway-api/apis/v1alpha2"
25+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2626
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
2727
"sigs.k8s.io/gateway-api/conformance/utils/suite"
2828
)
@@ -39,16 +39,16 @@ var GatewaySecretMissingReferencedSecret = suite.ConformanceTest{
3939
gwNN := types.NamespacedName{Name: "gateway-secret-missing-referenced-secret", Namespace: "gateway-conformance-infra"}
4040

4141
t.Run("Gateway listener should have a false ResolvedRefs condition with reason InvalidCertificateRef", func(t *testing.T) {
42-
listeners := []v1alpha2.ListenerStatus{{
43-
Name: v1alpha2.SectionName("https"),
44-
SupportedKinds: []v1alpha2.RouteGroupKind{{
45-
Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group),
46-
Kind: v1alpha2.Kind("HTTPRoute"),
42+
listeners := []v1beta1.ListenerStatus{{
43+
Name: v1beta1.SectionName("https"),
44+
SupportedKinds: []v1beta1.RouteGroupKind{{
45+
Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group),
46+
Kind: v1beta1.Kind("HTTPRoute"),
4747
}},
4848
Conditions: []metav1.Condition{{
49-
Type: string(v1alpha2.ListenerConditionResolvedRefs),
49+
Type: string(v1beta1.ListenerConditionResolvedRefs),
5050
Status: metav1.ConditionFalse,
51-
Reason: string(v1alpha2.ListenerReasonInvalidCertificateRef),
51+
Reason: string(v1beta1.ListenerReasonInvalidCertificateRef),
5252
}},
5353
}}
5454

conformance/tests/gateway-secret-missing-referenced-secret.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway-secret-missing-referenced-secret

conformance/tests/gateway-secret-reference-grant-all-in-namespace.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
"k8s.io/apimachinery/pkg/types"
2424

25-
"sigs.k8s.io/gateway-api/apis/v1alpha2"
25+
"sigs.k8s.io/gateway-api/apis/v1beta1"
2626
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
2727
"sigs.k8s.io/gateway-api/conformance/utils/suite"
2828
)
@@ -40,17 +40,17 @@ var GatewaySecretReferenceGrantAllInNamespace = suite.ConformanceTest{
4040
gwNN := types.NamespacedName{Name: "gateway-secret-reference-grant", Namespace: "gateway-conformance-infra"}
4141

4242
t.Run("Gateway listener should have a true ResolvedRefs condition and a true Ready condition", func(t *testing.T) {
43-
listeners := []v1alpha2.ListenerStatus{{
44-
Name: v1alpha2.SectionName("https"),
45-
SupportedKinds: []v1alpha2.RouteGroupKind{{
46-
Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group),
47-
Kind: v1alpha2.Kind("HTTPRoute"),
43+
listeners := []v1beta1.ListenerStatus{{
44+
Name: v1beta1.SectionName("https"),
45+
SupportedKinds: []v1beta1.RouteGroupKind{{
46+
Group: (*v1beta1.Group)(&v1beta1.GroupVersion.Group),
47+
Kind: v1beta1.Kind("HTTPRoute"),
4848
}},
4949
Conditions: []metav1.Condition{
5050
{
51-
Type: string(v1alpha2.ListenerConditionReady),
51+
Type: string(v1beta1.ListenerConditionReady),
5252
Status: metav1.ConditionTrue,
53-
Reason: string(v1alpha2.ListenerReasonReady),
53+
Reason: string(v1beta1.ListenerReasonReady),
5454
},
5555
},
5656
}}

conformance/tests/gateway-secret-reference-grant-all-in-namespace.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: gateway.networking.k8s.io/v1alpha2
1+
apiVersion: gateway.networking.k8s.io/v1beta1
22
kind: Gateway
33
metadata:
44
name: gateway-secret-reference-grant

0 commit comments

Comments
 (0)