Skip to content

Commit 8523bb2

Browse files
🌱 Drop hardcoded v1beta1 references (#12027)
* Drop hardcoded v1beta1 references * Address feedback
1 parent f4e68df commit 8523bb2

Some content is hidden

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

44 files changed

+1250
-1217
lines changed

api/v1beta1/groupversion_info.go

+9
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ var (
3636
AddToScheme = schemeBuilder.AddToScheme
3737

3838
objectTypes = []runtime.Object{}
39+
40+
// GroupVersionInfrastructure is the recommended group version for infrastructure objects.
41+
GroupVersionInfrastructure = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"}
42+
43+
// GroupVersionBootstrap is the recommended group version for bootstrap objects.
44+
GroupVersionBootstrap = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"}
45+
46+
// GroupVersionControlPlane is the recommended group version for controlplane objects.
47+
GroupVersionControlPlane = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"}
3948
)
4049

4150
func addKnownTypes(scheme *runtime.Scheme) error {

cmd/clusterctl/client/alpha/rollout_restarter_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Test_ObjectRestarter(t *testing.T) {
4949
&clusterv1.MachineDeployment{
5050
TypeMeta: metav1.TypeMeta{
5151
Kind: "MachineDeployment",
52-
APIVersion: "cluster.x-k8s.io/v1beta1",
52+
APIVersion: clusterv1.GroupVersion.String(),
5353
},
5454
ObjectMeta: metav1.ObjectMeta{
5555
Namespace: "default",
@@ -73,7 +73,7 @@ func Test_ObjectRestarter(t *testing.T) {
7373
&clusterv1.MachineDeployment{
7474
TypeMeta: metav1.TypeMeta{
7575
Kind: "MachineDeployment",
76-
APIVersion: "cluster.x-k8s.io/v1beta1",
76+
APIVersion: clusterv1.GroupVersion.String(),
7777
},
7878
ObjectMeta: metav1.ObjectMeta{
7979
Namespace: "default",
@@ -100,7 +100,7 @@ func Test_ObjectRestarter(t *testing.T) {
100100
&clusterv1.MachineDeployment{
101101
TypeMeta: metav1.TypeMeta{
102102
Kind: "MachineDeployment",
103-
APIVersion: "cluster.x-k8s.io/v1beta1",
103+
APIVersion: clusterv1.GroupVersion.String(),
104104
},
105105
ObjectMeta: metav1.ObjectMeta{
106106
Namespace: "default",
@@ -127,7 +127,7 @@ func Test_ObjectRestarter(t *testing.T) {
127127
&controlplanev1.KubeadmControlPlane{
128128
TypeMeta: metav1.TypeMeta{
129129
Kind: "KubeadmControlPlane",
130-
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
130+
APIVersion: clusterv1.GroupVersionControlPlane.String(),
131131
},
132132
ObjectMeta: metav1.ObjectMeta{
133133
Namespace: "default",
@@ -151,7 +151,7 @@ func Test_ObjectRestarter(t *testing.T) {
151151
&controlplanev1.KubeadmControlPlane{
152152
TypeMeta: metav1.TypeMeta{
153153
Kind: "KubeadmControlPlane",
154-
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
154+
APIVersion: clusterv1.GroupVersionControlPlane.String(),
155155
},
156156
ObjectMeta: metav1.ObjectMeta{
157157
Namespace: "default",
@@ -178,7 +178,7 @@ func Test_ObjectRestarter(t *testing.T) {
178178
&controlplanev1.KubeadmControlPlane{
179179
TypeMeta: metav1.TypeMeta{
180180
Kind: "KubeadmControlPlane",
181-
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
181+
APIVersion: clusterv1.GroupVersionControlPlane.String(),
182182
},
183183
ObjectMeta: metav1.ObjectMeta{
184184
Namespace: "default",

cmd/clusterctl/client/alpha/rollout_rollbacker_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func Test_ObjectRollbacker(t *testing.T) {
6666
ClusterName: "test",
6767
Version: &currentVersion,
6868
InfrastructureRef: corev1.ObjectReference{
69-
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
69+
APIVersion: clusterv1.GroupVersionInfrastructure.String(),
7070
Kind: "InfrastructureMachineTemplate",
7171
Name: "md-template",
7272
},
@@ -145,7 +145,7 @@ func Test_ObjectRollbacker(t *testing.T) {
145145
ClusterName: "test",
146146
Version: &rollbackVersion,
147147
InfrastructureRef: corev1.ObjectReference{
148-
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
148+
APIVersion: clusterv1.GroupVersionInfrastructure.String(),
149149
Kind: "InfrastructureMachineTemplate",
150150
Name: "md-template-rollback",
151151
},

cmd/clusterctl/client/cluster/mover_test.go

+145-138
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)