From 0d62df2d8e288b680c0151a9e08399012db173c5 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Thu, 16 Sep 2021 08:48:45 -0700 Subject: [PATCH] Prepare the entire codebase for v1beta1 rev Signed-off-by: Vince Prignano --- .../controllers/kubeadmconfig_controller.go | 6 +- ...ubeadmconfig_controller_reconciler_test.go | 2 +- .../kubeadmconfig_controller_test.go | 6 +- .../kubeadm/internal/cloudinit/cloudinit.go | 2 +- .../internal/cloudinit/cloudinit_test.go | 2 +- .../kubeadm/internal/cloudinit/node_test.go | 2 +- .../locking/control_plane_init_mutex.go | 2 +- .../locking/control_plane_init_mutex_test.go | 2 +- bootstrap/kubeadm/main.go | 12 ++-- bootstrap/util/configowner.go | 4 +- bootstrap/util/configowner_test.go | 6 +- controllers/cluster_controller.go | 4 +- controllers/cluster_controller_phases.go | 2 +- controllers/cluster_controller_phases_test.go | 10 +-- controllers/cluster_controller_test.go | 4 +- controllers/external/testing.go | 2 +- controllers/external/tracker_test.go | 2 +- controllers/external/util.go | 3 +- controllers/external/util_test.go | 2 +- controllers/machine_controller.go | 4 +- controllers/machine_controller_node_labels.go | 2 +- .../machine_controller_node_labels_test.go | 8 +-- controllers/machine_controller_noderef.go | 4 +- .../machine_controller_noderef_test.go | 2 +- controllers/machine_controller_phases.go | 2 +- controllers/machine_controller_phases_test.go | 48 ++++++------- controllers/machine_controller_test.go | 68 +++++++++---------- controllers/machinedeployment_controller.go | 2 +- .../machinedeployment_controller_test.go | 8 +-- controllers/machinedeployment_rolling.go | 2 +- controllers/machinedeployment_rolling_test.go | 2 +- .../machinedeployment_rollout_ondelete.go | 2 +- controllers/machinedeployment_sync.go | 2 +- controllers/machinedeployment_sync_test.go | 2 +- controllers/machinehealthcheck_controller.go | 4 +- .../machinehealthcheck_controller_test.go | 10 +-- .../machinehealthcheck_status_matcher_test.go | 2 +- controllers/machinehealthcheck_targets.go | 2 +- .../machinehealthcheck_targets_test.go | 2 +- controllers/machineset_controller.go | 2 +- controllers/machineset_controller_test.go | 16 ++--- controllers/machineset_delete_policy.go | 2 +- controllers/machineset_delete_policy_test.go | 2 +- controllers/mdutil/util.go | 2 +- controllers/mdutil/util_test.go | 10 +-- controllers/noderefutil/indexer.go | 2 +- controllers/noderefutil/machine.go | 2 +- controllers/remote/cluster_cache.go | 2 +- .../remote/cluster_cache_healthcheck_test.go | 2 +- .../remote/cluster_cache_reconciler.go | 2 +- .../remote/cluster_cache_reconciler_test.go | 2 +- .../remote/cluster_cache_tracker_test.go | 2 +- controllers/remote/index.go | 2 +- controllers/schema_test.go | 2 +- controllers/suite_test.go | 4 +- controllers/suite_util_test.go | 2 +- controllers/topology/blueprint.go | 2 +- controllers/topology/blueprint_test.go | 2 +- controllers/topology/cluster_controller.go | 4 +- controllers/topology/current_state.go | 2 +- controllers/topology/current_state_test.go | 2 +- controllers/topology/desired_state.go | 2 +- controllers/topology/desired_state_test.go | 2 +- .../internal/check/compatibility_test.go | 4 +- .../internal/contract/controlplane_test.go | 2 +- .../topology/internal/contract/metadata.go | 2 +- controllers/topology/internal/log/log.go | 2 +- .../topology/internal/scope/blueprint.go | 2 +- controllers/topology/internal/scope/scope.go | 2 +- controllers/topology/internal/scope/state.go | 2 +- .../topology/machinedeployment_controller.go | 2 +- .../machinedeployment_controller_test.go | 2 +- controllers/topology/machineset_controller.go | 2 +- .../topology/machineset_controller_test.go | 2 +- controllers/topology/reconcile_state_test.go | 2 +- controllers/topology/suite_test.go | 2 +- controllers/topology/util.go | 2 +- controllers/topology/util_test.go | 4 +- internal/envtest/environment.go | 10 +-- internal/testtypes/bootstrap.go | 2 +- internal/testtypes/builders.go | 2 +- internal/testtypes/controlplane.go | 2 +- internal/testtypes/crds.go | 4 +- internal/testtypes/infrastructure.go | 2 +- internal/testtypes/remediation.go | 2 +- main.go | 32 ++++++--- test/e2e/clusterctl_upgrade.go | 2 +- test/e2e/common.go | 2 +- test/e2e/e2e_suite_test.go | 2 +- test/e2e/kcp_adoption.go | 7 +- test/e2e/node_drain_timeout.go | 5 +- test/e2e/self_hosted.go | 2 +- test/framework/alltypes_helpers.go | 2 +- test/framework/bootstrap/kind_provider.go | 2 +- test/framework/cluster_helpers.go | 2 +- test/framework/cluster_proxy.go | 4 +- .../clusterctl/clusterctl_helpers.go | 6 +- test/framework/clusterresourceset_helpers.go | 4 +- test/framework/control_plane.go | 2 +- test/framework/controlplane_helpers.go | 6 +- test/framework/convenience.go | 14 ++-- test/framework/deployment_helpers.go | 2 +- test/framework/docker_logcollector.go | 4 +- test/framework/machine_helpers.go | 2 +- test/framework/machinedeployment_helpers.go | 2 +- test/framework/machinehealthcheck_helpers.go | 2 +- test/framework/machinepool_helpers.go | 4 +- test/framework/machines.go | 2 +- test/infrastructure/container/docker.go | 4 +- test/infrastructure/container/interface.go | 4 +- .../controllers/dockercluster_controller.go | 4 +- .../controllers/dockermachine_controller.go | 4 +- .../dockermachine_controller_test.go | 4 +- .../docker/controllers/suite_test.go | 4 +- .../docker/docker/kind_manager.go | 2 +- .../docker/docker/loadbalancer.go | 8 +-- test/infrastructure/docker/docker/machine.go | 4 +- test/infrastructure/docker/main.go | 20 +++--- util/annotations/helpers.go | 2 +- util/collections/helpers.go | 2 +- util/collections/machine_collection.go | 2 +- util/collections/machine_collection_test.go | 2 +- util/collections/machine_filters.go | 4 +- util/collections/machine_filters_test.go | 4 +- util/conditions/getter.go | 2 +- util/conditions/getter_test.go | 2 +- util/conditions/matcher.go | 2 +- util/conditions/matcher_test.go | 2 +- util/conditions/matchers.go | 2 +- util/conditions/merge.go | 2 +- util/conditions/merge_strategies.go | 2 +- util/conditions/merge_strategies_test.go | 2 +- util/conditions/merge_test.go | 2 +- util/conditions/patch.go | 2 +- util/conditions/patch_test.go | 2 +- util/conditions/setter.go | 2 +- util/conditions/setter_test.go | 2 +- util/conditions/suite_test.go | 2 +- util/conditions/unstructured.go | 2 +- util/conditions/unstructured_test.go | 2 +- util/conversion/conversion.go | 2 +- util/conversion/conversion_test.go | 2 +- util/deprecated.go | 2 +- util/failuredomains/failure_domains.go | 2 +- util/failuredomains/failure_domains_test.go | 2 +- util/kubeconfig/kubeconfig.go | 2 +- util/kubeconfig/kubeconfig_test.go | 2 +- util/kubeconfig/testing.go | 2 +- util/labels/helpers.go | 2 +- util/labels/helpers_test.go | 2 +- util/patch/options.go | 2 +- util/patch/patch.go | 2 +- util/patch/patch_test.go | 6 +- util/patch/utils_test.go | 2 +- util/predicates/cluster_predicates.go | 2 +- util/secret/certificates.go | 4 +- util/secret/certificates_test.go | 2 +- util/suite_test.go | 2 +- util/util.go | 2 +- util/util_test.go | 16 ++--- util/yaml/yaml.go | 2 +- util/yaml/yaml_test.go | 30 ++++---- 162 files changed, 354 insertions(+), 341 deletions(-) diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go index 9672f65317cd..d0829c066813 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go @@ -32,14 +32,14 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/cloudinit" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/locking" kubeadmtypes "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types" bsutil "sigs.k8s.io/cluster-api/bootstrap/util" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go index b3713e5d3691..9ee8bb7d1260 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_reconciler_test.go @@ -24,7 +24,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) func TestKubeadmConfigReconciler(t *testing.T) { diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go index 2e56ac0081b8..949ca90e5102 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go @@ -35,10 +35,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" fakeremote "sigs.k8s.io/cluster-api/controllers/remote/fake" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/bootstrap/kubeadm/internal/cloudinit/cloudinit.go b/bootstrap/kubeadm/internal/cloudinit/cloudinit.go index 5dafd59d6b61..027df98b5f6b 100644 --- a/bootstrap/kubeadm/internal/cloudinit/cloudinit.go +++ b/bootstrap/kubeadm/internal/cloudinit/cloudinit.go @@ -23,7 +23,7 @@ import ( "text/template" "github.com/pkg/errors" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) const ( diff --git a/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go b/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go index 039c9b06c49c..43717c307c5f 100644 --- a/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go +++ b/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/secret" ) diff --git a/bootstrap/kubeadm/internal/cloudinit/node_test.go b/bootstrap/kubeadm/internal/cloudinit/node_test.go index e66ca70679cc..d35171694ec9 100644 --- a/bootstrap/kubeadm/internal/cloudinit/node_test.go +++ b/bootstrap/kubeadm/internal/cloudinit/node_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/yaml" ) diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go index 55895b2543da..777e140556da 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go index 220041464171..53a30c04a25c 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index 45fe41ad8ee7..127d69cef487 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -33,12 +33,13 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - kubeadmbootstrapv1old "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" - kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + kubeadmbootstrapv1alpha3 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" + kubeadmbootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/controllers" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" ctrl "sigs.k8s.io/controller-runtime" @@ -58,7 +59,8 @@ func init() { _ = clientgoscheme.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = expv1.AddToScheme(scheme) - _ = kubeadmbootstrapv1old.AddToScheme(scheme) + _ = kubeadmbootstrapv1alpha3.AddToScheme(scheme) + _ = kubeadmbootstrapv1alpha4.AddToScheme(scheme) _ = kubeadmbootstrapv1.AddToScheme(scheme) // +kubebuilder:scaffold:scheme } diff --git a/bootstrap/util/configowner.go b/bootstrap/util/configowner.go index ec524cdaf86f..2c2ec71274c3 100644 --- a/bootstrap/util/configowner.go +++ b/bootstrap/util/configowner.go @@ -25,9 +25,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/bootstrap/util/configowner_test.go b/bootstrap/util/configowner_test.go index e034df329310..44e49c44eede 100644 --- a/bootstrap/util/configowner_test.go +++ b/bootstrap/util/configowner_test.go @@ -23,9 +23,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index d8a31f43f19c..85851d146b82 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -31,9 +31,9 @@ import ( "k8s.io/apimachinery/pkg/runtime" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/cluster_controller_phases.go b/controllers/cluster_controller_phases.go index 21359c5bd22d..a2388a27f364 100644 --- a/controllers/cluster_controller_phases.go +++ b/controllers/cluster_controller_phases.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/cluster_controller_phases_test.go b/controllers/cluster_controller_phases_test.go index dbb23fccbfed..76986bf7cb08 100644 --- a/controllers/cluster_controller_phases_test.go +++ b/controllers/cluster_controller_phases_test.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -50,7 +50,7 @@ func TestClusterReconcilePhases(t *testing.T) { Port: 8443, }, InfrastructureRef: &corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "test", }, @@ -80,7 +80,7 @@ func TestClusterReconcilePhases(t *testing.T) { cluster: cluster, infraRef: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "test", "namespace": "test-namespace", @@ -94,7 +94,7 @@ func TestClusterReconcilePhases(t *testing.T) { cluster: cluster, infraRef: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "test", "namespace": "test-namespace", @@ -108,7 +108,7 @@ func TestClusterReconcilePhases(t *testing.T) { cluster: cluster, infraRef: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "test", "namespace": "test-namespace", diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index c026d68dc2dd..2dd3199a365a 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -27,8 +27,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/external/testing.go b/controllers/external/testing.go index 225ae0906722..c2d07f9acc8b 100644 --- a/controllers/external/testing.go +++ b/controllers/external/testing.go @@ -20,7 +20,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/external/tracker_test.go b/controllers/external/tracker_test.go index 9d3ef6c24624..7026b4c5a815 100644 --- a/controllers/external/tracker_test.go +++ b/controllers/external/tracker_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/controllers/external/util.go b/controllers/external/util.go index 783108fd1b8a..ff2ad581b493 100644 --- a/controllers/external/util.go +++ b/controllers/external/util.go @@ -25,9 +25,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apiserver/pkg/storage/names" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( diff --git a/controllers/external/util_test.go b/controllers/external/util_test.go index 8e85596c0b23..8a61a3d24176 100644 --- a/controllers/external/util_test.go +++ b/controllers/external/util_test.go @@ -26,7 +26,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/machine_controller.go b/controllers/machine_controller.go index 12254060feb1..fa7535b8f8c7 100644 --- a/controllers/machine_controller.go +++ b/controllers/machine_controller.go @@ -32,8 +32,8 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" diff --git a/controllers/machine_controller_node_labels.go b/controllers/machine_controller_node_labels.go index f085e648af20..dddcfc917aa3 100644 --- a/controllers/machine_controller_node_labels.go +++ b/controllers/machine_controller_node_labels.go @@ -21,7 +21,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/machine_controller_node_labels_test.go b/controllers/machine_controller_node_labels_test.go index fcbf7cb0cfcd..8ae78937d5b3 100644 --- a/controllers/machine_controller_node_labels_test.go +++ b/controllers/machine_controller_node_labels_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" @@ -45,7 +45,7 @@ func TestReconcileInterruptibleNodeLabel(t *testing.T) { infraMachine := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": ns.Name, @@ -77,14 +77,14 @@ func TestReconcileInterruptibleNodeLabel(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: cluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", Namespace: ns.Name, }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "BootstrapMachine", Name: "bootstrap-config1", }, diff --git a/controllers/machine_controller_noderef.go b/controllers/machine_controller_noderef.go index 8c7536e69538..cdf7c7694822 100644 --- a/controllers/machine_controller_noderef.go +++ b/controllers/machine_controller_noderef.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/machine_controller_noderef_test.go b/controllers/machine_controller_noderef_test.go index 74c8cb230139..1e73f3fc21cd 100644 --- a/controllers/machine_controller_noderef_test.go +++ b/controllers/machine_controller_noderef_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machine_controller_phases.go b/controllers/machine_controller_phases.go index 41ec4a1326f6..1f6d73d109a1 100644 --- a/controllers/machine_controller_phases.go +++ b/controllers/machine_controller_phases.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machine_controller_phases_test.go b/controllers/machine_controller_phases_test.go index e7cc0a0db3d2..47657f05fd84 100644 --- a/controllers/machine_controller_phases_test.go +++ b/controllers/machine_controller_phases_test.go @@ -35,7 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/log" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util/conditions" @@ -69,13 +69,13 @@ func TestReconcileMachinePhases(t *testing.T) { ClusterName: defaultCluster.Name, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -85,7 +85,7 @@ func TestReconcileMachinePhases(t *testing.T) { defaultBootstrap := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -98,7 +98,7 @@ func TestReconcileMachinePhases(t *testing.T) { defaultInfra := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": metav1.NamespaceDefault, @@ -602,7 +602,7 @@ func TestReconcileBootstrap(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, @@ -629,7 +629,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "new machine, bootstrap config ready with data", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -652,7 +652,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "new machine, bootstrap config ready with no data", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -673,7 +673,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "new machine, bootstrap config not ready", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -691,7 +691,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "new machine, bootstrap config is not found", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": "wrong-namespace", @@ -709,7 +709,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "new machine, no bootstrap config or data", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": "wrong-namespace", @@ -724,7 +724,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "existing machine, bootstrap data should not change", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -743,7 +743,7 @@ func TestReconcileBootstrap(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, @@ -765,7 +765,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "existing machine, bootstrap provider is not ready, and ownerref updated", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -792,7 +792,7 @@ func TestReconcileBootstrap(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, @@ -812,7 +812,7 @@ func TestReconcileBootstrap(t *testing.T) { name: "existing machine, machineset owner and version v1alpha2, and ownerref updated", bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -902,13 +902,13 @@ func TestReconcileInfrastructure(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -936,7 +936,7 @@ func TestReconcileInfrastructure(t *testing.T) { name: "new machine, infrastructure config ready", infraConfig: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": metav1.NamespaceDefault, @@ -985,13 +985,13 @@ func TestReconcileInfrastructure(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -1004,7 +1004,7 @@ func TestReconcileInfrastructure(t *testing.T) { }, bootstrapConfig: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -1017,7 +1017,7 @@ func TestReconcileInfrastructure(t *testing.T) { }, infraConfig: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{}, }, expectResult: ctrl.Result{}, @@ -1033,7 +1033,7 @@ func TestReconcileInfrastructure(t *testing.T) { name: "infrastructure ref is paused", infraConfig: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": metav1.NamespaceDefault, diff --git a/controllers/machine_controller_test.go b/controllers/machine_controller_test.go index a2958367bbad..d74a2b0707bf 100644 --- a/controllers/machine_controller_test.go +++ b/controllers/machine_controller_test.go @@ -34,7 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util" @@ -50,7 +50,7 @@ func TestWatches(t *testing.T) { infraMachine := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": ns.Name, @@ -73,7 +73,7 @@ func TestWatches(t *testing.T) { defaultBootstrap := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config-machinereconcile", "namespace": ns.Name, @@ -134,13 +134,13 @@ func TestWatches(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: testCluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config-machinereconcile", }, @@ -186,7 +186,7 @@ func TestMachine_Reconcile(t *testing.T) { infraMachine := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": ns.Name, @@ -200,7 +200,7 @@ func TestMachine_Reconcile(t *testing.T) { defaultBootstrap := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config-machinereconcile", "namespace": ns.Name, @@ -234,13 +234,13 @@ func TestMachine_Reconcile(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: testCluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config-machinereconcile", }, @@ -578,7 +578,7 @@ func TestReconcileRequest(t *testing.T) { infraConfig := unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": metav1.NamespaceDefault, @@ -633,7 +633,7 @@ func TestReconcileRequest(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: "test-cluster", InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -661,7 +661,7 @@ func TestReconcileRequest(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: "test-cluster", InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -693,7 +693,7 @@ func TestReconcileRequest(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: "test-cluster", InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -741,7 +741,7 @@ func TestMachineConditions(t *testing.T) { return &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": metav1.NamespaceDefault, @@ -772,7 +772,7 @@ func TestMachineConditions(t *testing.T) { return &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config1", "namespace": metav1.NamespaceDefault, @@ -802,13 +802,13 @@ func TestMachineConditions(t *testing.T) { ProviderID: pointer.StringPtr("test://id-1"), ClusterName: "test-cluster", InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config1", }, @@ -988,7 +988,7 @@ func TestReconcileDeleteExternal(t *testing.T) { bootstrapConfig := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "BootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "delete-bootstrap", "namespace": metav1.NamespaceDefault, @@ -1005,7 +1005,7 @@ func TestReconcileDeleteExternal(t *testing.T) { ClusterName: "test-cluster", Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "BootstrapConfig", Name: "delete-bootstrap", }, @@ -1024,7 +1024,7 @@ func TestReconcileDeleteExternal(t *testing.T) { bootstrapExists: true, expected: &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "kind": "BootstrapConfig", "metadata": map[string]interface{}{ "name": "delete-bootstrap", @@ -1087,7 +1087,7 @@ func TestRemoveMachineFinalizerAfterDeleteReconcile(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: "test-cluster", InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, @@ -1379,7 +1379,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { }, Spec: clusterv1.ClusterSpec{ ControlPlaneRef: &corev1.ObjectReference{ - APIVersion: "controlplane.cluster.x-k8s.io/v1alpha4", + APIVersion: "controlplane.cluster.x-k8s.io/v1beta1", Kind: "AWSManagedControlPlane", Name: "test-cluster", Namespace: "test-cluster", @@ -1417,7 +1417,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { }, Spec: clusterv1.ClusterSpec{ ControlPlaneRef: &corev1.ObjectReference{ - APIVersion: "controlplane.cluster.x-k8s.io/v1alpha4", + APIVersion: "controlplane.cluster.x-k8s.io/v1beta1", Kind: "AWSManagedControlPlane", Name: "test-cluster-2", Namespace: "test-cluster", @@ -1455,7 +1455,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { }, Spec: clusterv1.ClusterSpec{ ControlPlaneRef: &corev1.ObjectReference{ - APIVersion: "controlplane.cluster.x-k8s.io/v1alpha4", + APIVersion: "controlplane.cluster.x-k8s.io/v1beta1", Kind: "AWSManagedControlPlane", Name: "test-cluster-3", Namespace: "test-cluster", @@ -1493,7 +1493,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { }, }, } - emp.SetAPIVersion("controlplane.cluster.x-k8s.io/v1alpha4") + emp.SetAPIVersion("controlplane.cluster.x-k8s.io/v1beta1") emp.SetKind("AWSManagedControlPlane") emp.SetName("test-cluster") emp.SetNamespace("test-cluster") @@ -1501,7 +1501,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { mcpBeingDeleted := &unstructured.Unstructured{ Object: map[string]interface{}{}, } - mcpBeingDeleted.SetAPIVersion("controlplane.cluster.x-k8s.io/v1alpha4") + mcpBeingDeleted.SetAPIVersion("controlplane.cluster.x-k8s.io/v1beta1") mcpBeingDeleted.SetKind("AWSManagedControlPlane") mcpBeingDeleted.SetName("test-cluster-2") mcpBeingDeleted.SetNamespace("test-cluster") @@ -1514,7 +1514,7 @@ func TestIsDeleteNodeAllowed(t *testing.T) { }, }, } - empBeingDeleted.SetAPIVersion("controlplane.cluster.x-k8s.io/v1alpha4") + empBeingDeleted.SetAPIVersion("controlplane.cluster.x-k8s.io/v1beta1") empBeingDeleted.SetKind("AWSManagedControlPlane") empBeingDeleted.SetName("test-cluster-3") empBeingDeleted.SetNamespace("test-cluster") @@ -1601,7 +1601,7 @@ func TestNodeToMachine(t *testing.T) { infraMachine := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config1", "namespace": ns.Name, @@ -1624,7 +1624,7 @@ func TestNodeToMachine(t *testing.T) { infraMachine2 := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "infra-config2", "namespace": ns.Name, @@ -1647,7 +1647,7 @@ func TestNodeToMachine(t *testing.T) { defaultBootstrap := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "name": "bootstrap-config-machinereconcile", "namespace": ns.Name, @@ -1724,13 +1724,13 @@ func TestNodeToMachine(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: testCluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config1", }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config-machinereconcile", }, @@ -1763,13 +1763,13 @@ func TestNodeToMachine(t *testing.T) { Spec: clusterv1.MachineSpec{ ClusterName: testCluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachine", Name: "infra-config2", }, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfig", Name: "bootstrap-config-machinereconcile", }, diff --git a/controllers/machinedeployment_controller.go b/controllers/machinedeployment_controller.go index b11e6162ca16..b6118c0dcb1f 100644 --- a/controllers/machinedeployment_controller.go +++ b/controllers/machinedeployment_controller.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/machinedeployment_controller_test.go b/controllers/machinedeployment_controller_test.go index cbbdce5bf54f..3361e3558c9c 100644 --- a/controllers/machinedeployment_controller_test.go +++ b/controllers/machinedeployment_controller_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" @@ -113,7 +113,7 @@ func TestMachineDeploymentReconciler(t *testing.T) { ClusterName: testCluster.Name, Version: &version, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachineTemplate", Name: "md-template", }, @@ -132,7 +132,7 @@ func TestMachineDeploymentReconciler(t *testing.T) { // Create infrastructure template resource. infraResource := map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{}, "spec": map[string]interface{}{ "size": "3xlarge", @@ -146,7 +146,7 @@ func TestMachineDeploymentReconciler(t *testing.T) { }, } infraTmpl.SetKind("GenericInfrastructureMachineTemplate") - infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha4") + infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1beta1") infraTmpl.SetName("md-template") infraTmpl.SetNamespace(namespace.Name) t.Log("Creating the infrastructure template") diff --git a/controllers/machinedeployment_rolling.go b/controllers/machinedeployment_rolling.go index a86bd01af91e..726a47957b43 100644 --- a/controllers/machinedeployment_rolling.go +++ b/controllers/machinedeployment_rolling.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/utils/integer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/machinedeployment_rolling_test.go b/controllers/machinedeployment_rolling_test.go index 6aa0332cc2db..0425d56978fc 100644 --- a/controllers/machinedeployment_rolling_test.go +++ b/controllers/machinedeployment_rolling_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/machinedeployment_rollout_ondelete.go b/controllers/machinedeployment_rollout_ondelete.go index 3363414453b1..4cdfd75ee0dd 100644 --- a/controllers/machinedeployment_rollout_ondelete.go +++ b/controllers/machinedeployment_rollout_ondelete.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/machinedeployment_sync.go b/controllers/machinedeployment_sync.go index c3264ff7a00f..032a6f4f49bc 100644 --- a/controllers/machinedeployment_sync.go +++ b/controllers/machinedeployment_sync.go @@ -29,7 +29,7 @@ import ( apirand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/retry" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinedeployment_sync_test.go b/controllers/machinedeployment_sync_test.go index 7f97e355d1ed..73366f8ecb61 100644 --- a/controllers/machinedeployment_sync_test.go +++ b/controllers/machinedeployment_sync_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/machinehealthcheck_controller.go b/controllers/machinehealthcheck_controller.go index 699b86729b5c..14c1a8f34c34 100644 --- a/controllers/machinehealthcheck_controller.go +++ b/controllers/machinehealthcheck_controller.go @@ -35,8 +35,8 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinehealthcheck_controller_test.go b/controllers/machinehealthcheck_controller_test.go index 3363e78afef9..9651893a6594 100644 --- a/controllers/machinehealthcheck_controller_test.go +++ b/controllers/machinehealthcheck_controller_test.go @@ -41,7 +41,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" @@ -1199,7 +1199,7 @@ func TestMachineHealthCheck_Reconcile(t *testing.T) { // Create infrastructure template resource. infraResource := map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{}, "spec": map[string]interface{}{ "size": "3xlarge", @@ -1213,7 +1213,7 @@ func TestMachineHealthCheck_Reconcile(t *testing.T) { }, } infraTmpl.SetKind("GenericInfrastructureMachineTemplate") - infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha4") + infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1beta1") infraTmpl.SetGenerateName("mhc-ms-template-") infraTmpl.SetNamespace(mhc.Namespace) @@ -1238,7 +1238,7 @@ func TestMachineHealthCheck_Reconcile(t *testing.T) { DataSecretName: pointer.StringPtr("test-data-secret-name"), }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachineTemplate", Name: infraTmpl.GetName(), }, @@ -2320,7 +2320,7 @@ func newInfraMachine(machine *clusterv1.Machine) (*unstructured.Unstructured, st providerID := fmt.Sprintf("test:////%v", uuid.NewUUID()) return &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "kind": "GenericInfrastructureMachine", "metadata": map[string]interface{}{ "generateName": "test-mhc-machine-infra-", diff --git a/controllers/machinehealthcheck_status_matcher_test.go b/controllers/machinehealthcheck_status_matcher_test.go index 63bcc3e92089..73d5c08f288a 100644 --- a/controllers/machinehealthcheck_status_matcher_test.go +++ b/controllers/machinehealthcheck_status_matcher_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/controllers/machinehealthcheck_targets.go b/controllers/machinehealthcheck_targets.go index c103a9847ab1..f7907b1685a1 100644 --- a/controllers/machinehealthcheck_targets.go +++ b/controllers/machinehealthcheck_targets.go @@ -27,7 +27,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/machinehealthcheck_targets_test.go b/controllers/machinehealthcheck_targets_test.go index 331b897a15be..d7e776ad395a 100644 --- a/controllers/machinehealthcheck_targets_test.go +++ b/controllers/machinehealthcheck_targets_test.go @@ -24,7 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/machineset_controller.go b/controllers/machineset_controller.go index 39d043641617..c8a4adcfc37b 100644 --- a/controllers/machineset_controller.go +++ b/controllers/machineset_controller.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" diff --git a/controllers/machineset_controller_test.go b/controllers/machineset_controller_test.go index 4adcf127c991..5bec4d58fafc 100644 --- a/controllers/machineset_controller_test.go +++ b/controllers/machineset_controller_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" ) @@ -103,13 +103,13 @@ func TestMachineSetReconciler(t *testing.T) { Version: &version, Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "GenericBootstrapConfigTemplate", Name: "ms-template", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "GenericInfrastructureMachineTemplate", Name: "ms-template", }, @@ -121,7 +121,7 @@ func TestMachineSetReconciler(t *testing.T) { // Create bootstrap template resource. bootstrapResource := map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{}, } bootstrapTmpl := &unstructured.Unstructured{ @@ -132,7 +132,7 @@ func TestMachineSetReconciler(t *testing.T) { }, } bootstrapTmpl.SetKind("GenericBootstrapConfigTemplate") - bootstrapTmpl.SetAPIVersion("bootstrap.cluster.x-k8s.io/v1alpha4") + bootstrapTmpl.SetAPIVersion("bootstrap.cluster.x-k8s.io/v1beta1") bootstrapTmpl.SetName("ms-template") bootstrapTmpl.SetNamespace(namespace.Name) g.Expect(env.Create(ctx, bootstrapTmpl)).To(Succeed()) @@ -140,7 +140,7 @@ func TestMachineSetReconciler(t *testing.T) { // Create infrastructure template resource. infraResource := map[string]interface{}{ "kind": "GenericInfrastructureMachine", - "apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4", + "apiVersion": "infrastructure.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "annotations": map[string]interface{}{ "precedence": "GenericInfrastructureMachineTemplate", @@ -158,7 +158,7 @@ func TestMachineSetReconciler(t *testing.T) { }, } infraTmpl.SetKind("GenericInfrastructureMachineTemplate") - infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha4") + infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1beta1") infraTmpl.SetName("ms-template") infraTmpl.SetNamespace(namespace.Name) g.Expect(env.Create(ctx, infraTmpl)).To(Succeed()) @@ -211,7 +211,7 @@ func TestMachineSetReconciler(t *testing.T) { t.Log("Creating a InfrastructureMachine for each Machine") infraMachines := &unstructured.UnstructuredList{} - infraMachines.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha4") + infraMachines.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1beta1") infraMachines.SetKind("GenericInfrastructureMachine") g.Eventually(func() int { if err := env.List(ctx, infraMachines, client.InNamespace(namespace.Name)); err != nil { diff --git a/controllers/machineset_delete_policy.go b/controllers/machineset_delete_policy.go index 1b705ad6af89..9d52bfd28077 100644 --- a/controllers/machineset_delete_policy.go +++ b/controllers/machineset_delete_policy.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) type ( diff --git a/controllers/machineset_delete_policy_test.go b/controllers/machineset_delete_policy_test.go index ccc9565b2a22..126cecd7794e 100644 --- a/controllers/machineset_delete_policy_test.go +++ b/controllers/machineset_delete_policy_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/controllers/mdutil/util.go b/controllers/mdutil/util.go index 0388989dc5d3..c9358e778bfc 100644 --- a/controllers/mdutil/util.go +++ b/controllers/mdutil/util.go @@ -34,7 +34,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" intstrutil "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/integer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/controllers/mdutil/util_test.go b/controllers/mdutil/util_test.go index f6b038fbfebb..ece993de2fb8 100644 --- a/controllers/mdutil/util_test.go +++ b/controllers/mdutil/util_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apiserver/pkg/storage/names" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func newDControllerRef(d *clusterv1.MachineDeployment) *metav1.OwnerReference { @@ -196,12 +196,12 @@ func TestEqualMachineTemplate(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "MachineBootstrap", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "MachineInfrastructure", }, }, @@ -234,12 +234,12 @@ func TestEqualMachineTemplate(t *testing.T) { Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ - APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha4", + APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1", Kind: "MachineBootstrap2", }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha4", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", Kind: "MachineInfrastructure", }, }, diff --git a/controllers/noderefutil/indexer.go b/controllers/noderefutil/indexer.go index d2fe60006d69..3176154b1292 100644 --- a/controllers/noderefutil/indexer.go +++ b/controllers/noderefutil/indexer.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/noderefutil/machine.go b/controllers/noderefutil/machine.go index e0845a01b873..c3cf28f883fc 100644 --- a/controllers/noderefutil/machine.go +++ b/controllers/noderefutil/machine.go @@ -20,7 +20,7 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/remote/cluster_cache.go b/controllers/remote/cluster_cache.go index 3b884be02f84..3245ad35656a 100644 --- a/controllers/remote/cluster_cache.go +++ b/controllers/remote/cluster_cache.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" diff --git a/controllers/remote/cluster_cache_healthcheck_test.go b/controllers/remote/cluster_cache_healthcheck_test.go index 259f1269053d..42ec9b573c22 100644 --- a/controllers/remote/cluster_cache_healthcheck_test.go +++ b/controllers/remote/cluster_cache_healthcheck_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/remote/cluster_cache_reconciler.go b/controllers/remote/cluster_cache_reconciler.go index a665bab39336..c1138d7c3684 100644 --- a/controllers/remote/cluster_cache_reconciler.go +++ b/controllers/remote/cluster_cache_reconciler.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/remote/cluster_cache_reconciler_test.go b/controllers/remote/cluster_cache_reconciler_test.go index cc0ddb3fa1b8..df1028fa55c1 100644 --- a/controllers/remote/cluster_cache_reconciler_test.go +++ b/controllers/remote/cluster_cache_reconciler_test.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" diff --git a/controllers/remote/cluster_cache_tracker_test.go b/controllers/remote/cluster_cache_tracker_test.go index 8eb2c302f86a..5507106a6d35 100644 --- a/controllers/remote/cluster_cache_tracker_test.go +++ b/controllers/remote/cluster_cache_tracker_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/remote/index.go b/controllers/remote/index.go index 7ed25a431e65..e7a13442cdc7 100644 --- a/controllers/remote/index.go +++ b/controllers/remote/index.go @@ -18,7 +18,7 @@ package remote import ( corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/schema_test.go b/controllers/schema_test.go index ac6bcec533ee..e9f244fa8331 100644 --- a/controllers/schema_test.go +++ b/controllers/schema_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d5db30f5c335..a501eec06fdd 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -31,8 +31,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/suite_util_test.go b/controllers/suite_util_test.go index 62247f571be4..96e3756bd524 100644 --- a/controllers/suite_util_test.go +++ b/controllers/suite_util_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func intOrStrPtr(i int32) *intstr.IntOrString { diff --git a/controllers/topology/blueprint.go b/controllers/topology/blueprint.go index a2ce9ee3f5bf..181de1e2ede4 100644 --- a/controllers/topology/blueprint.go +++ b/controllers/topology/blueprint.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/topology/blueprint_test.go b/controllers/topology/blueprint_test.go index a55d612f6f0b..cfd5684a5672 100644 --- a/controllers/topology/blueprint_test.go +++ b/controllers/topology/blueprint_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/topology/cluster_controller.go b/controllers/topology/cluster_controller.go index 5fffab34850e..5adf418e06f1 100644 --- a/controllers/topology/cluster_controller.go +++ b/controllers/topology/cluster_controller.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/topology/current_state.go b/controllers/topology/current_state.go index 2e217f0e0768..2e1c7204b4b2 100644 --- a/controllers/topology/current_state.go +++ b/controllers/topology/current_state.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" diff --git a/controllers/topology/current_state_test.go b/controllers/topology/current_state_test.go index 85e963f6d6a4..e56cefb7e448 100644 --- a/controllers/topology/current_state_test.go +++ b/controllers/topology/current_state_test.go @@ -26,7 +26,7 @@ import ( "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/desired_state.go b/controllers/topology/desired_state.go index 7b2f7d6d8e84..ef7d7ba10a0b 100644 --- a/controllers/topology/desired_state.go +++ b/controllers/topology/desired_state.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apiserver/pkg/storage/names" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" diff --git a/controllers/topology/desired_state_test.go b/controllers/topology/desired_state_test.go index d0c4862ac710..53363670c2a2 100644 --- a/controllers/topology/desired_state_test.go +++ b/controllers/topology/desired_state_test.go @@ -28,7 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" ) diff --git a/controllers/topology/internal/check/compatibility_test.go b/controllers/topology/internal/check/compatibility_test.go index fecc4d36a3ce..d557dab2ee2d 100644 --- a/controllers/topology/internal/check/compatibility_test.go +++ b/controllers/topology/internal/check/compatibility_test.go @@ -35,12 +35,12 @@ var referencedObjectsCompatibilityTestCases = []referencedObjectsCompatibilityTe name: "Fails if group changes", current: &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "foo/v1alpha4", + "apiVersion": "foo/v1beta1", }, }, desired: &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "bar/v1alpha4", + "apiVersion": "bar/v1beta1", }, }, wantErr: true, diff --git a/controllers/topology/internal/contract/controlplane_test.go b/controllers/topology/internal/contract/controlplane_test.go index 806d3fc1f00e..dfd149223448 100644 --- a/controllers/topology/internal/contract/controlplane_test.go +++ b/controllers/topology/internal/contract/controlplane_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestControlPlane(t *testing.T) { diff --git a/controllers/topology/internal/contract/metadata.go b/controllers/topology/internal/contract/metadata.go index 3d09e574b32f..eed2c9915912 100644 --- a/controllers/topology/internal/contract/metadata.go +++ b/controllers/topology/internal/contract/metadata.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Metadata provides a helper struct for working with Metadata. diff --git a/controllers/topology/internal/log/log.go b/controllers/topology/internal/log/log.go index fae4b537ba71..b655084e2d13 100644 --- a/controllers/topology/internal/log/log.go +++ b/controllers/topology/internal/log/log.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/topology/internal/scope/blueprint.go b/controllers/topology/internal/scope/blueprint.go index 3a3f73855532..8f9a8b3bf638 100644 --- a/controllers/topology/internal/scope/blueprint.go +++ b/controllers/topology/internal/scope/blueprint.go @@ -18,7 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // ClusterBlueprint holds all the objects required for computing the desired state of a managed Cluster topology, diff --git a/controllers/topology/internal/scope/scope.go b/controllers/topology/internal/scope/scope.go index 6778dd6beaae..0ce1d27f19c3 100644 --- a/controllers/topology/internal/scope/scope.go +++ b/controllers/topology/internal/scope/scope.go @@ -17,7 +17,7 @@ limitations under the License. package scope import ( - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Scope holds all the information to process a request in the topology/ClusterReconciler controller. diff --git a/controllers/topology/internal/scope/state.go b/controllers/topology/internal/scope/state.go index 123b9539a6e8..da9d72b4962e 100644 --- a/controllers/topology/internal/scope/state.go +++ b/controllers/topology/internal/scope/state.go @@ -18,7 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" ) diff --git a/controllers/topology/machinedeployment_controller.go b/controllers/topology/machinedeployment_controller.go index 6b65c7f5c26d..62854d5d06ed 100644 --- a/controllers/topology/machinedeployment_controller.go +++ b/controllers/topology/machinedeployment_controller.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/topology/machinedeployment_controller_test.go b/controllers/topology/machinedeployment_controller_test.go index 3fb591aed469..d427d7770467 100644 --- a/controllers/topology/machinedeployment_controller_test.go +++ b/controllers/topology/machinedeployment_controller_test.go @@ -24,7 +24,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/machineset_controller.go b/controllers/topology/machineset_controller.go index f289f1cfd7a6..e1afd6eeda5a 100644 --- a/controllers/topology/machineset_controller.go +++ b/controllers/topology/machineset_controller.go @@ -23,7 +23,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/topology/machineset_controller_test.go b/controllers/topology/machineset_controller_test.go index 6336166638ce..3c2ebff83298 100644 --- a/controllers/topology/machineset_controller_test.go +++ b/controllers/topology/machineset_controller_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/reconcile_state_test.go b/controllers/topology/reconcile_state_test.go index dd99817414e2..32691a188f25 100644 --- a/controllers/topology/reconcile_state_test.go +++ b/controllers/topology/reconcile_state_test.go @@ -27,7 +27,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/topology/suite_test.go b/controllers/topology/suite_test.go index 076969d78653..fa1955e59b77 100644 --- a/controllers/topology/suite_test.go +++ b/controllers/topology/suite_test.go @@ -22,7 +22,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/topology/util.go b/controllers/topology/util.go index 18a18c5b9408..3e76bbb12585 100644 --- a/controllers/topology/util.go +++ b/controllers/topology/util.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" utilconversion "sigs.k8s.io/cluster-api/util/conversion" diff --git a/controllers/topology/util_test.go b/controllers/topology/util_test.go index de8baa0d9cce..e64113a83f27 100644 --- a/controllers/topology/util_test.go +++ b/controllers/topology/util_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "github.com/google/go-cmp/cmp" @@ -36,7 +36,7 @@ import ( func TestGetReference(t *testing.T) { fakeControlPlaneTemplateCRDv99 := testtypes.GenericControlPlaneTemplateCRD.DeepCopy() fakeControlPlaneTemplateCRDv99.Labels = map[string]string{ - "cluster.x-k8s.io/v1alpha4": "v1alpha4_v99", + "cluster.x-k8s.io/v1beta1": "v1beta1_v99", } crds := []client.Object{ fakeControlPlaneTemplateCRDv99, diff --git a/internal/envtest/environment.go b/internal/envtest/environment.go index 7a533c49ea40..ebef9b9bc701 100644 --- a/internal/envtest/environment.go +++ b/internal/envtest/environment.go @@ -43,12 +43,12 @@ import ( "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - addonv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" + addonv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util/kubeconfig" ctrl "sigs.k8s.io/controller-runtime" diff --git a/internal/testtypes/bootstrap.go b/internal/testtypes/bootstrap.go index 9a14e91eb1c7..4e52e933b78e 100644 --- a/internal/testtypes/bootstrap.go +++ b/internal/testtypes/bootstrap.go @@ -22,7 +22,7 @@ import ( var ( // BootstrapGroupVersion is group version used for bootstrap objects. - BootstrapGroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1alpha4"} + BootstrapGroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"} // GenericBootstrapConfigKind is the Kind for the GenericBootstrapConfig. GenericBootstrapConfigKind = "GenericBootstrapConfig" diff --git a/internal/testtypes/builders.go b/internal/testtypes/builders.go index 6069f5316a90..d6c4018e8fed 100644 --- a/internal/testtypes/builders.go +++ b/internal/testtypes/builders.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/internal/testtypes/controlplane.go b/internal/testtypes/controlplane.go index 1e2375342dfc..e6a4cde660d9 100644 --- a/internal/testtypes/controlplane.go +++ b/internal/testtypes/controlplane.go @@ -22,7 +22,7 @@ import ( var ( // ControlPlaneGroupVersion is group version used for control plane objects. - ControlPlaneGroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1alpha4"} + ControlPlaneGroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"} // GenericControlPlaneKind is the Kind for the GenericControlPlane. GenericControlPlaneKind = "GenericControlPlane" diff --git a/internal/testtypes/crds.go b/internal/testtypes/crds.go index f9e6e2c5415b..830e48d524c2 100644 --- a/internal/testtypes/crds.go +++ b/internal/testtypes/crds.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func generateCRD(gvk schema.GroupVersionKind) *apiextensionsv1.CustomResourceDefinition { @@ -37,7 +37,7 @@ func generateCRD(gvk schema.GroupVersionKind) *apiextensionsv1.CustomResourceDef ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("%s.%s", flect.Pluralize(strings.ToLower(gvk.Kind)), gvk.Group), Labels: map[string]string{ - clusterv1.GroupVersion.String(): "v1alpha4", + clusterv1.GroupVersion.String(): "v1beta1", }, }, Spec: apiextensionsv1.CustomResourceDefinitionSpec{ diff --git a/internal/testtypes/infrastructure.go b/internal/testtypes/infrastructure.go index ced3f6e0bc7f..c7a8bc1cba79 100644 --- a/internal/testtypes/infrastructure.go +++ b/internal/testtypes/infrastructure.go @@ -22,7 +22,7 @@ import ( var ( // InfrastructureGroupVersion is group version used for infrastructure objects. - InfrastructureGroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} + InfrastructureGroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} // GenericInfrastructureMachineKind is the Kind for the GenericInfrastructureMachine. GenericInfrastructureMachineKind = "GenericInfrastructureMachine" diff --git a/internal/testtypes/remediation.go b/internal/testtypes/remediation.go index ddf32fff8509..c19ea4b87972 100644 --- a/internal/testtypes/remediation.go +++ b/internal/testtypes/remediation.go @@ -22,7 +22,7 @@ import ( var ( // RemediationGroupVersion is group version used for remediation objects. - RemediationGroupVersion = schema.GroupVersion{Group: "remediation.external.io", Version: "v1alpha4"} + RemediationGroupVersion = schema.GroupVersion{Group: "remediation.external.io", Version: "v1beta1"} // GenericRemediationCRD is a generic infrastructure remediation CRD. GenericRemediationCRD = generateCRD(RemediationGroupVersion.WithKind("GenericExternalRemediation")) diff --git a/main.go b/main.go index c7d3abc0ee88..67399fe45ad6 100644 --- a/main.go +++ b/main.go @@ -33,17 +33,20 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/controllers/topology" - addonsv1old "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1alpha3 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3" + addonsv1alpha4 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" addonscontrollers "sigs.k8s.io/cluster-api/exp/addons/controllers" - expv1old "sigs.k8s.io/cluster-api/exp/api/v1alpha3" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1alpha3 "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + expv1alpha4 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" expcontrollers "sigs.k8s.io/cluster-api/exp/controllers" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" @@ -84,13 +87,20 @@ func init() { klog.InitFlags(nil) _ = clientgoscheme.AddToScheme(scheme) - _ = clusterv1old.AddToScheme(scheme) + _ = apiextensionsv1.AddToScheme(scheme) + + _ = clusterv1alpha3.AddToScheme(scheme) + _ = clusterv1alpha4.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) - _ = expv1old.AddToScheme(scheme) + + _ = expv1alpha3.AddToScheme(scheme) + _ = expv1alpha4.AddToScheme(scheme) _ = expv1.AddToScheme(scheme) - _ = addonsv1old.AddToScheme(scheme) + + _ = addonsv1alpha3.AddToScheme(scheme) + _ = addonsv1alpha4.AddToScheme(scheme) _ = addonsv1.AddToScheme(scheme) - _ = apiextensionsv1.AddToScheme(scheme) + // +kubebuilder:scaffold:scheme } diff --git a/test/e2e/clusterctl_upgrade.go b/test/e2e/clusterctl_upgrade.go index 90140dbbf7e2..0c7b31381e63 100644 --- a/test/e2e/clusterctl_upgrade.go +++ b/test/e2e/clusterctl_upgrade.go @@ -35,7 +35,7 @@ import ( "k8s.io/client-go/discovery" "k8s.io/utils/pointer" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/test/e2e/internal/log" "sigs.k8s.io/cluster-api/test/framework" diff --git a/test/e2e/common.go b/test/e2e/common.go index 3dfa7b7b9e9d..ca37c6d8ad1c 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -26,7 +26,7 @@ import ( "github.com/onsi/gomega/types" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/util" ) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index f4981d45a7d4..f955760723d2 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -32,7 +32,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/bootstrap" "sigs.k8s.io/cluster-api/test/framework/clusterctl" diff --git a/test/e2e/kcp_adoption.go b/test/e2e/kcp_adoption.go index ac45f871849a..c734cd562e9d 100644 --- a/test/e2e/kcp_adoption.go +++ b/test/e2e/kcp_adoption.go @@ -26,14 +26,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" diff --git a/test/e2e/node_drain_timeout.go b/test/e2e/node_drain_timeout.go index bfd83f79ed76..4ff0a35e96c8 100644 --- a/test/e2e/node_drain_timeout.go +++ b/test/e2e/node_drain_timeout.go @@ -29,9 +29,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" diff --git a/test/e2e/self_hosted.go b/test/e2e/self_hosted.go index 8f728c077684..f6f527d621dc 100644 --- a/test/e2e/self_hosted.go +++ b/test/e2e/self_hosted.go @@ -28,7 +28,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/e2e/internal/log" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/bootstrap" diff --git a/test/framework/alltypes_helpers.go b/test/framework/alltypes_helpers.go index c62c2c74e12e..4f38d18f6216 100644 --- a/test/framework/alltypes_helpers.go +++ b/test/framework/alltypes_helpers.go @@ -33,7 +33,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) diff --git a/test/framework/bootstrap/kind_provider.go b/test/framework/bootstrap/kind_provider.go index e63a7254b2e4..ea096b16077e 100644 --- a/test/framework/bootstrap/kind_provider.go +++ b/test/framework/bootstrap/kind_provider.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" kindv1 "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" kind "sigs.k8s.io/kind/pkg/cluster" diff --git a/test/framework/cluster_helpers.go b/test/framework/cluster_helpers.go index 11055f5f0568..c3b8204fd06d 100644 --- a/test/framework/cluster_helpers.go +++ b/test/framework/cluster_helpers.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/framework/cluster_proxy.go b/test/framework/cluster_proxy.go index 56ba44e0f1f2..efc6379517ba 100644 --- a/test/framework/cluster_proxy.go +++ b/test/framework/cluster_proxy.go @@ -32,8 +32,8 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/exec" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/test/infrastructure/container" diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index 3b5413f63b9e..f016172ec7c0 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -23,10 +23,10 @@ import ( . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/internal/log" ) diff --git a/test/framework/clusterresourceset_helpers.go b/test/framework/clusterresourceset_helpers.go index 4c4068192710..510aebe608e0 100644 --- a/test/framework/clusterresourceset_helpers.go +++ b/test/framework/clusterresourceset_helpers.go @@ -25,8 +25,8 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/control_plane.go b/test/framework/control_plane.go index 406172d0bc9a..9386935d0d06 100644 --- a/test/framework/control_plane.go +++ b/test/framework/control_plane.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/controlplane_helpers.go b/test/framework/controlplane_helpers.go index 1f1040ba61cb..83362ef8372a 100644 --- a/test/framework/controlplane_helpers.go +++ b/test/framework/controlplane_helpers.go @@ -25,9 +25,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/framework/convenience.go b/test/framework/convenience.go index a46b62cca8a0..b59e36bda3cb 100644 --- a/test/framework/convenience.go +++ b/test/framework/convenience.go @@ -26,11 +26,11 @@ import ( apiextensionsv1beta "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/runtime" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) // TryAddDefaultSchemes tries to add the following schemes: @@ -47,10 +47,10 @@ func TryAddDefaultSchemes(scheme *runtime.Scheme) { // Add the apps schemes. _ = appsv1.AddToScheme(scheme) - // Add the core CAPI v1alpha4 scheme. + // Add the core CAPI scheme. _ = clusterv1.AddToScheme(scheme) - // Add the CAPI v1alpha4 experiments scheme. + // Add the CAPI experiments scheme. _ = expv1.AddToScheme(scheme) _ = addonsv1.AddToScheme(scheme) diff --git a/test/framework/deployment_helpers.go b/test/framework/deployment_helpers.go index d36d4a63942f..2652e56d10c9 100644 --- a/test/framework/deployment_helpers.go +++ b/test/framework/deployment_helpers.go @@ -38,7 +38,7 @@ import ( "k8s.io/api/policy/v1beta1" "k8s.io/utils/pointer" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/docker_logcollector.go b/test/framework/docker_logcollector.go index d69a157d59ff..baff13711d92 100644 --- a/test/framework/docker_logcollector.go +++ b/test/framework/docker_logcollector.go @@ -25,8 +25,8 @@ import ( "strings" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/kind/pkg/errors" diff --git a/test/framework/machine_helpers.go b/test/framework/machine_helpers.go index d75ce67ac0bd..8710943348fc 100644 --- a/test/framework/machine_helpers.go +++ b/test/framework/machine_helpers.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/test/framework/machinedeployment_helpers.go b/test/framework/machinedeployment_helpers.go index 5630d2f6f37b..78dbe04725f1 100644 --- a/test/framework/machinedeployment_helpers.go +++ b/test/framework/machinedeployment_helpers.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" diff --git a/test/framework/machinehealthcheck_helpers.go b/test/framework/machinehealthcheck_helpers.go index 3b168711e714..7403924f2f6f 100644 --- a/test/framework/machinehealthcheck_helpers.go +++ b/test/framework/machinehealthcheck_helpers.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/machinepool_helpers.go b/test/framework/machinepool_helpers.go index 6cc22851ea74..9586389050e5 100644 --- a/test/framework/machinepool_helpers.go +++ b/test/framework/machinepool_helpers.go @@ -27,8 +27,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/machines.go b/test/framework/machines.go index 8478f0b17424..f1179f9cec3b 100644 --- a/test/framework/machines.go +++ b/test/framework/machines.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/infrastructure/container/docker.go b/test/infrastructure/container/docker.go index 3b632b69eca3..9c1e1257f077 100644 --- a/test/infrastructure/container/docker.go +++ b/test/infrastructure/container/docker.go @@ -35,7 +35,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/docker/go-connections/nat" "github.com/pkg/errors" - "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( @@ -392,7 +392,7 @@ func (d *docker) RunContainer(ctx context.Context, runConfig *RunContainerInput, } networkConfig := network.NetworkingConfig{} - if runConfig.IPFamily == v1alpha4.IPv6IPFamily { + if runConfig.IPFamily == clusterv1.IPv6IPFamily { hostConfig.Sysctls = map[string]string{ "net.ipv6.conf.all.disable_ipv6": "0", "net.ipv6.conf.all.forwarding": "1", diff --git a/test/infrastructure/container/interface.go b/test/infrastructure/container/interface.go index 8a9ba19b539a..c585355c7891 100644 --- a/test/infrastructure/container/interface.go +++ b/test/infrastructure/container/interface.go @@ -20,7 +20,7 @@ import ( "context" "io" - "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Runtime defines the interface for interacting with a container runtime. @@ -88,7 +88,7 @@ type RunContainerInput struct { // PortMappings contains host<>container ports to map. PortMappings []PortMapping // IPFamily is the IP version to use. - IPFamily v1alpha4.ClusterIPFamily + IPFamily clusterv1.ClusterIPFamily } // ExecContainerInput contains values for running exec on a container. diff --git a/test/infrastructure/docker/controllers/dockercluster_controller.go b/test/infrastructure/docker/controllers/dockercluster_controller.go index c9e8662cea2c..03e7bdfddc7b 100644 --- a/test/infrastructure/docker/controllers/dockercluster_controller.go +++ b/test/infrastructure/docker/controllers/dockercluster_controller.go @@ -25,8 +25,8 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/test/infrastructure/docker/controllers/dockermachine_controller.go b/test/infrastructure/docker/controllers/dockermachine_controller.go index bb50bcdcc1a2..466d41ccf969 100644 --- a/test/infrastructure/docker/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/controllers/dockermachine_controller.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/test/infrastructure/docker/controllers/dockermachine_controller_test.go b/test/infrastructure/docker/controllers/dockermachine_controller_test.go index b36c14b207d1..572dc00ecec0 100644 --- a/test/infrastructure/docker/controllers/dockermachine_controller_test.go +++ b/test/infrastructure/docker/controllers/dockermachine_controller_test.go @@ -23,8 +23,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/test/infrastructure/docker/controllers/suite_test.go b/test/infrastructure/docker/controllers/suite_test.go index 085bbe7379e4..505dd2d9a390 100644 --- a/test/infrastructure/docker/controllers/suite_test.go +++ b/test/infrastructure/docker/controllers/suite_test.go @@ -19,8 +19,8 @@ package controllers import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ) func init() { diff --git a/test/infrastructure/docker/docker/kind_manager.go b/test/infrastructure/docker/docker/kind_manager.go index 32852a97640e..409d0b1c0948 100644 --- a/test/infrastructure/docker/docker/kind_manager.go +++ b/test/infrastructure/docker/docker/kind_manager.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/test/infrastructure/docker/docker/loadbalancer.go b/test/infrastructure/docker/docker/loadbalancer.go index 362891f35e9d..b866118d694a 100644 --- a/test/infrastructure/docker/docker/loadbalancer.go +++ b/test/infrastructure/docker/docker/loadbalancer.go @@ -22,9 +22,9 @@ import ( "net" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" - "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker/types" "sigs.k8s.io/cluster-api/test/infrastructure/docker/third_party/forked/loadbalancer" ctrl "sigs.k8s.io/controller-runtime" @@ -45,7 +45,7 @@ type LoadBalancer struct { } // NewLoadBalancer returns a new helper for managing a docker loadbalancer with a given name. -func NewLoadBalancer(cluster *clusterv1.Cluster, dockerCluster *v1alpha4.DockerCluster) (*LoadBalancer, error) { +func NewLoadBalancer(cluster *clusterv1.Cluster, dockerCluster *v1beta1.DockerCluster) (*LoadBalancer, error) { if cluster.Name == "" { return nil, errors.New("create load balancer: cluster name is empty") } @@ -80,7 +80,7 @@ func NewLoadBalancer(cluster *clusterv1.Cluster, dockerCluster *v1alpha4.DockerC // getLoadBalancerImage will return the image (e.g. "kindest/haproxy:2.1.1-alpine") to use for // the load balancer. -func getLoadBalancerImage(dockerCluster *v1alpha4.DockerCluster) string { +func getLoadBalancerImage(dockerCluster *v1beta1.DockerCluster) string { // Check if a non-default image was provided image := loadbalancer.Image imageRepo := loadbalancer.DefaultImageRepository diff --git a/test/infrastructure/docker/docker/machine.go b/test/infrastructure/docker/docker/machine.go index e318d7c3653b..9189fc1ce0bc 100644 --- a/test/infrastructure/docker/docker/machine.go +++ b/test/infrastructure/docker/docker/machine.go @@ -33,9 +33,9 @@ import ( "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" "sigs.k8s.io/kind/pkg/cluster/constants" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/cloudinit" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker/types" clusterapicontainer "sigs.k8s.io/cluster-api/util/container" diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go index 70c3fca010bc..214b92def712 100644 --- a/test/infrastructure/docker/main.go +++ b/test/infrastructure/docker/main.go @@ -31,18 +31,20 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller" - infrav1old "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3" - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + infrav1alpha3 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3" + infrav1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/controllers" - infraexpv1old "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha3" - infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4" + infraexpv1alpha3 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha3" + infraexpv1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4" + infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" expcontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/controllers" // +kubebuilder:scaffold:imports ) @@ -65,9 +67,11 @@ func init() { klog.InitFlags(nil) _ = scheme.AddToScheme(myscheme) - _ = infrav1old.AddToScheme(myscheme) + _ = infrav1alpha3.AddToScheme(myscheme) + _ = infrav1alpha4.AddToScheme(myscheme) _ = infrav1.AddToScheme(myscheme) - _ = infraexpv1old.AddToScheme(myscheme) + _ = infraexpv1alpha3.AddToScheme(myscheme) + _ = infraexpv1alpha4.AddToScheme(myscheme) _ = infraexpv1.AddToScheme(myscheme) _ = clusterv1.AddToScheme(myscheme) _ = expv1.AddToScheme(myscheme) diff --git a/util/annotations/helpers.go b/util/annotations/helpers.go index 286d5187f8fa..c5405eb1fafd 100644 --- a/util/annotations/helpers.go +++ b/util/annotations/helpers.go @@ -21,7 +21,7 @@ import ( "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // IsPaused returns true if the Cluster is paused or the object has the `paused` annotation. diff --git a/util/collections/helpers.go b/util/collections/helpers.go index 1d989e795065..be059c6e0be4 100644 --- a/util/collections/helpers.go +++ b/util/collections/helpers.go @@ -21,7 +21,7 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/collections/machine_collection.go b/util/collections/machine_collection.go index eb3b9844a921..8265889eea3b 100644 --- a/util/collections/machine_collection.go +++ b/util/collections/machine_collection.go @@ -31,7 +31,7 @@ import ( "sort" "github.com/blang/semver" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/version" diff --git a/util/collections/machine_collection_test.go b/util/collections/machine_collection_test.go index e01355b4a265..4fae8bbe6f1b 100644 --- a/util/collections/machine_collection_test.go +++ b/util/collections/machine_collection_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/collections/machine_filters.go b/util/collections/machine_filters.go index 374629fa814a..53b5b4161936 100644 --- a/util/collections/machine_filters.go +++ b/util/collections/machine_filters.go @@ -21,8 +21,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/util/collections/machine_filters_test.go b/util/collections/machine_filters_test.go index d05f427e3460..c0893c8a1540 100644 --- a/util/collections/machine_filters_test.go +++ b/util/collections/machine_filters_test.go @@ -28,8 +28,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ) func falseFilter(_ *clusterv1.Machine) bool { diff --git a/util/conditions/getter.go b/util/conditions/getter.go index 92a1a67a7a77..379e1ecb68a1 100644 --- a/util/conditions/getter.go +++ b/util/conditions/getter.go @@ -19,7 +19,7 @@ package conditions import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/conditions/getter_test.go b/util/conditions/getter_test.go index 9aef2a8c37e2..88b961b1e418 100644 --- a/util/conditions/getter_test.go +++ b/util/conditions/getter_test.go @@ -20,7 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/util/conditions/matcher.go b/util/conditions/matcher.go index d9415b8fe4ff..dc5757dece40 100644 --- a/util/conditions/matcher.go +++ b/util/conditions/matcher.go @@ -21,7 +21,7 @@ import ( "github.com/onsi/gomega" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // MatchConditions returns a custom matcher to check equality of clusterv1.Conditions. diff --git a/util/conditions/matcher_test.go b/util/conditions/matcher_test.go index 3703fcb4f05a..0b9ca1b81e05 100644 --- a/util/conditions/matcher_test.go +++ b/util/conditions/matcher_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestMatchConditions(t *testing.T) { diff --git a/util/conditions/matchers.go b/util/conditions/matchers.go index e49ebced6486..a2fd651744ef 100644 --- a/util/conditions/matchers.go +++ b/util/conditions/matchers.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // HaveSameStateOf matches a condition to have the same state of another. diff --git a/util/conditions/merge.go b/util/conditions/merge.go index a5650d891cdc..54c1ec3d2eed 100644 --- a/util/conditions/merge.go +++ b/util/conditions/merge.go @@ -20,7 +20,7 @@ import ( "sort" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // localizedCondition defines a condition with the information of the object the conditions diff --git a/util/conditions/merge_strategies.go b/util/conditions/merge_strategies.go index 87bda830fcd0..6e582bf10d0e 100644 --- a/util/conditions/merge_strategies.go +++ b/util/conditions/merge_strategies.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // mergeOptions allows to set strategies for merging a set of conditions into a single condition, diff --git a/util/conditions/merge_strategies_test.go b/util/conditions/merge_strategies_test.go index cddc13572b12..0fa6170f4583 100644 --- a/util/conditions/merge_strategies_test.go +++ b/util/conditions/merge_strategies_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestGetStepCounterMessage(t *testing.T) { diff --git a/util/conditions/merge_test.go b/util/conditions/merge_test.go index 67504db2c7e6..2cd91370d4fe 100644 --- a/util/conditions/merge_test.go +++ b/util/conditions/merge_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewConditionsGroup(t *testing.T) { diff --git a/util/conditions/patch.go b/util/conditions/patch.go index d9bdd386204b..51af0b398c5f 100644 --- a/util/conditions/patch.go +++ b/util/conditions/patch.go @@ -21,7 +21,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Patch defines a list of operations to change a list of conditions into another. diff --git a/util/conditions/patch_test.go b/util/conditions/patch_test.go index 4d87b92a5709..137c94441909 100644 --- a/util/conditions/patch_test.go +++ b/util/conditions/patch_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewPatch(t *testing.T) { diff --git a/util/conditions/setter.go b/util/conditions/setter.go index 207ce55b2b9c..415013739299 100644 --- a/util/conditions/setter.go +++ b/util/conditions/setter.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Setter interface defines methods that a Cluster API object should implement in order to diff --git a/util/conditions/setter_test.go b/util/conditions/setter_test.go index d9dcc10d593a..470ae4f8d98c 100644 --- a/util/conditions/setter_test.go +++ b/util/conditions/setter_test.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestHasSameState(t *testing.T) { diff --git a/util/conditions/suite_test.go b/util/conditions/suite_test.go index bb2ad0cb5b35..9fa7fb7a8093 100644 --- a/util/conditions/suite_test.go +++ b/util/conditions/suite_test.go @@ -19,7 +19,7 @@ package conditions import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func init() { diff --git a/util/conditions/unstructured.go b/util/conditions/unstructured.go index dfd50d50f201..00ec7ac3587f 100644 --- a/util/conditions/unstructured.go +++ b/util/conditions/unstructured.go @@ -19,7 +19,7 @@ package conditions import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/log" ) diff --git a/util/conditions/unstructured_test.go b/util/conditions/unstructured_test.go index 618022cf1240..c628ae8065db 100644 --- a/util/conditions/unstructured_test.go +++ b/util/conditions/unstructured_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestUnstructuredGetConditions(t *testing.T) { diff --git a/util/conversion/conversion.go b/util/conversion/conversion.go index 49a4d6bf6253..2e1949260ddf 100644 --- a/util/conversion/conversion.go +++ b/util/conversion/conversion.go @@ -39,7 +39,7 @@ import ( "k8s.io/apimachinery/pkg/util/json" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/util/conversion/conversion_test.go b/util/conversion/conversion_test.go index 23f4bf074278..6762cafcfb2a 100644 --- a/util/conversion/conversion_test.go +++ b/util/conversion/conversion_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/util/deprecated.go b/util/deprecated.go index f422189efb4c..dbd82ba9c0f0 100644 --- a/util/deprecated.go +++ b/util/deprecated.go @@ -21,7 +21,7 @@ import ( "context" "github.com/blang/semver" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/version" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/failuredomains/failure_domains.go b/util/failuredomains/failure_domains.go index d373298e0970..005d2f36a477 100644 --- a/util/failuredomains/failure_domains.go +++ b/util/failuredomains/failure_domains.go @@ -23,7 +23,7 @@ import ( "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/failuredomains/failure_domains_test.go b/util/failuredomains/failure_domains_test.go index d6b358d8fcca..40eb4015132f 100644 --- a/util/failuredomains/failure_domains_test.go +++ b/util/failuredomains/failure_domains_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewFailureDomainPicker(t *testing.T) { diff --git a/util/kubeconfig/kubeconfig.go b/util/kubeconfig/kubeconfig.go index 4b4b91f4c546..283c2817d737 100644 --- a/util/kubeconfig/kubeconfig.go +++ b/util/kubeconfig/kubeconfig.go @@ -30,7 +30,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/secret" diff --git a/util/kubeconfig/kubeconfig_test.go b/util/kubeconfig/kubeconfig_test.go index 92063c74bd4f..980eb2641626 100644 --- a/util/kubeconfig/kubeconfig_test.go +++ b/util/kubeconfig/kubeconfig_test.go @@ -31,7 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/secret" diff --git a/util/kubeconfig/testing.go b/util/kubeconfig/testing.go index c7e50ee365ee..51da00ad1c94 100644 --- a/util/kubeconfig/testing.go +++ b/util/kubeconfig/testing.go @@ -22,7 +22,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // FromEnvTestConfig returns a new Kubeconfig in byte form when running in envtest. diff --git a/util/labels/helpers.go b/util/labels/helpers.go index 6de98c118929..673ccd1cf5d4 100644 --- a/util/labels/helpers.go +++ b/util/labels/helpers.go @@ -19,7 +19,7 @@ package labels import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // IsTopologyOwned returns true if the object has the `topology.cluster.x-k8s.io/owned` label. diff --git a/util/labels/helpers_test.go b/util/labels/helpers_test.go index c747bc9bd22b..329f8d57f6eb 100644 --- a/util/labels/helpers_test.go +++ b/util/labels/helpers_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestHasWatchLabel(t *testing.T) { diff --git a/util/patch/options.go b/util/patch/options.go index 1b4defaf2d13..9c2adffbdce3 100644 --- a/util/patch/options.go +++ b/util/patch/options.go @@ -16,7 +16,7 @@ limitations under the License. package patch -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Option is some configuration that modifies options for a patch request. type Option interface { diff --git a/util/patch/patch.go b/util/patch/patch.go index 9423a9e0da56..48f2efecc95f 100644 --- a/util/patch/patch.go +++ b/util/patch/patch.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/wait" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" diff --git a/util/patch/patch_test.go b/util/patch/patch_test.go index fcf82404504b..8d70cab5b046 100644 --- a/util/patch/patch_test.go +++ b/util/patch/patch_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" @@ -50,7 +50,7 @@ func TestPatchHelper(t *testing.T) { obj := &unstructured.Unstructured{ Object: map[string]interface{}{ "kind": "GenericBootstrapConfig", - "apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha4", + "apiVersion": "bootstrap.cluster.x-k8s.io/v1beta1", "metadata": map[string]interface{}{ "generateName": "test-bootstrap-", "namespace": ns.Name, @@ -86,7 +86,7 @@ func TestPatchHelper(t *testing.T) { t.Log("Modifying the OwnerReferences") refs := []metav1.OwnerReference{ { - APIVersion: "cluster.x-k8s.io/v1alpha4", + APIVersion: "cluster.x-k8s.io/v1beta1", Kind: "Cluster", Name: "test", UID: types.UID("fake-uid"), diff --git a/util/patch/utils_test.go b/util/patch/utils_test.go index f297112c2e26..9f4746475afc 100644 --- a/util/patch/utils_test.go +++ b/util/patch/utils_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestToUnstructured(t *testing.T) { diff --git a/util/predicates/cluster_predicates.go b/util/predicates/cluster_predicates.go index 71cb0bb5b5a1..9bf91d4c53cc 100644 --- a/util/predicates/cluster_predicates.go +++ b/util/predicates/cluster_predicates.go @@ -19,7 +19,7 @@ package predicates import ( "github.com/go-logr/logr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" ) diff --git a/util/secret/certificates.go b/util/secret/certificates.go index 5085f5fe0c36..178023e9e9bb 100644 --- a/util/secret/certificates.go +++ b/util/secret/certificates.go @@ -34,8 +34,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/cert" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/secret/certificates_test.go b/util/secret/certificates_test.go index e5ca3f6b3f6b..e6c48c252ba2 100644 --- a/util/secret/certificates_test.go +++ b/util/secret/certificates_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util/secret" ) diff --git a/util/suite_test.go b/util/suite_test.go index 21ef3db697e8..86dca5158185 100644 --- a/util/suite_test.go +++ b/util/suite_test.go @@ -19,7 +19,7 @@ package util import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/util/util.go b/util/util.go index a4d9de37794f..11635f4f6239 100644 --- a/util/util.go +++ b/util/util.go @@ -38,7 +38,7 @@ import ( k8sversion "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/metadata" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" diff --git a/util/util_test.go b/util/util_test.go index 6d2a39f90df5..5dc6df949fc1 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -58,7 +58,7 @@ func TestMachineToInfrastructureMapFunc(t *testing.T) { }, Spec: clusterv1.MachineSpec{ InfrastructureRef: corev1.ObjectReference{ - APIVersion: "foo.cluster.x-k8s.io/v1alpha4", + APIVersion: "foo.cluster.x-k8s.io/v1beta1", Kind: "TestMachine", Name: "infra-1", }, @@ -77,7 +77,7 @@ func TestMachineToInfrastructureMapFunc(t *testing.T) { name: "should return no matching reconcile requests", input: schema.GroupVersionKind{ Group: "foo.cluster.x-k8s.io", - Version: "v1alpha4", + Version: "v1beta1", Kind: "TestMachine", }, request: &clusterv1.Machine{ @@ -87,7 +87,7 @@ func TestMachineToInfrastructureMapFunc(t *testing.T) { }, Spec: clusterv1.MachineSpec{ InfrastructureRef: corev1.ObjectReference{ - APIVersion: "bar.cluster.x-k8s.io/v1alpha4", + APIVersion: "bar.cluster.x-k8s.io/v1beta1", Kind: "TestMachine", Name: "bar-1", }, @@ -129,7 +129,7 @@ func TestClusterToInfrastructureMapFunc(t *testing.T) { }, Spec: clusterv1.ClusterSpec{ InfrastructureRef: &corev1.ObjectReference{ - APIVersion: "foo.cluster.x-k8s.io/v1alpha4", + APIVersion: "foo.cluster.x-k8s.io/v1beta1", Kind: "TestCluster", Name: "infra-1", }, @@ -148,7 +148,7 @@ func TestClusterToInfrastructureMapFunc(t *testing.T) { name: "should return no matching reconcile requests", input: schema.GroupVersionKind{ Group: "foo.cluster.x-k8s.io", - Version: "v1alpha4", + Version: "v1beta1", Kind: "TestCluster", }, request: &clusterv1.Cluster{ @@ -158,7 +158,7 @@ func TestClusterToInfrastructureMapFunc(t *testing.T) { }, Spec: clusterv1.ClusterSpec{ InfrastructureRef: &corev1.ObjectReference{ - APIVersion: "bar.cluster.x-k8s.io/v1alpha4", + APIVersion: "bar.cluster.x-k8s.io/v1beta1", Kind: "TestCluster", Name: "bar-1", }, @@ -834,7 +834,7 @@ func TestRemoveOwnerRef(t *testing.T) { Name: "m4g1c", }, { - APIVersion: "bar.cluster.x-k8s.io/v1alpha4", + APIVersion: "bar.cluster.x-k8s.io/v1beta1", Kind: "TestCluster", Name: "bar-1", }, diff --git a/util/yaml/yaml.go b/util/yaml/yaml.go index 8ee41b94423e..49e0dc99d1aa 100644 --- a/util/yaml/yaml.go +++ b/util/yaml/yaml.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/streaming" apiyaml "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/yaml" ) diff --git a/util/yaml/yaml_test.go b/util/yaml/yaml_test.go index 7cd1ed71fffb..74046d9517d2 100644 --- a/util/yaml/yaml_test.go +++ b/util/yaml/yaml_test.go @@ -27,7 +27,7 @@ import ( ) const validCluster = ` -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1 @@ -35,39 +35,39 @@ spec:` const validMachines1 = ` --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine2` const validUnified1 = ` -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine1` const validUnified2 = ` -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine2` @@ -84,24 +84,24 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine2` const invalidMachines1 = ` items: -- apiVersion: "cluster.x-k8s.io/v1alpha4" +- apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine metadata: name: machine1 @@ -128,12 +128,12 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Machine - metadata: name: machine1 @@ -154,7 +154,7 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.x-k8s.io/v1alpha4" +apiVersion: "cluster.x-k8s.io/v1beta1" kind: Cluster metadata: name: cluster1