Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Drop hardcoded v1beta1 references #12027

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ var (
AddToScheme = schemeBuilder.AddToScheme

objectTypes = []runtime.Object{}

// GroupVersionInfrastructure is the recommended group version for infrastructure objects.
GroupVersionInfrastructure = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"}

// GroupVersionBootstrap is the recommended group version for bootstrap objects.
GroupVersionBootstrap = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"}

// GroupVersionControlPlane is the recommended group version for controlplane objects.
GroupVersionControlPlane = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"}
)

func addKnownTypes(scheme *runtime.Scheme) error {
Expand Down
12 changes: 6 additions & 6 deletions cmd/clusterctl/client/alpha/rollout_restarter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Test_ObjectRestarter(t *testing.T) {
&clusterv1.MachineDeployment{
TypeMeta: metav1.TypeMeta{
Kind: "MachineDeployment",
APIVersion: "cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand All @@ -73,7 +73,7 @@ func Test_ObjectRestarter(t *testing.T) {
&clusterv1.MachineDeployment{
TypeMeta: metav1.TypeMeta{
Kind: "MachineDeployment",
APIVersion: "cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand All @@ -100,7 +100,7 @@ func Test_ObjectRestarter(t *testing.T) {
&clusterv1.MachineDeployment{
TypeMeta: metav1.TypeMeta{
Kind: "MachineDeployment",
APIVersion: "cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand All @@ -127,7 +127,7 @@ func Test_ObjectRestarter(t *testing.T) {
&controlplanev1.KubeadmControlPlane{
TypeMeta: metav1.TypeMeta{
Kind: "KubeadmControlPlane",
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersionControlPlane.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand All @@ -151,7 +151,7 @@ func Test_ObjectRestarter(t *testing.T) {
&controlplanev1.KubeadmControlPlane{
TypeMeta: metav1.TypeMeta{
Kind: "KubeadmControlPlane",
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersionControlPlane.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand All @@ -178,7 +178,7 @@ func Test_ObjectRestarter(t *testing.T) {
&controlplanev1.KubeadmControlPlane{
TypeMeta: metav1.TypeMeta{
Kind: "KubeadmControlPlane",
APIVersion: "controlplane.cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersionControlPlane.String(),
},
ObjectMeta: metav1.ObjectMeta{
Namespace: "default",
Expand Down
4 changes: 2 additions & 2 deletions cmd/clusterctl/client/alpha/rollout_rollbacker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func Test_ObjectRollbacker(t *testing.T) {
ClusterName: "test",
Version: &currentVersion,
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersionInfrastructure.String(),
Kind: "InfrastructureMachineTemplate",
Name: "md-template",
},
Expand Down Expand Up @@ -145,7 +145,7 @@ func Test_ObjectRollbacker(t *testing.T) {
ClusterName: "test",
Version: &rollbackVersion,
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
APIVersion: clusterv1.GroupVersionInfrastructure.String(),
Kind: "InfrastructureMachineTemplate",
Name: "md-template-rollback",
},
Expand Down
283 changes: 145 additions & 138 deletions cmd/clusterctl/client/cluster/mover_test.go

Large diffs are not rendered by default.

Loading