diff --git a/.golangci.yml b/.golangci.yml index 858d2cf92afe..062a5443fb63 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -52,7 +52,7 @@ linters-settings: # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. max-decl-chars: 50 gci: - local-prefixes: "false" + local-prefixes: "sigs.k8s.io/cluster-api" importas: no-unaliased: true alias: diff --git a/api/v1alpha3/cluster_types.go b/api/v1alpha3/cluster_types.go index af53ea0c024e..ae74d7b07f36 100644 --- a/api/v1alpha3/cluster_types.go +++ b/api/v1alpha3/cluster_types.go @@ -24,6 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1alpha3/conversion.go b/api/v1alpha3/conversion.go index d622a11c2b9f..415f9455e734 100644 --- a/api/v1alpha3/conversion.go +++ b/api/v1alpha3/conversion.go @@ -18,10 +18,11 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { diff --git a/api/v1alpha3/conversion_test.go b/api/v1alpha3/conversion_test.go index 5356362e72fa..067514ceda12 100644 --- a/api/v1alpha3/conversion_test.go +++ b/api/v1alpha3/conversion_test.go @@ -23,9 +23,10 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func TestFuzzyConversion(t *testing.T) { diff --git a/api/v1alpha3/machine_types.go b/api/v1alpha3/machine_types.go index 05d1e5af415a..7df53882496f 100644 --- a/api/v1alpha3/machine_types.go +++ b/api/v1alpha3/machine_types.go @@ -19,6 +19,7 @@ package v1alpha3 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1alpha3/machineset_types.go b/api/v1alpha3/machineset_types.go index ae8f56d69000..648ec1f00a96 100644 --- a/api/v1alpha3/machineset_types.go +++ b/api/v1alpha3/machineset_types.go @@ -21,6 +21,7 @@ import ( metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/validation/field" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1alpha3/suite_test.go b/api/v1alpha3/suite_test.go index d951964c21e5..41e7f9e08430 100644 --- a/api/v1alpha3/suite_test.go +++ b/api/v1alpha3/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/api/v1alpha3/webhook_test.go b/api/v1alpha3/webhook_test.go index 0cdc63a2a30c..cd8cd2794fd8 100644 --- a/api/v1alpha3/webhook_test.go +++ b/api/v1alpha3/webhook_test.go @@ -24,8 +24,9 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/util" ) func TestClusterConversion(t *testing.T) { diff --git a/api/v1alpha4/cluster_types.go b/api/v1alpha4/cluster_types.go index dbc70ac6f4d8..794363ab61bd 100644 --- a/api/v1alpha4/cluster_types.go +++ b/api/v1alpha4/cluster_types.go @@ -25,6 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1alpha4/conversion.go b/api/v1alpha4/conversion.go index e778a733a8ab..ef21c44975ca 100644 --- a/api/v1alpha4/conversion.go +++ b/api/v1alpha4/conversion.go @@ -18,9 +18,10 @@ package v1alpha4 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { diff --git a/api/v1alpha4/conversion_test.go b/api/v1alpha4/conversion_test.go index d06d7e9cb34e..bda2c9470ff2 100644 --- a/api/v1alpha4/conversion_test.go +++ b/api/v1alpha4/conversion_test.go @@ -25,6 +25,7 @@ import ( "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/utils/pointer" + "sigs.k8s.io/cluster-api/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/api/v1alpha4/machine_types.go b/api/v1alpha4/machine_types.go index fad4b798e553..d4f247b601ba 100644 --- a/api/v1alpha4/machine_types.go +++ b/api/v1alpha4/machine_types.go @@ -19,6 +19,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1alpha4/machineset_types.go b/api/v1alpha4/machineset_types.go index fd358b713f41..49ff0bac0fc5 100644 --- a/api/v1alpha4/machineset_types.go +++ b/api/v1alpha4/machineset_types.go @@ -21,6 +21,7 @@ import ( metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/validation/field" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1beta1/cluster_types.go b/api/v1beta1/cluster_types.go index 9fec315f00f5..cffb72eee316 100644 --- a/api/v1beta1/cluster_types.go +++ b/api/v1beta1/cluster_types.go @@ -26,6 +26,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1beta1/cluster_webhook.go b/api/v1beta1/cluster_webhook.go index 2d182291a61e..fae205ddd0af 100644 --- a/api/v1beta1/cluster_webhook.go +++ b/api/v1beta1/cluster_webhook.go @@ -25,10 +25,11 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/feature" - "sigs.k8s.io/cluster-api/util/version" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/feature" + "sigs.k8s.io/cluster-api/util/version" ) // Deprecated: This file, including all public and private methods, will be removed in a future release. diff --git a/api/v1beta1/cluster_webhook_test.go b/api/v1beta1/cluster_webhook_test.go index 95584051a42c..40fabbb71be4 100644 --- a/api/v1beta1/cluster_webhook_test.go +++ b/api/v1beta1/cluster_webhook_test.go @@ -23,6 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/cluster-api/feature" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1beta1/clusterclass_webhook.go b/api/v1beta1/clusterclass_webhook.go index b8e6455cbd44..0655bc79c25f 100644 --- a/api/v1beta1/clusterclass_webhook.go +++ b/api/v1beta1/clusterclass_webhook.go @@ -26,9 +26,10 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/feature" ) // Deprecated: This file, including all public and private methods, will be removed in a future release. diff --git a/api/v1beta1/clusterclass_webhook_test.go b/api/v1beta1/clusterclass_webhook_test.go index 9eae8ac13cc2..53d9440045ba 100644 --- a/api/v1beta1/clusterclass_webhook_test.go +++ b/api/v1beta1/clusterclass_webhook_test.go @@ -23,6 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/cluster-api/feature" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1beta1/index/cluster.go b/api/v1beta1/index/cluster.go index 61245a7798b5..57661b18a5a9 100644 --- a/api/v1beta1/index/cluster.go +++ b/api/v1beta1/index/cluster.go @@ -21,9 +21,10 @@ import ( "fmt" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/api/v1beta1/index/cluster_test.go b/api/v1beta1/index/cluster_test.go index 39f53fd016ba..021bc04f8dda 100644 --- a/api/v1beta1/index/cluster_test.go +++ b/api/v1beta1/index/cluster_test.go @@ -20,8 +20,9 @@ import ( "testing" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestClusterByClassName(t *testing.T) { diff --git a/api/v1beta1/index/index.go b/api/v1beta1/index/index.go index 4bbbdd698886..69f3278324e9 100644 --- a/api/v1beta1/index/index.go +++ b/api/v1beta1/index/index.go @@ -20,8 +20,9 @@ package index import ( "context" - "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/feature" ) // AddDefaultIndexes registers the default list of indexes. diff --git a/api/v1beta1/index/machine.go b/api/v1beta1/index/machine.go index 40981ce0a84a..134bb1d941fc 100644 --- a/api/v1beta1/index/machine.go +++ b/api/v1beta1/index/machine.go @@ -22,10 +22,11 @@ import ( "github.com/pkg/errors" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/controllers/noderefutil" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" ) const ( diff --git a/api/v1beta1/index/machine_test.go b/api/v1beta1/index/machine_test.go index b9f7228718f2..ebf6c26dac4a 100644 --- a/api/v1beta1/index/machine_test.go +++ b/api/v1beta1/index/machine_test.go @@ -22,9 +22,10 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestIndexMachineByNodeName(t *testing.T) { diff --git a/api/v1beta1/index/node.go b/api/v1beta1/index/node.go index 63b4abe799f8..6eed2de6545f 100644 --- a/api/v1beta1/index/node.go +++ b/api/v1beta1/index/node.go @@ -20,8 +20,9 @@ import ( "fmt" corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/controllers/noderefutil" ) const ( diff --git a/api/v1beta1/index/node_test.go b/api/v1beta1/index/node_test.go index e442c821881b..8137c3f99026 100644 --- a/api/v1beta1/index/node_test.go +++ b/api/v1beta1/index/node_test.go @@ -21,8 +21,9 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/controllers/noderefutil" ) func TestIndexNodeByProviderID(t *testing.T) { diff --git a/api/v1beta1/machine_types.go b/api/v1beta1/machine_types.go index 9e263f368bf6..b50ce9fbaa3c 100644 --- a/api/v1beta1/machine_types.go +++ b/api/v1beta1/machine_types.go @@ -19,6 +19,7 @@ package v1beta1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1beta1/machine_webhook.go b/api/v1beta1/machine_webhook.go index 00f02b6b5996..5ad80534cb48 100644 --- a/api/v1beta1/machine_webhook.go +++ b/api/v1beta1/machine_webhook.go @@ -23,9 +23,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/util/version" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/util/version" ) func (m *Machine) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/api/v1beta1/machine_webhook_test.go b/api/v1beta1/machine_webhook_test.go index 5902d9d37a5d..71383d43050b 100644 --- a/api/v1beta1/machine_webhook_test.go +++ b/api/v1beta1/machine_webhook_test.go @@ -23,6 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1beta1/machinedeployment_webhook.go b/api/v1beta1/machinedeployment_webhook.go index d2c937b8d67e..0b8b611ae236 100644 --- a/api/v1beta1/machinedeployment_webhook.go +++ b/api/v1beta1/machinedeployment_webhook.go @@ -27,9 +27,10 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" - "sigs.k8s.io/cluster-api/util/version" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/util/version" ) func (m *MachineDeployment) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/api/v1beta1/machinedeployment_webhook_test.go b/api/v1beta1/machinedeployment_webhook_test.go index 117089c67db2..a9d374133baa 100644 --- a/api/v1beta1/machinedeployment_webhook_test.go +++ b/api/v1beta1/machinedeployment_webhook_test.go @@ -23,6 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/pointer" + utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1beta1/machinehealthcheck_webhook_test.go b/api/v1beta1/machinehealthcheck_webhook_test.go index bccaf306e543..15f7cb8acaef 100644 --- a/api/v1beta1/machinehealthcheck_webhook_test.go +++ b/api/v1beta1/machinehealthcheck_webhook_test.go @@ -24,6 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1beta1/machineset_types.go b/api/v1beta1/machineset_types.go index 6dea5a275c46..05f3b847142e 100644 --- a/api/v1beta1/machineset_types.go +++ b/api/v1beta1/machineset_types.go @@ -21,6 +21,7 @@ import ( metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/validation/field" + capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/api/v1beta1/machineset_webhook.go b/api/v1beta1/machineset_webhook.go index 3ff73742478c..73af85dd5a95 100644 --- a/api/v1beta1/machineset_webhook.go +++ b/api/v1beta1/machineset_webhook.go @@ -25,9 +25,10 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/util/version" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/util/version" ) func (m *MachineSet) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/api/v1beta1/machineset_webhook_test.go b/api/v1beta1/machineset_webhook_test.go index bb033d363ed8..2111d4abd3eb 100644 --- a/api/v1beta1/machineset_webhook_test.go +++ b/api/v1beta1/machineset_webhook_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/bootstrap/kubeadm/api/v1alpha3/conversion.go b/bootstrap/kubeadm/api/v1alpha3/conversion.go index 374456a5b9d0..3ce22249f269 100644 --- a/bootstrap/kubeadm/api/v1alpha3/conversion.go +++ b/bootstrap/kubeadm/api/v1alpha3/conversion.go @@ -18,10 +18,11 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *KubeadmConfig) ConvertTo(dstRaw conversion.Hub) error { diff --git a/bootstrap/kubeadm/api/v1alpha3/conversion_test.go b/bootstrap/kubeadm/api/v1alpha3/conversion_test.go index 83cead194862..f405d1bf787c 100644 --- a/bootstrap/kubeadm/api/v1alpha3/conversion_test.go +++ b/bootstrap/kubeadm/api/v1alpha3/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" diff --git a/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go index 919b71417419..a37539193371 100644 --- a/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1alpha3/kubeadmconfig_types.go @@ -18,6 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" ) diff --git a/bootstrap/kubeadm/api/v1alpha3/suite_test.go b/bootstrap/kubeadm/api/v1alpha3/suite_test.go index d951964c21e5..41e7f9e08430 100644 --- a/bootstrap/kubeadm/api/v1alpha3/suite_test.go +++ b/bootstrap/kubeadm/api/v1alpha3/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/bootstrap/kubeadm/api/v1alpha3/webhook_test.go b/bootstrap/kubeadm/api/v1alpha3/webhook_test.go index 4926497ecab7..62eba4b589b9 100644 --- a/bootstrap/kubeadm/api/v1alpha3/webhook_test.go +++ b/bootstrap/kubeadm/api/v1alpha3/webhook_test.go @@ -23,9 +23,10 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestKubeadmConfigConversion(t *testing.T) { diff --git a/bootstrap/kubeadm/api/v1alpha4/conversion.go b/bootstrap/kubeadm/api/v1alpha4/conversion.go index 46a2f3341621..489e25d4c544 100644 --- a/bootstrap/kubeadm/api/v1alpha4/conversion.go +++ b/bootstrap/kubeadm/api/v1alpha4/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha4 import ( - "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) func (src *KubeadmConfig) ConvertTo(dstRaw conversion.Hub) error { diff --git a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go b/bootstrap/kubeadm/api/v1alpha4/conversion_test.go index 22a8611b3e4e..d651f03c99a2 100644 --- a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go +++ b/bootstrap/kubeadm/api/v1alpha4/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go index 4f16c20bc55d..082f0f52191c 100644 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go @@ -18,6 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go index 71fa3edbccb2..d4cc96663ba6 100644 --- a/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/bootstrap/kubeadm/controllers/alias.go b/bootstrap/kubeadm/controllers/alias.go index 65855e9f3bac..7f8b99b136ca 100644 --- a/bootstrap/kubeadm/controllers/alias.go +++ b/bootstrap/kubeadm/controllers/alias.go @@ -20,10 +20,11 @@ import ( "context" "time" - kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/controllers" ) // Following types provides access to reconcilers implemented in internal/controllers, thus diff --git a/bootstrap/kubeadm/internal/cloudinit/cloudinit.go b/bootstrap/kubeadm/internal/cloudinit/cloudinit.go index 027df98b5f6b..c2f158f7c5c7 100644 --- a/bootstrap/kubeadm/internal/cloudinit/cloudinit.go +++ b/bootstrap/kubeadm/internal/cloudinit/cloudinit.go @@ -23,6 +23,7 @@ import ( "text/template" "github.com/pkg/errors" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) diff --git a/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go b/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go index 96c5814ad49f..4d4e0c86aeec 100644 --- a/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go +++ b/bootstrap/kubeadm/internal/cloudinit/cloudinit_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" + 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/controlplane_join.go b/bootstrap/kubeadm/internal/cloudinit/controlplane_join.go index ddb04190c487..b0366330b5bd 100644 --- a/bootstrap/kubeadm/internal/cloudinit/controlplane_join.go +++ b/bootstrap/kubeadm/internal/cloudinit/controlplane_join.go @@ -18,6 +18,7 @@ package cloudinit import ( "github.com/pkg/errors" + "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 d35171694ec9..880dd859688b 100644 --- a/bootstrap/kubeadm/internal/cloudinit/node_test.go +++ b/bootstrap/kubeadm/internal/cloudinit/node_test.go @@ -20,8 +20,9 @@ import ( "fmt" "testing" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/yaml" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) func TestNewNode(t *testing.T) { diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go index 7c0c71adeab6..3fc55d075b5c 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go @@ -32,6 +32,12 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + 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" @@ -47,11 +53,6 @@ import ( "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) const ( diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_reconciler_test.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_reconciler_test.go index c8cf4adae77a..08cd8a39b266 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_reconciler_test.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_reconciler_test.go @@ -20,9 +20,10 @@ import ( "testing" . "github.com/onsi/gomega" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) func TestKubeadmConfigReconciler(t *testing.T) { diff --git a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_test.go b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_test.go index c52d0ed0b817..de36de92e59f 100644 --- a/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_test.go +++ b/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller_test.go @@ -30,6 +30,11 @@ import ( "k8s.io/apimachinery/pkg/types" bootstrapapi "k8s.io/cluster-bootstrap/token/api" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + 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" @@ -39,10 +44,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // MachineToBootstrapMapFunc return kubeadm bootstrap configref name when configref exists. diff --git a/bootstrap/kubeadm/internal/controllers/suite_test.go b/bootstrap/kubeadm/internal/controllers/suite_test.go index 552b23c3859b..2ac8101fbde5 100644 --- a/bootstrap/kubeadm/internal/controllers/suite_test.go +++ b/bootstrap/kubeadm/internal/controllers/suite_test.go @@ -20,9 +20,10 @@ import ( "os" "testing" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" ) var ( diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go index 777e140556da..f83d210b6c4e 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go @@ -27,8 +27,9 @@ 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/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const semaphoreInformationKey = "lock-information" 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 28aec8f85c32..3a757d326046 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go @@ -31,11 +31,12 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - 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" "sigs.k8s.io/controller-runtime/pkg/log" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index fc13c290dc7e..94827edb6d2a 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -35,6 +35,10 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + 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" @@ -44,9 +48,6 @@ import ( 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" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go b/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go index b11e9314bf42..c74dee3fce54 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go +++ b/bootstrap/kubeadm/types/upstreamv1beta1/conversion.go @@ -18,8 +18,9 @@ package upstreamv1beta1 import ( apimachineryconversion "k8s.io/apimachinery/pkg/conversion" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) // ConvertTo converts this ClusterConfiguration to the Hub version (v1alpha4). diff --git a/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go b/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go index 92c78c412104..1c1e7aaecf46 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go +++ b/bootstrap/kubeadm/types/upstreamv1beta1/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/bootstrap/kubeadm/types/upstreamv1beta2/conversion.go b/bootstrap/kubeadm/types/upstreamv1beta2/conversion.go index 97229decc32e..bcbd15063dbb 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta2/conversion.go +++ b/bootstrap/kubeadm/types/upstreamv1beta2/conversion.go @@ -18,8 +18,9 @@ package upstreamv1beta2 import ( apimachineryconversion "k8s.io/apimachinery/pkg/conversion" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) func (src *ClusterConfiguration) ConvertTo(dstRaw conversion.Hub) error { diff --git a/bootstrap/kubeadm/types/upstreamv1beta2/conversion_test.go b/bootstrap/kubeadm/types/upstreamv1beta2/conversion_test.go index 44b5e756af68..715d1901c138 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta2/conversion_test.go +++ b/bootstrap/kubeadm/types/upstreamv1beta2/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/bootstrap/kubeadm/types/upstreamv1beta3/conversion.go b/bootstrap/kubeadm/types/upstreamv1beta3/conversion.go index 1e50a529c69a..bcf9e1ef1987 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta3/conversion.go +++ b/bootstrap/kubeadm/types/upstreamv1beta3/conversion.go @@ -18,8 +18,9 @@ package upstreamv1beta3 import ( apimachineryconversion "k8s.io/apimachinery/pkg/conversion" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" ) // ConvertTo converts this ClusterConfiguration to the Hub version (v1alpha4). diff --git a/bootstrap/kubeadm/types/upstreamv1beta3/conversion_test.go b/bootstrap/kubeadm/types/upstreamv1beta3/conversion_test.go index 93bb3735fd56..5efbe8983e6a 100644 --- a/bootstrap/kubeadm/types/upstreamv1beta3/conversion_test.go +++ b/bootstrap/kubeadm/types/upstreamv1beta3/conversion_test.go @@ -24,6 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/runtime" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/bootstrap/kubeadm/types/utils.go b/bootstrap/kubeadm/types/utils.go index 90703e4e0c1f..dd72c9e29b48 100644 --- a/bootstrap/kubeadm/types/utils.go +++ b/bootstrap/kubeadm/types/utils.go @@ -23,12 +23,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/scheme" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta2" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta3" - "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/scheme" ) var ( diff --git a/bootstrap/kubeadm/types/utils_test.go b/bootstrap/kubeadm/types/utils_test.go index 98317d7b562b..ffce7f749e22 100644 --- a/bootstrap/kubeadm/types/utils_test.go +++ b/bootstrap/kubeadm/types/utils_test.go @@ -23,6 +23,7 @@ import ( "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime/schema" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta2" diff --git a/bootstrap/util/configowner.go b/bootstrap/util/configowner.go index 2c2ec71274c3..82feaab61b0f 100644 --- a/bootstrap/util/configowner.go +++ b/bootstrap/util/configowner.go @@ -25,11 +25,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ConfigOwner provides a data interface for different config owner types. diff --git a/bootstrap/util/configowner_test.go b/bootstrap/util/configowner_test.go index d3768b6d8d84..4ca61d73c867 100644 --- a/bootstrap/util/configowner_test.go +++ b/bootstrap/util/configowner_test.go @@ -22,11 +22,12 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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" ) func TestGetConfigOwner(t *testing.T) { diff --git a/bootstrap/util/suite_test.go b/bootstrap/util/suite_test.go index b3401b32b798..0a7841c857e3 100644 --- a/bootstrap/util/suite_test.go +++ b/bootstrap/util/suite_test.go @@ -20,9 +20,10 @@ import ( "os" "testing" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" ) var ( diff --git a/cmd/clusterctl/client/alpha/machinedeployment.go b/cmd/clusterctl/client/alpha/machinedeployment.go index 11104249330e..c52d790789d9 100644 --- a/cmd/clusterctl/client/alpha/machinedeployment.go +++ b/cmd/clusterctl/client/alpha/machinedeployment.go @@ -24,10 +24,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - "sigs.k8s.io/controller-runtime/pkg/client" ) // getMachineDeployment retrieves the MachineDeployment object corresponding to the name and namespace specified. diff --git a/cmd/clusterctl/client/alpha/rollout.go b/cmd/clusterctl/client/alpha/rollout.go index 8ac7c9533ab1..bc125878fd6f 100644 --- a/cmd/clusterctl/client/alpha/rollout.go +++ b/cmd/clusterctl/client/alpha/rollout.go @@ -18,6 +18,7 @@ package alpha import ( corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) diff --git a/cmd/clusterctl/client/alpha/rollout_pauser.go b/cmd/clusterctl/client/alpha/rollout_pauser.go index cc63581ca18c..80e0ebea6766 100644 --- a/cmd/clusterctl/client/alpha/rollout_pauser.go +++ b/cmd/clusterctl/client/alpha/rollout_pauser.go @@ -22,8 +22,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) // ObjectPauser will issue a pause on the specified cluster-api resource. diff --git a/cmd/clusterctl/client/alpha/rollout_pauser_test.go b/cmd/clusterctl/client/alpha/rollout_pauser_test.go index 7cccf749c445..9a1473c38902 100644 --- a/cmd/clusterctl/client/alpha/rollout_pauser_test.go +++ b/cmd/clusterctl/client/alpha/rollout_pauser_test.go @@ -23,9 +23,10 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_ObjectPauser(t *testing.T) { diff --git a/cmd/clusterctl/client/alpha/rollout_restarter.go b/cmd/clusterctl/client/alpha/rollout_restarter.go index 8a3b6fa5ce41..67e9bf4d5da0 100644 --- a/cmd/clusterctl/client/alpha/rollout_restarter.go +++ b/cmd/clusterctl/client/alpha/rollout_restarter.go @@ -23,8 +23,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) // ObjectRestarter will issue a restart on the specified cluster-api resource. diff --git a/cmd/clusterctl/client/alpha/rollout_restarter_test.go b/cmd/clusterctl/client/alpha/rollout_restarter_test.go index db98c1dc8b08..05c408a4d94c 100644 --- a/cmd/clusterctl/client/alpha/rollout_restarter_test.go +++ b/cmd/clusterctl/client/alpha/rollout_restarter_test.go @@ -23,9 +23,10 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_ObjectRestarter(t *testing.T) { diff --git a/cmd/clusterctl/client/alpha/rollout_resumer.go b/cmd/clusterctl/client/alpha/rollout_resumer.go index ed0e4093c381..5e694516b264 100644 --- a/cmd/clusterctl/client/alpha/rollout_resumer.go +++ b/cmd/clusterctl/client/alpha/rollout_resumer.go @@ -22,8 +22,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) // ObjectResumer will issue a resume on the specified cluster-api resource. diff --git a/cmd/clusterctl/client/alpha/rollout_resumer_test.go b/cmd/clusterctl/client/alpha/rollout_resumer_test.go index e86b200a9ee3..5b585264b517 100644 --- a/cmd/clusterctl/client/alpha/rollout_resumer_test.go +++ b/cmd/clusterctl/client/alpha/rollout_resumer_test.go @@ -23,9 +23,10 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_ObjectResumer(t *testing.T) { diff --git a/cmd/clusterctl/client/alpha/rollout_rollbacker.go b/cmd/clusterctl/client/alpha/rollout_rollbacker.go index 0ad6dccc8079..9562a7ec0407 100644 --- a/cmd/clusterctl/client/alpha/rollout_rollbacker.go +++ b/cmd/clusterctl/client/alpha/rollout_rollbacker.go @@ -19,6 +19,7 @@ package alpha import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go b/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go index 4bcb6cd4c8a5..826c29e13630 100644 --- a/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go +++ b/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go @@ -24,9 +24,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_ObjectRollbacker(t *testing.T) { diff --git a/cmd/clusterctl/client/client_test.go b/cmd/clusterctl/client/client_test.go index 7f59273f6621..752a17d2640a 100644 --- a/cmd/clusterctl/client/client_test.go +++ b/cmd/clusterctl/client/client_test.go @@ -25,6 +25,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" @@ -33,7 +35,6 @@ import ( yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) // TestNewFakeClient is a fake test to document fakeClient usage. diff --git a/cmd/clusterctl/client/cluster/cert_manager.go b/cmd/clusterctl/client/cluster/cert_manager.go index a0137bea9acb..2b4287619cbd 100644 --- a/cmd/clusterctl/client/cluster/cert_manager.go +++ b/cmd/clusterctl/client/cluster/cert_manager.go @@ -26,6 +26,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/version" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" @@ -33,7 +35,6 @@ import ( logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" utilresource "sigs.k8s.io/cluster-api/util/resource" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/cmd/clusterctl/client/cluster/cert_manager_test.go b/cmd/clusterctl/client/cluster/cert_manager_test.go index d3b5d2658120..3c1786411bf7 100644 --- a/cmd/clusterctl/client/cluster/cert_manager_test.go +++ b/cmd/clusterctl/client/cluster/cert_manager_test.go @@ -31,13 +31,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) var certManagerDeploymentYaml = []byte("apiVersion: apps/v1\n" + diff --git a/cmd/clusterctl/client/cluster/client.go b/cmd/clusterctl/client/cluster/client.go index 8cf30f00d343..2535895ba956 100644 --- a/cmd/clusterctl/client/cluster/client.go +++ b/cmd/clusterctl/client/cluster/client.go @@ -22,6 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/cluster/client_test.go b/cmd/clusterctl/client/cluster/client_test.go index 837338cf3305..387c4936e98c 100644 --- a/cmd/clusterctl/client/cluster/client_test.go +++ b/cmd/clusterctl/client/cluster/client_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/cluster/components.go b/cmd/clusterctl/client/cluster/components.go index 5ff96d5686e2..3b56bae49908 100644 --- a/cmd/clusterctl/client/cluster/components.go +++ b/cmd/clusterctl/client/cluster/components.go @@ -27,11 +27,12 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/util" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/cmd/clusterctl/client/cluster/components_test.go b/cmd/clusterctl/client/cluster/components_test.go index 3e27c054b455..fc41e9f69870 100644 --- a/cmd/clusterctl/client/cluster/components_test.go +++ b/cmd/clusterctl/client/cluster/components_test.go @@ -27,11 +27,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_providerComponents_Delete(t *testing.T) { diff --git a/cmd/clusterctl/client/cluster/installer.go b/cmd/clusterctl/client/cluster/installer.go index 73acec996feb..ee0e605a7e8f 100644 --- a/cmd/clusterctl/client/cluster/installer.go +++ b/cmd/clusterctl/client/cluster/installer.go @@ -29,13 +29,14 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/util" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ProviderInstaller defines methods for enforcing consistency rules for provider installation. diff --git a/cmd/clusterctl/client/cluster/installer_test.go b/cmd/clusterctl/client/cluster/installer_test.go index 86889adda44b..1c71a5680827 100644 --- a/cmd/clusterctl/client/cluster/installer_test.go +++ b/cmd/clusterctl/client/cluster/installer_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" diff --git a/cmd/clusterctl/client/cluster/inventory.go b/cmd/clusterctl/client/cluster/inventory.go index 1adc670c8a27..f150c6dbd794 100644 --- a/cmd/clusterctl/client/cluster/inventory.go +++ b/cmd/clusterctl/client/cluster/inventory.go @@ -27,12 +27,13 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/config" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/cmd/clusterctl/client/cluster/inventory_test.go b/cmd/clusterctl/client/cluster/inventory_test.go index fcf189f8aafa..a589d2ed9d3b 100644 --- a/cmd/clusterctl/client/cluster/inventory_test.go +++ b/cmd/clusterctl/client/cluster/inventory_test.go @@ -24,10 +24,11 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/controller-runtime/pkg/client" ) func fakePollImmediateWaiter(interval, timeout time.Duration, condition wait.ConditionFunc) error { diff --git a/cmd/clusterctl/client/cluster/mover.go b/cmd/clusterctl/client/cluster/mover.go index 0ae06806ca95..7628c5e05fdb 100644 --- a/cmd/clusterctl/client/cluster/mover.go +++ b/cmd/clusterctl/client/cluster/mover.go @@ -30,13 +30,14 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ObjectMover defines methods for moving Cluster API objects to another management cluster. diff --git a/cmd/clusterctl/client/cluster/mover_test.go b/cmd/clusterctl/client/cluster/mover_test.go index 65a8c6649494..01378b5b344f 100644 --- a/cmd/clusterctl/client/cluster/mover_test.go +++ b/cmd/clusterctl/client/cluster/mover_test.go @@ -30,12 +30,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/infrastructure" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client" ) type moveTestsFields struct { diff --git a/cmd/clusterctl/client/cluster/objectgraph.go b/cmd/clusterctl/client/cluster/objectgraph.go index 3cc2135c24e3..c688d0fc1466 100644 --- a/cmd/clusterctl/client/cluster/objectgraph.go +++ b/cmd/clusterctl/client/cluster/objectgraph.go @@ -27,12 +27,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" secretutil "sigs.k8s.io/cluster-api/util/secret" - "sigs.k8s.io/controller-runtime/pkg/client" ) const clusterTopologyNameKey = "cluster.spec.topology.class" diff --git a/cmd/clusterctl/client/cluster/objectgraph_test.go b/cmd/clusterctl/client/cluster/objectgraph_test.go index c498ef934d0e..839574f7a7cb 100644 --- a/cmd/clusterctl/client/cluster/objectgraph_test.go +++ b/cmd/clusterctl/client/cluster/objectgraph_test.go @@ -27,10 +27,11 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/internal/builder" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestObjectGraph_getDiscoveryTypeMetaList(t *testing.T) { diff --git a/cmd/clusterctl/client/cluster/proxy.go b/cmd/clusterctl/client/cluster/proxy.go index 828cf0f8b9d3..833090e9888d 100644 --- a/cmd/clusterctl/client/cluster/proxy.go +++ b/cmd/clusterctl/client/cluster/proxy.go @@ -33,11 +33,12 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" "sigs.k8s.io/cluster-api/version" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( diff --git a/cmd/clusterctl/client/cluster/proxy_test.go b/cmd/clusterctl/client/cluster/proxy_test.go index b0ede3edbbf7..ab3e0512db36 100644 --- a/cmd/clusterctl/client/cluster/proxy_test.go +++ b/cmd/clusterctl/client/cluster/proxy_test.go @@ -24,6 +24,7 @@ import ( "time" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/version" ) diff --git a/cmd/clusterctl/client/cluster/template.go b/cmd/clusterctl/client/cluster/template.go index f5a8004d6b55..859d20dd8b63 100644 --- a/cmd/clusterctl/client/cluster/template.go +++ b/cmd/clusterctl/client/cluster/template.go @@ -28,10 +28,11 @@ import ( "github.com/pkg/errors" "golang.org/x/oauth2" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" - "sigs.k8s.io/controller-runtime/pkg/client" ) // TemplateClient has methods to work with templates stored in the cluster/out of the provider repository. diff --git a/cmd/clusterctl/client/cluster/template_test.go b/cmd/clusterctl/client/cluster/template_test.go index 9daefd0561f6..18fac15ba3e2 100644 --- a/cmd/clusterctl/client/cluster/template_test.go +++ b/cmd/clusterctl/client/cluster/template_test.go @@ -29,6 +29,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/cluster/upgrader.go b/cmd/clusterctl/client/cluster/upgrader.go index a06ef2d674e3..b7ad5e518ce7 100644 --- a/cmd/clusterctl/client/cluster/upgrader.go +++ b/cmd/clusterctl/client/cluster/upgrader.go @@ -27,12 +27,13 @@ import ( "k8s.io/apimachinery/pkg/util/version" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ProviderUpgrader defines methods for supporting provider upgrade. diff --git a/cmd/clusterctl/client/cluster/upgrader_info.go b/cmd/clusterctl/client/cluster/upgrader_info.go index 84c94fb2e167..41c5255077e9 100644 --- a/cmd/clusterctl/client/cluster/upgrader_info.go +++ b/cmd/clusterctl/client/cluster/upgrader_info.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) diff --git a/cmd/clusterctl/client/cluster/upgrader_info_test.go b/cmd/clusterctl/client/cluster/upgrader_info_test.go index a8804366f8b4..58c89f678396 100644 --- a/cmd/clusterctl/client/cluster/upgrader_info_test.go +++ b/cmd/clusterctl/client/cluster/upgrader_info_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/version" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/cluster/upgrader_test.go b/cmd/clusterctl/client/cluster/upgrader_test.go index 16d51963b3cf..f8c357489a08 100644 --- a/cmd/clusterctl/client/cluster/upgrader_test.go +++ b/cmd/clusterctl/client/cluster/upgrader_test.go @@ -21,6 +21,7 @@ import ( "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" + clusterv1v1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/cluster/workload_cluster.go b/cmd/clusterctl/client/cluster/workload_cluster.go index 26cebcb0dfa4..a5e085dae2c9 100644 --- a/cmd/clusterctl/client/cluster/workload_cluster.go +++ b/cmd/clusterctl/client/cluster/workload_cluster.go @@ -18,8 +18,9 @@ package cluster import ( "github.com/pkg/errors" - utilkubeconfig "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/controller-runtime/pkg/client" + + utilkubeconfig "sigs.k8s.io/cluster-api/util/kubeconfig" ) // WorkloadCluster has methods for fetching kubeconfig of workload cluster from management cluster. diff --git a/cmd/clusterctl/client/cluster/workload_cluster_test.go b/cmd/clusterctl/client/cluster/workload_cluster_test.go index 1bec2cdb5de2..18a55a376ea5 100644 --- a/cmd/clusterctl/client/cluster/workload_cluster_test.go +++ b/cmd/clusterctl/client/cluster/workload_cluster_test.go @@ -22,6 +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/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/util/secret" diff --git a/cmd/clusterctl/client/clusterclass.go b/cmd/clusterctl/client/clusterclass.go index ee796ca0210f..392c54da4845 100644 --- a/cmd/clusterctl/client/clusterclass.go +++ b/cmd/clusterctl/client/clusterclass.go @@ -23,11 +23,12 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" ) // addClusterClassIfMissing returns a Template that includes the base template and adds any cluster class definitions that diff --git a/cmd/clusterctl/client/clusterclass_test.go b/cmd/clusterctl/client/clusterclass_test.go index 3be255b6ab37..3d3e207d7d5e 100644 --- a/cmd/clusterctl/client/clusterclass_test.go +++ b/cmd/clusterctl/client/clusterclass_test.go @@ -26,13 +26,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestClusterClassExists(t *testing.T) { diff --git a/cmd/clusterctl/client/common.go b/cmd/clusterctl/client/common.go index 9924e788fea3..db47705993c5 100644 --- a/cmd/clusterctl/client/common.go +++ b/cmd/clusterctl/client/common.go @@ -21,6 +21,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/validation" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" ) diff --git a/cmd/clusterctl/client/config.go b/cmd/clusterctl/client/config.go index 49d5d7d04f27..3c79fe7bfce6 100644 --- a/cmd/clusterctl/client/config.go +++ b/cmd/clusterctl/client/config.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/version" "k8s.io/utils/pointer" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" diff --git a/cmd/clusterctl/client/config/cert_manager_client_test.go b/cmd/clusterctl/client/config/cert_manager_client_test.go index 11f7404b5b5d..0f0d5e8f1faa 100644 --- a/cmd/clusterctl/client/config/cert_manager_client_test.go +++ b/cmd/clusterctl/client/config/cert_manager_client_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/config/imagemeta_client.go b/cmd/clusterctl/client/config/imagemeta_client.go index 0ce769ef5297..23654f6f5b1d 100644 --- a/cmd/clusterctl/client/config/imagemeta_client.go +++ b/cmd/clusterctl/client/config/imagemeta_client.go @@ -21,6 +21,7 @@ import ( "strings" "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/util/container" ) diff --git a/cmd/clusterctl/client/config/imagemeta_client_test.go b/cmd/clusterctl/client/config/imagemeta_client_test.go index c18ee93f57ca..be5c7bbf71c0 100644 --- a/cmd/clusterctl/client/config/imagemeta_client_test.go +++ b/cmd/clusterctl/client/config/imagemeta_client_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index d4a2bc559a60..2f616bd9084c 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/validation" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) diff --git a/cmd/clusterctl/client/config/providers_client_test.go b/cmd/clusterctl/client/config/providers_client_test.go index 6f4777337889..1b5d0f3e3f44 100644 --- a/cmd/clusterctl/client/config/providers_client_test.go +++ b/cmd/clusterctl/client/config/providers_client_test.go @@ -22,6 +22,7 @@ import ( "testing" . "github.com/onsi/gomega" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/config/reader_memory.go b/cmd/clusterctl/client/config/reader_memory.go index 67e22f1f84d1..05ddeb2980b4 100644 --- a/cmd/clusterctl/client/config/reader_memory.go +++ b/cmd/clusterctl/client/config/reader_memory.go @@ -18,8 +18,9 @@ package config import ( "github.com/pkg/errors" - clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/yaml" + + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) // MemoryReader provides a reader implementation backed by a map. diff --git a/cmd/clusterctl/client/config/reader_memory_test.go b/cmd/clusterctl/client/config/reader_memory_test.go index f62ba83e179d..0ea0232a5d97 100644 --- a/cmd/clusterctl/client/config/reader_memory_test.go +++ b/cmd/clusterctl/client/config/reader_memory_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) diff --git a/cmd/clusterctl/client/config/reader_viper.go b/cmd/clusterctl/client/config/reader_viper.go index 52f7fa288ca0..135ec7dca64a 100644 --- a/cmd/clusterctl/client/config/reader_viper.go +++ b/cmd/clusterctl/client/config/reader_viper.go @@ -29,6 +29,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" "k8s.io/client-go/util/homedir" + logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" ) diff --git a/cmd/clusterctl/client/config/variables_client_test.go b/cmd/clusterctl/client/config/variables_client_test.go index e2c5d2ed3e63..e7fe36efb28d 100644 --- a/cmd/clusterctl/client/config/variables_client_test.go +++ b/cmd/clusterctl/client/config/variables_client_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/config_test.go b/cmd/clusterctl/client/config_test.go index 49d73a1d5b1d..ab27fd35c5f4 100644 --- a/cmd/clusterctl/client/config_test.go +++ b/cmd/clusterctl/client/config_test.go @@ -28,6 +28,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/delete.go b/cmd/clusterctl/client/delete.go index bc90e0b5620f..7c10cfced556 100644 --- a/cmd/clusterctl/client/delete.go +++ b/cmd/clusterctl/client/delete.go @@ -19,6 +19,7 @@ package client import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) diff --git a/cmd/clusterctl/client/delete_test.go b/cmd/clusterctl/client/delete_test.go index 6200c1e7b7a4..7454e353ee44 100644 --- a/cmd/clusterctl/client/delete_test.go +++ b/cmd/clusterctl/client/delete_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/util/sets" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) diff --git a/cmd/clusterctl/client/get_kubeconfig_test.go b/cmd/clusterctl/client/get_kubeconfig_test.go index a61e71ba1748..c3700803adfd 100644 --- a/cmd/clusterctl/client/get_kubeconfig_test.go +++ b/cmd/clusterctl/client/get_kubeconfig_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/client/init.go b/cmd/clusterctl/client/init.go index dd097dff1449..ad4c09d61453 100644 --- a/cmd/clusterctl/client/init.go +++ b/cmd/clusterctl/client/init.go @@ -21,6 +21,7 @@ import ( "time" "github.com/pkg/errors" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/init_test.go b/cmd/clusterctl/client/init_test.go index 49e193668ce2..3d3f2e29d322 100644 --- a/cmd/clusterctl/client/init_test.go +++ b/cmd/clusterctl/client/init_test.go @@ -22,13 +22,14 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - ctrl "sigs.k8s.io/controller-runtime" ) var ( diff --git a/cmd/clusterctl/client/move_test.go b/cmd/clusterctl/client/move_test.go index 61eaa7231b9f..e12555cb4451 100644 --- a/cmd/clusterctl/client/move_test.go +++ b/cmd/clusterctl/client/move_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/repository/client.go b/cmd/clusterctl/client/repository/client.go index 78f5b2b2a182..a66a8c0705b6 100644 --- a/cmd/clusterctl/client/repository/client.go +++ b/cmd/clusterctl/client/repository/client.go @@ -20,6 +20,7 @@ import ( "net/url" "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" ) diff --git a/cmd/clusterctl/client/repository/client_test.go b/cmd/clusterctl/client/repository/client_test.go index 84842c9edc2d..97316a154a7c 100644 --- a/cmd/clusterctl/client/repository/client_test.go +++ b/cmd/clusterctl/client/repository/client_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/repository/clusterclass_client.go b/cmd/clusterctl/client/repository/clusterclass_client.go index fd2340a9c201..afd0d8d60ebb 100644 --- a/cmd/clusterctl/client/repository/clusterclass_client.go +++ b/cmd/clusterctl/client/repository/clusterclass_client.go @@ -18,6 +18,7 @@ package repository import ( "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/repository/clusterclass_client_test.go b/cmd/clusterctl/client/repository/clusterclass_client_test.go index b55e25be82ef..ce71a6c5ac88 100644 --- a/cmd/clusterctl/client/repository/clusterclass_client_test.go +++ b/cmd/clusterctl/client/repository/clusterclass_client_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/repository/components.go b/cmd/clusterctl/client/repository/components.go index 3394f032b081..2ee48fcaa182 100644 --- a/cmd/clusterctl/client/repository/components.go +++ b/cmd/clusterctl/client/repository/components.go @@ -28,6 +28,7 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/repository/components_client.go b/cmd/clusterctl/client/repository/components_client.go index cab28de49805..107e4cd5547d 100644 --- a/cmd/clusterctl/client/repository/components_client.go +++ b/cmd/clusterctl/client/repository/components_client.go @@ -18,6 +18,7 @@ package repository import ( "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/repository/components_client_test.go b/cmd/clusterctl/client/repository/components_client_test.go index 96b265dfc822..4ac5ab34bfe4 100644 --- a/cmd/clusterctl/client/repository/components_client_test.go +++ b/cmd/clusterctl/client/repository/components_client_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/repository/components_test.go b/cmd/clusterctl/client/repository/components_test.go index 96ce1eab2656..f5c0573d87a1 100644 --- a/cmd/clusterctl/client/repository/components_test.go +++ b/cmd/clusterctl/client/repository/components_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/repository/metadata_client.go b/cmd/clusterctl/client/repository/metadata_client.go index 9962ef2fab17..6a75e0580e4b 100644 --- a/cmd/clusterctl/client/repository/metadata_client.go +++ b/cmd/clusterctl/client/repository/metadata_client.go @@ -20,6 +20,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" diff --git a/cmd/clusterctl/client/repository/metadata_client_test.go b/cmd/clusterctl/client/repository/metadata_client_test.go index a67172decdb8..5c16ffc38a97 100644 --- a/cmd/clusterctl/client/repository/metadata_client_test.go +++ b/cmd/clusterctl/client/repository/metadata_client_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" diff --git a/cmd/clusterctl/client/repository/overrides.go b/cmd/clusterctl/client/repository/overrides.go index 0882794dd719..e8cc8b2154c5 100644 --- a/cmd/clusterctl/client/repository/overrides.go +++ b/cmd/clusterctl/client/repository/overrides.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" "k8s.io/client-go/util/homedir" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" ) diff --git a/cmd/clusterctl/client/repository/overrides_test.go b/cmd/clusterctl/client/repository/overrides_test.go index 2cf5efe5d1af..b552ddee8f8b 100644 --- a/cmd/clusterctl/client/repository/overrides_test.go +++ b/cmd/clusterctl/client/repository/overrides_test.go @@ -23,6 +23,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/client-go/util/homedir" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" diff --git a/cmd/clusterctl/client/repository/repository_github.go b/cmd/clusterctl/client/repository/repository_github.go index 639f3fc8d057..4f68ae305f84 100644 --- a/cmd/clusterctl/client/repository/repository_github.go +++ b/cmd/clusterctl/client/repository/repository_github.go @@ -29,6 +29,7 @@ import ( "github.com/pkg/errors" "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/version" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" ) diff --git a/cmd/clusterctl/client/repository/repository_github_test.go b/cmd/clusterctl/client/repository/repository_github_test.go index 160bc12af7f2..d6809c1daebe 100644 --- a/cmd/clusterctl/client/repository/repository_github_test.go +++ b/cmd/clusterctl/client/repository/repository_github_test.go @@ -24,6 +24,7 @@ import ( "github.com/google/go-github/v33/github" . "github.com/onsi/gomega" "k8s.io/utils/pointer" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" diff --git a/cmd/clusterctl/client/repository/repository_local.go b/cmd/clusterctl/client/repository/repository_local.go index a7a51fa0c58a..541f5b98aa53 100644 --- a/cmd/clusterctl/client/repository/repository_local.go +++ b/cmd/clusterctl/client/repository/repository_local.go @@ -25,6 +25,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/version" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" ) diff --git a/cmd/clusterctl/client/repository/repository_local_test.go b/cmd/clusterctl/client/repository/repository_local_test.go index 3c268b000b60..18f41b6caa5c 100644 --- a/cmd/clusterctl/client/repository/repository_local_test.go +++ b/cmd/clusterctl/client/repository/repository_local_test.go @@ -22,6 +22,7 @@ import ( "testing" . "github.com/onsi/gomega" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" diff --git a/cmd/clusterctl/client/repository/repository_memory.go b/cmd/clusterctl/client/repository/repository_memory.go index ac50e2d3cf43..2d340a7e7c1f 100644 --- a/cmd/clusterctl/client/repository/repository_memory.go +++ b/cmd/clusterctl/client/repository/repository_memory.go @@ -22,6 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" diff --git a/cmd/clusterctl/client/repository/repository_versions.go b/cmd/clusterctl/client/repository/repository_versions.go index 1cbe4f7ea201..f4b710408d47 100644 --- a/cmd/clusterctl/client/repository/repository_versions.go +++ b/cmd/clusterctl/client/repository/repository_versions.go @@ -21,6 +21,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/version" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" ) diff --git a/cmd/clusterctl/client/repository/template.go b/cmd/clusterctl/client/repository/template.go index 26bd9e67309c..ebb04591b05e 100644 --- a/cmd/clusterctl/client/repository/template.go +++ b/cmd/clusterctl/client/repository/template.go @@ -22,6 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" utilyaml "sigs.k8s.io/cluster-api/util/yaml" diff --git a/cmd/clusterctl/client/repository/template_client.go b/cmd/clusterctl/client/repository/template_client.go index 52b2216043a2..26b50c60e74e 100644 --- a/cmd/clusterctl/client/repository/template_client.go +++ b/cmd/clusterctl/client/repository/template_client.go @@ -18,6 +18,7 @@ package repository import ( "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/repository/template_client_test.go b/cmd/clusterctl/client/repository/template_client_test.go index 09c5c59fafec..2f08c7cb184d 100644 --- a/cmd/clusterctl/client/repository/template_client_test.go +++ b/cmd/clusterctl/client/repository/template_client_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/repository/template_test.go b/cmd/clusterctl/client/repository/template_test.go index 0735c29f11ad..46685a658c29 100644 --- a/cmd/clusterctl/client/repository/template_test.go +++ b/cmd/clusterctl/client/repository/template_test.go @@ -21,6 +21,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" diff --git a/cmd/clusterctl/client/rollout.go b/cmd/clusterctl/client/rollout.go index e8aa10bc883a..2a932f82e8ae 100644 --- a/cmd/clusterctl/client/rollout.go +++ b/cmd/clusterctl/client/rollout.go @@ -21,6 +21,7 @@ import ( "strings" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/util" ) diff --git a/cmd/clusterctl/client/rollout_test.go b/cmd/clusterctl/client/rollout_test.go index 44151b8e90ca..d4c21926ec33 100644 --- a/cmd/clusterctl/client/rollout_test.go +++ b/cmd/clusterctl/client/rollout_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" diff --git a/cmd/clusterctl/client/tree/discovery.go b/cmd/clusterctl/client/tree/discovery.go index f4bba860bf02..76405bfe089e 100644 --- a/cmd/clusterctl/client/tree/discovery.go +++ b/cmd/clusterctl/client/tree/discovery.go @@ -20,10 +20,11 @@ import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) // DiscoverOptions define options for the discovery process. diff --git a/cmd/clusterctl/client/tree/discovery_test.go b/cmd/clusterctl/client/tree/discovery_test.go index 58db7f740cbf..6cc5d25084a8 100644 --- a/cmd/clusterctl/client/tree/discovery_test.go +++ b/cmd/clusterctl/client/tree/discovery_test.go @@ -23,8 +23,9 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) func Test_Discovery(t *testing.T) { diff --git a/cmd/clusterctl/client/tree/tree.go b/cmd/clusterctl/client/tree/tree.go index a4a5a4be15b6..3c63a542e068 100644 --- a/cmd/clusterctl/client/tree/tree.go +++ b/cmd/clusterctl/client/tree/tree.go @@ -25,9 +25,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ObjectTreeOptions defines the options for an ObjectTree. diff --git a/cmd/clusterctl/client/tree/tree_test.go b/cmd/clusterctl/client/tree/tree_test.go index 3ef3055a48f3..a39fedf5ef71 100644 --- a/cmd/clusterctl/client/tree/tree_test.go +++ b/cmd/clusterctl/client/tree/tree_test.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/cmd/clusterctl/client/tree/util.go b/cmd/clusterctl/client/tree/util.go index e821fa1b6c18..4f83ed2b6dbd 100644 --- a/cmd/clusterctl/client/tree/util.go +++ b/cmd/clusterctl/client/tree/util.go @@ -21,9 +21,10 @@ import ( "sort" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client" ) // GetReadyCondition returns the ReadyCondition for an object, if defined. diff --git a/cmd/clusterctl/client/upgrade.go b/cmd/clusterctl/client/upgrade.go index e7f394e8b048..267af9538717 100644 --- a/cmd/clusterctl/client/upgrade.go +++ b/cmd/clusterctl/client/upgrade.go @@ -21,6 +21,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" diff --git a/cmd/clusterctl/client/upgrade_test.go b/cmd/clusterctl/client/upgrade_test.go index 1afc31bb7610..db2798052326 100644 --- a/cmd/clusterctl/client/upgrade_test.go +++ b/cmd/clusterctl/client/upgrade_test.go @@ -23,6 +23,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/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" diff --git a/cmd/clusterctl/client/yamlprocessor/simple_processor_test.go b/cmd/clusterctl/client/yamlprocessor/simple_processor_test.go index 9d06d9f89760..2275a2c89191 100644 --- a/cmd/clusterctl/client/yamlprocessor/simple_processor_test.go +++ b/cmd/clusterctl/client/yamlprocessor/simple_processor_test.go @@ -19,6 +19,7 @@ import ( "testing" . "github.com/onsi/gomega" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) diff --git a/cmd/clusterctl/cmd/backup.go b/cmd/clusterctl/cmd/backup.go index 31ff39b5c331..ec1f30b41c8e 100644 --- a/cmd/clusterctl/cmd/backup.go +++ b/cmd/clusterctl/cmd/backup.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/completion.go b/cmd/clusterctl/cmd/completion.go index 1365b04dfbe6..481aa8862940 100644 --- a/cmd/clusterctl/cmd/completion.go +++ b/cmd/clusterctl/cmd/completion.go @@ -24,9 +24,10 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" - "sigs.k8s.io/controller-runtime/pkg/client" ) const completionBoilerPlate = `# Copyright 2021 The Kubernetes Authors. diff --git a/cmd/clusterctl/cmd/config_repositories.go b/cmd/clusterctl/cmd/config_repositories.go index 5ab496059458..dc9957c794f9 100644 --- a/cmd/clusterctl/cmd/config_repositories.go +++ b/cmd/clusterctl/cmd/config_repositories.go @@ -25,8 +25,9 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "sigs.k8s.io/cluster-api/cmd/clusterctl/client" "sigs.k8s.io/yaml" + + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) const ( diff --git a/cmd/clusterctl/cmd/delete.go b/cmd/clusterctl/cmd/delete.go index 3988cae43495..c290e54aae35 100644 --- a/cmd/clusterctl/cmd/delete.go +++ b/cmd/clusterctl/cmd/delete.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/describe_cluster.go b/cmd/clusterctl/cmd/describe_cluster.go index 3e23ac6285bd..888a8219e69e 100644 --- a/cmd/clusterctl/cmd/describe_cluster.go +++ b/cmd/clusterctl/cmd/describe_cluster.go @@ -28,10 +28,11 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/duration" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/cmd/clusterctl/cmd/describe_cluster_test.go b/cmd/clusterctl/cmd/describe_cluster_test.go index 311a21ea1ffc..38792d1d5121 100644 --- a/cmd/clusterctl/cmd/describe_cluster_test.go +++ b/cmd/clusterctl/cmd/describe_cluster_test.go @@ -26,10 +26,11 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree" "sigs.k8s.io/cluster-api/util/conditions" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) func Test_getRowName(t *testing.T) { diff --git a/cmd/clusterctl/cmd/generate_cluster.go b/cmd/clusterctl/cmd/generate_cluster.go index 4295280e3106..48d441a6a837 100644 --- a/cmd/clusterctl/cmd/generate_cluster.go +++ b/cmd/clusterctl/cmd/generate_cluster.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/generate_provider.go b/cmd/clusterctl/cmd/generate_provider.go index 84b40278e691..0816cdda8f5a 100644 --- a/cmd/clusterctl/cmd/generate_provider.go +++ b/cmd/clusterctl/cmd/generate_provider.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/generate_yaml.go b/cmd/clusterctl/cmd/generate_yaml.go index 6c6f6eabdb2b..cf09b38e023b 100644 --- a/cmd/clusterctl/cmd/generate_yaml.go +++ b/cmd/clusterctl/cmd/generate_yaml.go @@ -22,6 +22,7 @@ import ( "os" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/get_kubeconfig.go b/cmd/clusterctl/cmd/get_kubeconfig.go index eaf1d840c7fd..b5d3ae710dc2 100644 --- a/cmd/clusterctl/cmd/get_kubeconfig.go +++ b/cmd/clusterctl/cmd/get_kubeconfig.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/spf13/cobra" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/init.go b/cmd/clusterctl/cmd/init.go index 795399051020..9eaee2fd187d 100644 --- a/cmd/clusterctl/cmd/init.go +++ b/cmd/clusterctl/cmd/init.go @@ -21,6 +21,7 @@ import ( "time" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/move.go b/cmd/clusterctl/cmd/move.go index c25cc33077d6..667eb6520d80 100644 --- a/cmd/clusterctl/cmd/move.go +++ b/cmd/clusterctl/cmd/move.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/restore.go b/cmd/clusterctl/cmd/restore.go index f7db3de09edb..6b1c3d6b8e4e 100644 --- a/cmd/clusterctl/cmd/restore.go +++ b/cmd/clusterctl/cmd/restore.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/rollout.go b/cmd/clusterctl/cmd/rollout.go index 3d3b874d6209..3c8fbdf46a60 100644 --- a/cmd/clusterctl/cmd/rollout.go +++ b/cmd/clusterctl/cmd/rollout.go @@ -18,6 +18,7 @@ package cmd import ( "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/rollout" ) diff --git a/cmd/clusterctl/cmd/rollout/pause.go b/cmd/clusterctl/cmd/rollout/pause.go index 56691abbafd2..cf866a6e9684 100644 --- a/cmd/clusterctl/cmd/rollout/pause.go +++ b/cmd/clusterctl/cmd/rollout/pause.go @@ -20,6 +20,7 @@ package rollout import ( "github.com/spf13/cobra" "k8s.io/kubectl/pkg/util/templates" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/rollout/restart.go b/cmd/clusterctl/cmd/rollout/restart.go index 0446e5eb9987..54d27a8fb5cd 100644 --- a/cmd/clusterctl/cmd/rollout/restart.go +++ b/cmd/clusterctl/cmd/rollout/restart.go @@ -19,6 +19,7 @@ package rollout import ( "github.com/spf13/cobra" "k8s.io/kubectl/pkg/util/templates" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/rollout/resume.go b/cmd/clusterctl/cmd/rollout/resume.go index 0c750629377f..4e2042a5f4d8 100644 --- a/cmd/clusterctl/cmd/rollout/resume.go +++ b/cmd/clusterctl/cmd/rollout/resume.go @@ -19,6 +19,7 @@ package rollout import ( "github.com/spf13/cobra" "k8s.io/kubectl/pkg/util/templates" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/rollout/undo.go b/cmd/clusterctl/cmd/rollout/undo.go index d51b6aca7cb3..7b53242fd0ac 100644 --- a/cmd/clusterctl/cmd/rollout/undo.go +++ b/cmd/clusterctl/cmd/rollout/undo.go @@ -19,6 +19,7 @@ package rollout import ( "github.com/spf13/cobra" "k8s.io/kubectl/pkg/util/templates" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/root.go b/cmd/clusterctl/cmd/root.go index 9e6305f949b7..277718499f1e 100644 --- a/cmd/clusterctl/cmd/root.go +++ b/cmd/clusterctl/cmd/root.go @@ -28,6 +28,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/client-go/util/homedir" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" ) diff --git a/cmd/clusterctl/cmd/upgrade.go b/cmd/clusterctl/cmd/upgrade.go index 3f07279b8307..a21f0e7fe709 100644 --- a/cmd/clusterctl/cmd/upgrade.go +++ b/cmd/clusterctl/cmd/upgrade.go @@ -20,6 +20,7 @@ import ( "sort" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/upgrade_apply.go b/cmd/clusterctl/cmd/upgrade_apply.go index 3c681b16d65d..a54c733d1c83 100644 --- a/cmd/clusterctl/cmd/upgrade_apply.go +++ b/cmd/clusterctl/cmd/upgrade_apply.go @@ -19,6 +19,7 @@ package cmd import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/upgrade_plan.go b/cmd/clusterctl/cmd/upgrade_plan.go index 0cc0173499b6..00f711e8a53c 100644 --- a/cmd/clusterctl/cmd/upgrade_plan.go +++ b/cmd/clusterctl/cmd/upgrade_plan.go @@ -22,6 +22,7 @@ import ( "text/tabwriter" "github.com/spf13/cobra" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/util.go b/cmd/clusterctl/cmd/util.go index 7dc6459ad686..8c1f6163635f 100644 --- a/cmd/clusterctl/cmd/util.go +++ b/cmd/clusterctl/cmd/util.go @@ -27,6 +27,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/cmd/version.go b/cmd/clusterctl/cmd/version.go index 6a86d19fa21f..5e929469c260 100644 --- a/cmd/clusterctl/cmd/version.go +++ b/cmd/clusterctl/cmd/version.go @@ -22,8 +22,9 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/yaml" + + "sigs.k8s.io/cluster-api/version" ) // Version provides the version information of clusterctl. diff --git a/cmd/clusterctl/cmd/version_checker.go b/cmd/clusterctl/cmd/version_checker.go index 0bc81f93fcf3..7dce924554d2 100644 --- a/cmd/clusterctl/cmd/version_checker.go +++ b/cmd/clusterctl/cmd/version_checker.go @@ -30,10 +30,11 @@ import ( "github.com/pkg/errors" "golang.org/x/oauth2" "k8s.io/client-go/util/homedir" + "sigs.k8s.io/yaml" + "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/version" - "sigs.k8s.io/yaml" ) var ( diff --git a/cmd/clusterctl/cmd/version_checker_test.go b/cmd/clusterctl/cmd/version_checker_test.go index 48dd1e2da576..0ca77cfad89a 100644 --- a/cmd/clusterctl/cmd/version_checker_test.go +++ b/cmd/clusterctl/cmd/version_checker_test.go @@ -26,9 +26,10 @@ import ( . "github.com/onsi/gomega" "k8s.io/client-go/util/homedir" + "sigs.k8s.io/yaml" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/version" - "sigs.k8s.io/yaml" ) func TestVersionChecker_newVersionChecker(t *testing.T) { diff --git a/cmd/clusterctl/internal/scheme/scheme.go b/cmd/clusterctl/internal/scheme/scheme.go index 3a6747e6f001..4ecaec819772 100644 --- a/cmd/clusterctl/internal/scheme/scheme.go +++ b/cmd/clusterctl/internal/scheme/scheme.go @@ -24,6 +24,7 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" diff --git a/cmd/clusterctl/internal/test/fake_objects.go b/cmd/clusterctl/internal/test/fake_objects.go index 5a3a6f114b62..c7ed64453ab0 100644 --- a/cmd/clusterctl/internal/test/fake_objects.go +++ b/cmd/clusterctl/internal/test/fake_objects.go @@ -26,6 +26,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" fakebootstrap "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/bootstrap" @@ -35,8 +38,6 @@ import ( addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/internal/builder" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) type FakeCluster struct { diff --git a/cmd/clusterctl/internal/test/fake_proxy.go b/cmd/clusterctl/internal/test/fake_proxy.go index 94d81d4fc223..f4b40bf7fa23 100644 --- a/cmd/clusterctl/internal/test/fake_proxy.go +++ b/cmd/clusterctl/internal/test/fake_proxy.go @@ -26,6 +26,9 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" fakebootstrap "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/bootstrap" @@ -34,8 +37,6 @@ import ( fakeinfrastructure "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/infrastructure" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) type FakeProxy struct { diff --git a/cmd/clusterctl/internal/test/fake_reader.go b/cmd/clusterctl/internal/test/fake_reader.go index 178997ebdab0..f33c672caebb 100644 --- a/cmd/clusterctl/internal/test/fake_reader.go +++ b/cmd/clusterctl/internal/test/fake_reader.go @@ -18,8 +18,9 @@ package test import ( "github.com/pkg/errors" - clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/yaml" + + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) // FakeReader provider a reader implementation backed by a map. diff --git a/cmd/clusterctl/internal/util/objs.go b/cmd/clusterctl/internal/util/objs.go index fc78d2bf623c..b92d4b2b8a95 100644 --- a/cmd/clusterctl/internal/util/objs.go +++ b/cmd/clusterctl/internal/util/objs.go @@ -22,6 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" ) diff --git a/cmd/clusterctl/main.go b/cmd/clusterctl/main.go index b0615ffa4635..8179fe8942fd 100644 --- a/cmd/clusterctl/main.go +++ b/cmd/clusterctl/main.go @@ -18,6 +18,7 @@ package main import ( _ "k8s.io/client-go/plugin/pkg/client/auth" + "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd" ) diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index 8ee94dde2832..e6df61eb49e9 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -29,6 +29,14 @@ import ( "k8s.io/apimachinery/pkg/runtime" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -39,13 +47,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" ) const ( diff --git a/controllers/cluster_controller_phases.go b/controllers/cluster_controller_phases.go index 09e49fb0e7c6..f0c73b93f60a 100644 --- a/controllers/cluster_controller_phases.go +++ b/controllers/cluster_controller_phases.go @@ -25,6 +25,10 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" @@ -35,9 +39,6 @@ import ( "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" ) func (r *ClusterReconciler) reconcilePhase(_ context.Context, cluster *clusterv1.Cluster) { diff --git a/controllers/cluster_controller_phases_test.go b/controllers/cluster_controller_phases_test.go index 552ecd85eee3..79d6272ff7ea 100644 --- a/controllers/cluster_controller_phases_test.go +++ b/controllers/cluster_controller_phases_test.go @@ -24,12 +24,13 @@ 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/v1beta1" - capierrors "sigs.k8s.io/cluster-api/errors" - "sigs.k8s.io/cluster-api/internal/builder" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capierrors "sigs.k8s.io/cluster-api/errors" + "sigs.k8s.io/cluster-api/internal/builder" ) func TestClusterReconcilePhases(t *testing.T) { diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index 6f5e8d71079c..2dd3199a365a 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -23,15 +23,16 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) const ( diff --git a/controllers/external/tracker.go b/controllers/external/tracker.go index 813d73bd889c..ee35b481c23b 100644 --- a/controllers/external/tracker.go +++ b/controllers/external/tracker.go @@ -23,11 +23,12 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api/util/predicates" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" + + "sigs.k8s.io/cluster-api/util/predicates" ) // ObjectTracker is a helper struct to deal when watching external unstructured objects. diff --git a/controllers/external/tracker_test.go b/controllers/external/tracker_test.go index fe97bdd77b61..fd4c7d2dd9cf 100644 --- a/controllers/external/tracker_test.go +++ b/controllers/external/tracker_test.go @@ -23,12 +23,13 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - 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" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/external/util.go b/controllers/external/util.go index 72299e4ccf53..fde450016080 100644 --- a/controllers/external/util.go +++ b/controllers/external/util.go @@ -25,8 +25,9 @@ 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/v1beta1" ) // Get uses the client and reference to get an external, unstructured object. diff --git a/controllers/external/util_test.go b/controllers/external/util_test.go index 0815d867eb65..3deb8c0840bf 100644 --- a/controllers/external/util_test.go +++ b/controllers/external/util_test.go @@ -25,10 +25,11 @@ 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/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/internal/mdutil/util.go b/controllers/internal/mdutil/util.go index 05f710fbbe27..8a3f885c08db 100644 --- a/controllers/internal/mdutil/util.go +++ b/controllers/internal/mdutil/util.go @@ -34,6 +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/v1beta1" "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/controllers/internal/mdutil/util_test.go b/controllers/internal/mdutil/util_test.go index 8838724f3b8e..1b508d3951a8 100644 --- a/controllers/internal/mdutil/util_test.go +++ b/controllers/internal/mdutil/util_test.go @@ -30,6 +30,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/v1beta1" ) diff --git a/controllers/machine_controller.go b/controllers/machine_controller.go index 4cfedad5c92d..c26648532fb8 100644 --- a/controllers/machine_controller.go +++ b/controllers/machine_controller.go @@ -33,6 +33,14 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2" kubedrain "k8s.io/kubectl/pkg/drain" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" @@ -44,13 +52,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" ) const ( diff --git a/controllers/machine_controller_node_labels.go b/controllers/machine_controller_node_labels.go index dddcfc917aa3..f56fc0a59cff 100644 --- a/controllers/machine_controller_node_labels.go +++ b/controllers/machine_controller_node_labels.go @@ -21,12 +21,13 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) func (r *MachineReconciler) reconcileInterruptibleNodeLabel(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) (ctrl.Result, error) { diff --git a/controllers/machine_controller_node_labels_test.go b/controllers/machine_controller_node_labels_test.go index 21959b25dcaa..de9d7dab7744 100644 --- a/controllers/machine_controller_node_labels_test.go +++ b/controllers/machine_controller_node_labels_test.go @@ -28,11 +28,12 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + 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" - "sigs.k8s.io/controller-runtime/pkg/log" ) func TestReconcileInterruptibleNodeLabel(t *testing.T) { diff --git a/controllers/machine_controller_noderef.go b/controllers/machine_controller_noderef.go index cdf7c7694822..52e439b0178a 100644 --- a/controllers/machine_controller_noderef.go +++ b/controllers/machine_controller_noderef.go @@ -23,6 +23,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/noderefutil" @@ -30,8 +33,6 @@ import ( "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( diff --git a/controllers/machine_controller_noderef_test.go b/controllers/machine_controller_noderef_test.go index 1e73f3fc21cd..ddd6da6e9944 100644 --- a/controllers/machine_controller_noderef_test.go +++ b/controllers/machine_controller_noderef_test.go @@ -22,14 +22,15 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/controllers/noderefutil" - "sigs.k8s.io/cluster-api/controllers/remote" - "sigs.k8s.io/cluster-api/util" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + 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" ) func TestGetNode(t *testing.T) { diff --git a/controllers/machine_controller_phases.go b/controllers/machine_controller_phases.go index eae532f4a328..365fae865444 100644 --- a/controllers/machine_controller_phases.go +++ b/controllers/machine_controller_phases.go @@ -28,6 +28,10 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" @@ -36,9 +40,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" ) var ( diff --git a/controllers/machine_controller_phases_test.go b/controllers/machine_controller_phases_test.go index 01f6a581c920..a4bd74ada27f 100644 --- a/controllers/machine_controller_phases_test.go +++ b/controllers/machine_controller_phases_test.go @@ -30,15 +30,16 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/log" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/kubeconfig" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/log" ) func init() { diff --git a/controllers/machine_controller_test.go b/controllers/machine_controller_test.go index 38418f6dd22a..b6ef4b97177f 100644 --- a/controllers/machine_controller_test.go +++ b/controllers/machine_controller_test.go @@ -28,17 +28,18 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) func TestWatches(t *testing.T) { diff --git a/controllers/machinedeployment_controller.go b/controllers/machinedeployment_controller.go index 2e84bd975557..d204d72235b9 100644 --- a/controllers/machinedeployment_controller.go +++ b/controllers/machinedeployment_controller.go @@ -27,17 +27,18 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + 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" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) var ( diff --git a/controllers/machinedeployment_controller_test.go b/controllers/machinedeployment_controller_test.go index 23b499131e15..78fbee182973 100644 --- a/controllers/machinedeployment_controller_test.go +++ b/controllers/machinedeployment_controller_test.go @@ -25,13 +25,14 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( diff --git a/controllers/machinedeployment_rolling.go b/controllers/machinedeployment_rolling.go index 6e644d61fafc..5a9ead65064b 100644 --- a/controllers/machinedeployment_rolling.go +++ b/controllers/machinedeployment_rolling.go @@ -22,10 +22,11 @@ import ( "github.com/pkg/errors" "k8s.io/utils/integer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/controllers/internal/mdutil" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/internal/mdutil" ) // rolloutRolling implements the logic for rolling a new MachineSet. diff --git a/controllers/machinedeployment_rolling_test.go b/controllers/machinedeployment_rolling_test.go index 4de68a746124..7b7b800b7810 100644 --- a/controllers/machinedeployment_rolling_test.go +++ b/controllers/machinedeployment_rolling_test.go @@ -25,10 +25,11 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/controllers/internal/mdutil" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/internal/mdutil" ) func TestReconcileNewMachineSet(t *testing.T) { diff --git a/controllers/machinedeployment_rollout_ondelete.go b/controllers/machinedeployment_rollout_ondelete.go index 09f28816a557..9b1d2dd2b181 100644 --- a/controllers/machinedeployment_rollout_ondelete.go +++ b/controllers/machinedeployment_rollout_ondelete.go @@ -22,11 +22,12 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/internal/mdutil" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) // rolloutOnDelete implements the logic for the OnDelete MachineDeploymentStrategyType. diff --git a/controllers/machinedeployment_sync.go b/controllers/machinedeployment_sync.go index 9d3780a7946e..04a2bb4d782d 100644 --- a/controllers/machinedeployment_sync.go +++ b/controllers/machinedeployment_sync.go @@ -29,6 +29,10 @@ import ( apirand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/internal/mdutil" "sigs.k8s.io/cluster-api/feature" @@ -36,9 +40,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/labels" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) // sync is responsible for reconciling deployments on scaling events or when they diff --git a/controllers/machinedeployment_sync_test.go b/controllers/machinedeployment_sync_test.go index 994426d89fb2..8f7367d64f1c 100644 --- a/controllers/machinedeployment_sync_test.go +++ b/controllers/machinedeployment_sync_test.go @@ -27,11 +27,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/internal/mdutil" capierrors "sigs.k8s.io/cluster-api/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestCalculateStatus(t *testing.T) { diff --git a/controllers/machinehealthcheck_controller.go b/controllers/machinehealthcheck_controller.go index 4ca1810e22d6..8d088ee4fb32 100644 --- a/controllers/machinehealthcheck_controller.go +++ b/controllers/machinehealthcheck_controller.go @@ -34,6 +34,13 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" @@ -43,12 +50,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" ) const ( diff --git a/controllers/machinehealthcheck_controller_test.go b/controllers/machinehealthcheck_controller_test.go index dd660ed61065..cd5754f65efb 100644 --- a/controllers/machinehealthcheck_controller_test.go +++ b/controllers/machinehealthcheck_controller_test.go @@ -35,6 +35,11 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/log" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" capierrors "sigs.k8s.io/cluster-api/errors" @@ -42,10 +47,6 @@ import ( "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) func TestMachineHealthCheck_Reconcile(t *testing.T) { diff --git a/controllers/machinehealthcheck_status_matcher_test.go b/controllers/machinehealthcheck_status_matcher_test.go index 73d5c08f288a..f0b4265b8e12 100644 --- a/controllers/machinehealthcheck_status_matcher_test.go +++ b/controllers/machinehealthcheck_status_matcher_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/types" + 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 f7907b1685a1..41915104ed2c 100644 --- a/controllers/machinehealthcheck_targets.go +++ b/controllers/machinehealthcheck_targets.go @@ -27,11 +27,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/controllers/machinehealthcheck_targets_test.go b/controllers/machinehealthcheck_targets_test.go index d7e776ad395a..fe24eb0168c6 100644 --- a/controllers/machinehealthcheck_targets_test.go +++ b/controllers/machinehealthcheck_targets_test.go @@ -24,12 +24,13 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util/conditions" + "sigs.k8s.io/cluster-api/util/patch" ) func TestGetTargetsFromMHC(t *testing.T) { diff --git a/controllers/machineset_controller.go b/controllers/machineset_controller.go index a8ba8a703e12..9e075b9dfe71 100644 --- a/controllers/machineset_controller.go +++ b/controllers/machineset_controller.go @@ -29,6 +29,12 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/noderefutil" @@ -40,11 +46,6 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) var ( diff --git a/controllers/machineset_controller_test.go b/controllers/machineset_controller_test.go index 25238b71756d..69e9eb97ba8d 100644 --- a/controllers/machineset_controller_test.go +++ b/controllers/machineset_controller_test.go @@ -26,14 +26,15 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/tools/record" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/reconcile" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var _ reconcile.Reconciler = &MachineSetReconciler{} diff --git a/controllers/machineset_delete_policy.go b/controllers/machineset_delete_policy.go index 9d52bfd28077..f54f2100306e 100644 --- a/controllers/machineset_delete_policy.go +++ b/controllers/machineset_delete_policy.go @@ -22,6 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/controllers/machineset_delete_policy_test.go b/controllers/machineset_delete_policy_test.go index e30124980ed8..12e31fae5218 100644 --- a/controllers/machineset_delete_policy_test.go +++ b/controllers/machineset_delete_policy_test.go @@ -22,6 +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/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/controllers/remote/cluster.go b/controllers/remote/cluster.go index 2ffd06301657..9e58038c56b7 100644 --- a/controllers/remote/cluster.go +++ b/controllers/remote/cluster.go @@ -23,8 +23,9 @@ import ( "github.com/pkg/errors" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - kcfg "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/controller-runtime/pkg/client" + + kcfg "sigs.k8s.io/cluster-api/util/kubeconfig" ) const ( diff --git a/controllers/remote/cluster_cache.go b/controllers/remote/cluster_cache.go index 2149f2c234ca..92f141855e54 100644 --- a/controllers/remote/cluster_cache.go +++ b/controllers/remote/cluster_cache.go @@ -32,8 +32,6 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" @@ -42,6 +40,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util/conditions" ) const ( diff --git a/controllers/remote/cluster_cache_healthcheck_test.go b/controllers/remote/cluster_cache_healthcheck_test.go index c15b29449412..7e46428e9bff 100644 --- a/controllers/remote/cluster_cache_healthcheck_test.go +++ b/controllers/remote/cluster_cache_healthcheck_test.go @@ -29,11 +29,12 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/klog/v2/klogr" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + 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" - "sigs.k8s.io/controller-runtime/pkg/manager" ) func TestClusterCacheHealthCheck(t *testing.T) { diff --git a/controllers/remote/cluster_cache_reconciler.go b/controllers/remote/cluster_cache_reconciler.go index cfe6d5df2664..c59b9f83c852 100644 --- a/controllers/remote/cluster_cache_reconciler.go +++ b/controllers/remote/cluster_cache_reconciler.go @@ -22,12 +22,13 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - 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" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util/predicates" ) // ClusterCacheReconciler is responsible for stopping remote cluster caches when diff --git a/controllers/remote/cluster_cache_reconciler_test.go b/controllers/remote/cluster_cache_reconciler_test.go index 06c00ba8ba00..91818497800a 100644 --- a/controllers/remote/cluster_cache_reconciler_test.go +++ b/controllers/remote/cluster_cache_reconciler_test.go @@ -26,12 +26,13 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util" ) func TestClusterCacheReconciler(t *testing.T) { diff --git a/controllers/remote/cluster_cache_tracker_test.go b/controllers/remote/cluster_cache_tracker_test.go index 63c35213921b..071f773ca99f 100644 --- a/controllers/remote/cluster_cache_tracker_test.go +++ b/controllers/remote/cluster_cache_tracker_test.go @@ -26,14 +26,15 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/conditions" ) func mapper(i client.Object) []reconcile.Request { diff --git a/controllers/remote/cluster_test.go b/controllers/remote/cluster_test.go index eb51cc01ca47..0fe782b62ec6 100644 --- a/controllers/remote/cluster_test.go +++ b/controllers/remote/cluster_test.go @@ -24,9 +24,10 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/util/secret" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + "sigs.k8s.io/cluster-api/util/secret" ) var ( diff --git a/controllers/remote/index.go b/controllers/remote/index.go index e7a13442cdc7..275b09439735 100644 --- a/controllers/remote/index.go +++ b/controllers/remote/index.go @@ -18,8 +18,9 @@ package remote import ( corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/api/v1beta1/index" ) // Index is a helper to model the info passed to cache.IndexField. diff --git a/controllers/remote/suite_test.go b/controllers/remote/suite_test.go index 792af78fa0f6..82bbd7b13720 100644 --- a/controllers/remote/suite_test.go +++ b/controllers/remote/suite_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" ) const ( diff --git a/controllers/schema_test.go b/controllers/schema_test.go index e9f244fa8331..54f13e52c53c 100644 --- a/controllers/schema_test.go +++ b/controllers/schema_test.go @@ -22,8 +22,9 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestMachineSetScheme(t *testing.T) { diff --git a/controllers/suite_test.go b/controllers/suite_test.go index b5093c69c85f..09078fde9dbb 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -32,12 +32,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller" + 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" - "sigs.k8s.io/controller-runtime/pkg/controller" ) const ( diff --git a/controllers/suite_util_test.go b/controllers/suite_util_test.go index 4bbc5496292c..8547eb643174 100644 --- a/controllers/suite_util_test.go +++ b/controllers/suite_util_test.go @@ -26,8 +26,9 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + 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 b8a29e06c122..108a1d83cb64 100644 --- a/controllers/topology/blueprint.go +++ b/controllers/topology/blueprint.go @@ -20,10 +20,11 @@ import ( "context" "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + 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/controller-runtime/pkg/client" ) // getBlueprint gets a ClusterBlueprint with the ClusterClass and the referenced templates to be used for a managed Cluster topology. diff --git a/controllers/topology/blueprint_test.go b/controllers/topology/blueprint_test.go index f9ee1028b0e0..c909c76bf4ac 100644 --- a/controllers/topology/blueprint_test.go +++ b/controllers/topology/blueprint_test.go @@ -21,12 +21,13 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/builder" . "sigs.k8s.io/cluster-api/internal/matchers" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestGetBlueprint(t *testing.T) { diff --git a/controllers/topology/cluster_controller.go b/controllers/topology/cluster_controller.go index 80615dcb6468..ea4679053249 100644 --- a/controllers/topology/cluster_controller.go +++ b/controllers/topology/cluster_controller.go @@ -25,6 +25,13 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" @@ -34,12 +41,6 @@ import ( "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/builder" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io,resources=*,verbs=get;list;watch;create;update;patch;delete diff --git a/controllers/topology/cluster_controller_test.go b/controllers/topology/cluster_controller_test.go index 8c28f1cceef2..9708ae419cfd 100644 --- a/controllers/topology/cluster_controller_test.go +++ b/controllers/topology/cluster_controller_test.go @@ -26,13 +26,14 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( diff --git a/controllers/topology/clusterclass_controller.go b/controllers/topology/clusterclass_controller.go index 9f2e3c3d9026..d1e7b559d6f5 100644 --- a/controllers/topology/clusterclass_controller.go +++ b/controllers/topology/clusterclass_controller.go @@ -25,6 +25,11 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + 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" @@ -32,10 +37,6 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io;controlplane.cluster.x-k8s.io,resources=*,verbs=get;list;watch;update;patch diff --git a/controllers/topology/clusterclass_controller_test.go b/controllers/topology/clusterclass_controller_test.go index 6af078f6617a..04a8dde7bc38 100644 --- a/controllers/topology/clusterclass_controller_test.go +++ b/controllers/topology/clusterclass_controller_test.go @@ -26,11 +26,12 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/internal/builder" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestClusterClassReconciler_reconcile(t *testing.T) { diff --git a/controllers/topology/conditions.go b/controllers/topology/conditions.go index 0c6a2de0ec5d..bf6871e4f7a6 100644 --- a/controllers/topology/conditions.go +++ b/controllers/topology/conditions.go @@ -21,6 +21,7 @@ import ( "strings" "github.com/pkg/errors" + 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/conditions_test.go b/controllers/topology/conditions_test.go index 0da959a28ac6..c4dca0099f2e 100644 --- a/controllers/topology/conditions_test.go +++ b/controllers/topology/conditions_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/builder" diff --git a/controllers/topology/current_state.go b/controllers/topology/current_state.go index 7ab173e52788..5e0518d884a6 100644 --- a/controllers/topology/current_state.go +++ b/controllers/topology/current_state.go @@ -22,12 +22,13 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" "sigs.k8s.io/cluster-api/util/labels" - "sigs.k8s.io/controller-runtime/pkg/client" ) // getCurrentState gets information about the current state of a Cluster by inspecting the state of the InfrastructureCluster, diff --git a/controllers/topology/current_state_test.go b/controllers/topology/current_state_test.go index f535bf761201..4794f77b90ef 100644 --- a/controllers/topology/current_state_test.go +++ b/controllers/topology/current_state_test.go @@ -21,12 +21,13 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/builder" . "sigs.k8s.io/cluster-api/internal/matchers" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestGetCurrentState(t *testing.T) { diff --git a/controllers/topology/desired_state.go b/controllers/topology/desired_state.go index 6547b2cdb7c0..96e43ee8311d 100644 --- a/controllers/topology/desired_state.go +++ b/controllers/topology/desired_state.go @@ -26,13 +26,14 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apiserver/pkg/storage/names" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + 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" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) // computeDesiredState computes the desired state of the cluster topology. diff --git a/controllers/topology/desired_state_test.go b/controllers/topology/desired_state_test.go index d8b38998ecb6..7710933cd1bd 100644 --- a/controllers/topology/desired_state_test.go +++ b/controllers/topology/desired_state_test.go @@ -25,11 +25,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + 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/cluster-api/internal/builder" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) var ( diff --git a/controllers/topology/internal/contract/controlplane.go b/controllers/topology/internal/contract/controlplane.go index e2c5f04d16dc..e1098813ebf3 100644 --- a/controllers/topology/internal/contract/controlplane.go +++ b/controllers/topology/internal/contract/controlplane.go @@ -22,6 +22,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/cluster-api/util/version" ) diff --git a/controllers/topology/internal/contract/controlplane_test.go b/controllers/topology/internal/contract/controlplane_test.go index 7afa4ad7ecd2..f3f7d3ca2be9 100644 --- a/controllers/topology/internal/contract/controlplane_test.go +++ b/controllers/topology/internal/contract/controlplane_test.go @@ -23,6 +23,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/v1beta1" ) diff --git a/controllers/topology/internal/contract/metadata.go b/controllers/topology/internal/contract/metadata.go index 801a148cd646..e5b7f966a990 100644 --- a/controllers/topology/internal/contract/metadata.go +++ b/controllers/topology/internal/contract/metadata.go @@ -19,6 +19,7 @@ package contract import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/controllers/topology/internal/contract/metadata_test.go b/controllers/topology/internal/contract/metadata_test.go index 9921a4382b2e..9721c4f9f526 100644 --- a/controllers/topology/internal/contract/metadata_test.go +++ b/controllers/topology/internal/contract/metadata_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/controllers/topology/internal/extensions/patches/engine.go b/controllers/topology/internal/extensions/patches/engine.go index 59fe28fe7fc5..b60c593594c7 100644 --- a/controllers/topology/internal/extensions/patches/engine.go +++ b/controllers/topology/internal/extensions/patches/engine.go @@ -22,6 +22,7 @@ import ( jsonpatch "github.com/evanphx/json-patch/v5" "github.com/pkg/errors" + 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/extensions/patches/api" diff --git a/controllers/topology/internal/extensions/patches/engine_test.go b/controllers/topology/internal/extensions/patches/engine_test.go index bb2285170f0a..831a6c96ce14 100644 --- a/controllers/topology/internal/extensions/patches/engine_test.go +++ b/controllers/topology/internal/extensions/patches/engine_test.go @@ -28,6 +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/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/api" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" diff --git a/controllers/topology/internal/extensions/patches/inline/json_patch_generator.go b/controllers/topology/internal/extensions/patches/inline/json_patch_generator.go index bb609e75fa47..64b9e8c60f76 100644 --- a/controllers/topology/internal/extensions/patches/inline/json_patch_generator.go +++ b/controllers/topology/internal/extensions/patches/inline/json_patch_generator.go @@ -30,10 +30,11 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/utils/pointer" + "sigs.k8s.io/yaml" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/api" patchvariables "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/variables" - "sigs.k8s.io/yaml" ) // jsonPatchGenerator generates JSON patches for a GenerateRequest based on a ClusterClassPatch. diff --git a/controllers/topology/internal/extensions/patches/inline/json_patch_generator_test.go b/controllers/topology/internal/extensions/patches/inline/json_patch_generator_test.go index a8994f07d5be..036f29defe0d 100644 --- a/controllers/topology/internal/extensions/patches/inline/json_patch_generator_test.go +++ b/controllers/topology/internal/extensions/patches/inline/json_patch_generator_test.go @@ -25,6 +25,7 @@ import ( . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/api" patchvariables "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/variables" diff --git a/controllers/topology/internal/extensions/patches/patch.go b/controllers/topology/internal/extensions/patches/patch.go index 51809abc1260..8b339c55ea4e 100644 --- a/controllers/topology/internal/extensions/patches/patch.go +++ b/controllers/topology/internal/extensions/patches/patch.go @@ -26,6 +26,7 @@ import ( "github.com/pkg/errors" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" ) diff --git a/controllers/topology/internal/extensions/patches/patch_test.go b/controllers/topology/internal/extensions/patches/patch_test.go index 2e1b41b30e2c..35a427884dce 100644 --- a/controllers/topology/internal/extensions/patches/patch_test.go +++ b/controllers/topology/internal/extensions/patches/patch_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" ) diff --git a/controllers/topology/internal/extensions/patches/template.go b/controllers/topology/internal/extensions/patches/template.go index 06fdd698d559..d416746fec26 100644 --- a/controllers/topology/internal/extensions/patches/template.go +++ b/controllers/topology/internal/extensions/patches/template.go @@ -23,6 +23,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/extensions/patches/api" ) diff --git a/controllers/topology/internal/extensions/patches/variables/variables.go b/controllers/topology/internal/extensions/patches/variables/variables.go index 07638fb11cc7..22dbdb43a2c6 100644 --- a/controllers/topology/internal/extensions/patches/variables/variables.go +++ b/controllers/topology/internal/extensions/patches/variables/variables.go @@ -24,6 +24,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" ) diff --git a/controllers/topology/internal/extensions/patches/variables/variables_test.go b/controllers/topology/internal/extensions/patches/variables/variables_test.go index b1a1a4dbb026..358810b8ed92 100644 --- a/controllers/topology/internal/extensions/patches/variables/variables_test.go +++ b/controllers/topology/internal/extensions/patches/variables/variables_test.go @@ -24,6 +24,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/v1beta1" "sigs.k8s.io/cluster-api/internal/builder" ) diff --git a/controllers/topology/internal/log/log.go b/controllers/topology/internal/log/log.go index 01d1b938208d..b946000d9b59 100644 --- a/controllers/topology/internal/log/log.go +++ b/controllers/topology/internal/log/log.go @@ -22,9 +22,10 @@ import ( "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // LoggerFrom returns a logger with predefined values from a context.Context. diff --git a/controllers/topology/internal/mergepatch/mergepatch.go b/controllers/topology/internal/mergepatch/mergepatch.go index ddbebd1a5f20..f6b9ffb023f4 100644 --- a/controllers/topology/internal/mergepatch/mergepatch.go +++ b/controllers/topology/internal/mergepatch/mergepatch.go @@ -24,9 +24,10 @@ import ( jsonpatch "github.com/evanphx/json-patch/v5" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" ) // Helper helps with a patch that yields the modified document when applied to the original document. diff --git a/controllers/topology/internal/mergepatch/mergepatch_test.go b/controllers/topology/internal/mergepatch/mergepatch_test.go index 5996367fa87c..bf0c031d07ac 100644 --- a/controllers/topology/internal/mergepatch/mergepatch_test.go +++ b/controllers/topology/internal/mergepatch/mergepatch_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" ) diff --git a/controllers/topology/internal/scope/blueprint.go b/controllers/topology/internal/scope/blueprint.go index 8f9a8b3bf638..77ff226080dc 100644 --- a/controllers/topology/internal/scope/blueprint.go +++ b/controllers/topology/internal/scope/blueprint.go @@ -18,6 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/controllers/topology/internal/scope/state.go b/controllers/topology/internal/scope/state.go index 3c695e07d288..ad5121d5e6f9 100644 --- a/controllers/topology/internal/scope/state.go +++ b/controllers/topology/internal/scope/state.go @@ -18,6 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/internal/mdutil" ) diff --git a/controllers/topology/machinedeployment_controller.go b/controllers/topology/machinedeployment_controller.go index 62854d5d06ed..ae98adc56560 100644 --- a/controllers/topology/machinedeployment_controller.go +++ b/controllers/topology/machinedeployment_controller.go @@ -21,16 +21,17 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + 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" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io,resources=*,verbs=delete diff --git a/controllers/topology/machinedeployment_controller_test.go b/controllers/topology/machinedeployment_controller_test.go index d667d665081c..bd84e5fc8450 100644 --- a/controllers/topology/machinedeployment_controller_test.go +++ b/controllers/topology/machinedeployment_controller_test.go @@ -24,11 +24,12 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/internal/builder" ) func TestMachineDeploymentReconciler_ReconcileDelete(t *testing.T) { diff --git a/controllers/topology/machineset_controller.go b/controllers/topology/machineset_controller.go index e1afd6eeda5a..b56f657716bb 100644 --- a/controllers/topology/machineset_controller.go +++ b/controllers/topology/machineset_controller.go @@ -23,16 +23,17 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + 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" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io;bootstrap.cluster.x-k8s.io,resources=*,verbs=delete diff --git a/controllers/topology/machineset_controller_test.go b/controllers/topology/machineset_controller_test.go index 958553e0fe7d..30d3c73a014b 100644 --- a/controllers/topology/machineset_controller_test.go +++ b/controllers/topology/machineset_controller_test.go @@ -21,11 +21,12 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/internal/builder" ) func TestMachineSetReconciler_ReconcileDelete(t *testing.T) { diff --git a/controllers/topology/reconcile_state.go b/controllers/topology/reconcile_state.go index 05ffd3b8bd8a..5323312fb9dc 100644 --- a/controllers/topology/reconcile_state.go +++ b/controllers/topology/reconcile_state.go @@ -27,13 +27,14 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apiserver/pkg/storage/names" + "sigs.k8s.io/controller-runtime/pkg/client" + 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/mergepatch" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/topology/check" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/controllers/topology/reconcile_state_test.go b/controllers/topology/reconcile_state_test.go index 77adaa5e6628..2bb1e951025d 100644 --- a/controllers/topology/reconcile_state_test.go +++ b/controllers/topology/reconcile_state_test.go @@ -25,13 +25,14 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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/cluster-api/internal/builder" . "sigs.k8s.io/cluster-api/internal/matchers" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestReconcileShim(t *testing.T) { diff --git a/controllers/topology/suite_test.go b/controllers/topology/suite_test.go index a5e6a62a1bf2..6e9fa2aea12e 100644 --- a/controllers/topology/suite_test.go +++ b/controllers/topology/suite_test.go @@ -27,12 +27,13 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/api/v1beta1/index" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/controllers/topology/util.go b/controllers/topology/util.go index e1448591c1f5..27790570dcf4 100644 --- a/controllers/topology/util.go +++ b/controllers/topology/util.go @@ -26,11 +26,12 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) // bootstrapTemplateNamePrefix calculates the name prefix for a BootstrapTemplate. diff --git a/controllers/topology/util_test.go b/controllers/topology/util_test.go index 9a3dac1a5d3c..571d43b01d4f 100644 --- a/controllers/topology/util_test.go +++ b/controllers/topology/util_test.go @@ -24,12 +24,13 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/internal/builder" . "sigs.k8s.io/cluster-api/internal/matchers" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestGetReference(t *testing.T) { diff --git a/controlplane/kubeadm/api/v1alpha3/conversion.go b/controlplane/kubeadm/api/v1alpha3/conversion.go index 9c9460c1f087..0992f139f06f 100644 --- a/controlplane/kubeadm/api/v1alpha3/conversion.go +++ b/controlplane/kubeadm/api/v1alpha3/conversion.go @@ -18,10 +18,11 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *KubeadmControlPlane) ConvertTo(destRaw conversion.Hub) error { diff --git a/controlplane/kubeadm/api/v1alpha3/conversion_test.go b/controlplane/kubeadm/api/v1alpha3/conversion_test.go index 8c8e8756fa0f..2d23a5d9bd10 100644 --- a/controlplane/kubeadm/api/v1alpha3/conversion_test.go +++ b/controlplane/kubeadm/api/v1alpha3/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" diff --git a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_types.go index ed230205ebe2..1dfc2f20035e 100644 --- a/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_types.go +++ b/controlplane/kubeadm/api/v1alpha3/kubeadm_control_plane_types.go @@ -20,6 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" diff --git a/controlplane/kubeadm/api/v1alpha3/suite_test.go b/controlplane/kubeadm/api/v1alpha3/suite_test.go index d951964c21e5..41e7f9e08430 100644 --- a/controlplane/kubeadm/api/v1alpha3/suite_test.go +++ b/controlplane/kubeadm/api/v1alpha3/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/controlplane/kubeadm/api/v1alpha3/webhook_test.go b/controlplane/kubeadm/api/v1alpha3/webhook_test.go index deb6f5faf431..9008b7f4dad8 100644 --- a/controlplane/kubeadm/api/v1alpha3/webhook_test.go +++ b/controlplane/kubeadm/api/v1alpha3/webhook_test.go @@ -24,10 +24,11 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestKubeadmControlPlaneConversion(t *testing.T) { diff --git a/controlplane/kubeadm/api/v1alpha4/conversion.go b/controlplane/kubeadm/api/v1alpha4/conversion.go index e0bea8021e7e..807c755fa514 100644 --- a/controlplane/kubeadm/api/v1alpha4/conversion.go +++ b/controlplane/kubeadm/api/v1alpha4/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha4 import ( - "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ) func (src *KubeadmControlPlane) ConvertTo(destRaw conversion.Hub) error { diff --git a/controlplane/kubeadm/api/v1alpha4/conversion_test.go b/controlplane/kubeadm/api/v1alpha4/conversion_test.go index c37ccf78f9ef..67ad7f9520c1 100644 --- a/controlplane/kubeadm/api/v1alpha4/conversion_test.go +++ b/controlplane/kubeadm/api/v1alpha4/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/upstreamv1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go index f8d272ee097f..c6339d8f43b3 100644 --- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go +++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go @@ -20,6 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_types.go index 8160517388e8..641d1dccd579 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_types.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_types.go @@ -20,6 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/errors" diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go index 949c7cfae845..74e106eacc03 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook.go @@ -29,10 +29,11 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/util/container" - "sigs.k8s.io/cluster-api/util/version" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/util/container" + "sigs.k8s.io/cluster-api/util/version" ) func (in *KubeadmControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go index 862f57b3826c..2d4624a1e0ee 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadm_control_plane_webhook_test.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/pointer" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook.go b/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook.go index 5fde661a7048..c400e0700318 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook.go @@ -23,9 +23,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/feature" ) const kubeadmControlPlaneTemplateImmutableMsg = "KubeadmControlPlaneTemplate spec.template.spec field is immutable. Please create new resource instead." diff --git a/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook_test.go b/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook_test.go index f717b26c775c..b93e2a920730 100644 --- a/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook_test.go +++ b/controlplane/kubeadm/api/v1beta1/kubeadmcontrolplanetemplate_webhook_test.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" "k8s.io/utils/pointer" + "sigs.k8s.io/cluster-api/feature" ) diff --git a/controlplane/kubeadm/controllers/controller.go b/controlplane/kubeadm/controllers/controller.go index 69f4500fa7a0..acd8c6cd1d0b 100644 --- a/controlplane/kubeadm/controllers/controller.go +++ b/controlplane/kubeadm/controllers/controller.go @@ -29,6 +29,13 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" @@ -44,12 +51,6 @@ import ( "sigs.k8s.io/cluster-api/util/predicates" "sigs.k8s.io/cluster-api/util/secret" "sigs.k8s.io/cluster-api/util/version" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) // +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;patch diff --git a/controlplane/kubeadm/controllers/controller_test.go b/controlplane/kubeadm/controllers/controller_test.go index 35039e3c5211..1097d15350ef 100644 --- a/controlplane/kubeadm/controllers/controller_test.go +++ b/controlplane/kubeadm/controllers/controller_test.go @@ -34,6 +34,12 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/log" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" @@ -47,11 +53,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/log" ) func TestClusterToKubeadmControlPlane(t *testing.T) { diff --git a/controlplane/kubeadm/controllers/fakes_test.go b/controlplane/kubeadm/controllers/fakes_test.go index 3ffa529a86d2..e9de1d951413 100644 --- a/controlplane/kubeadm/controllers/fakes_test.go +++ b/controlplane/kubeadm/controllers/fakes_test.go @@ -20,11 +20,12 @@ import ( "context" "github.com/blang/semver" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" - "sigs.k8s.io/controller-runtime/pkg/client" ) type fakeManagementCluster struct { diff --git a/controlplane/kubeadm/controllers/helpers.go b/controlplane/kubeadm/controllers/helpers.go index af9631b13bd9..324200a87f06 100644 --- a/controlplane/kubeadm/controllers/helpers.go +++ b/controlplane/kubeadm/controllers/helpers.go @@ -28,6 +28,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apiserver/pkg/storage/names" + ctrl "sigs.k8s.io/controller-runtime" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" @@ -40,7 +42,6 @@ import ( "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" ) func (r *KubeadmControlPlaneReconciler) reconcileKubeconfig(ctx context.Context, cluster *clusterv1.Cluster, kcp *controlplanev1.KubeadmControlPlane) (ctrl.Result, error) { diff --git a/controlplane/kubeadm/controllers/helpers_test.go b/controlplane/kubeadm/controllers/helpers_test.go index d108a83a519b..d06e023afbb7 100644 --- a/controlplane/kubeadm/controllers/helpers_test.go +++ b/controlplane/kubeadm/controllers/helpers_test.go @@ -25,6 +25,9 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/tools/record" utilpointer "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" @@ -33,8 +36,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/secret" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestReconcileKubeconfigEmptyAPIEndpoints(t *testing.T) { diff --git a/controlplane/kubeadm/controllers/remediation.go b/controlplane/kubeadm/controllers/remediation.go index 312a0df74d06..669bde14dd62 100644 --- a/controlplane/kubeadm/controllers/remediation.go +++ b/controlplane/kubeadm/controllers/remediation.go @@ -23,14 +23,15 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) // reconcileUnhealthyMachines tries to remediate KubeadmControlPlane unhealthy machines diff --git a/controlplane/kubeadm/controllers/remediation_test.go b/controlplane/kubeadm/controllers/remediation_test.go index 769dcf530133..40367d6dff72 100644 --- a/controlplane/kubeadm/controllers/remediation_test.go +++ b/controlplane/kubeadm/controllers/remediation_test.go @@ -30,13 +30,14 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/tools/record" utilpointer "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestReconcileUnhealthyMachines(t *testing.T) { diff --git a/controlplane/kubeadm/controllers/scale.go b/controlplane/kubeadm/controllers/scale.go index 502083160b2b..0fcf1d022d38 100644 --- a/controlplane/kubeadm/controllers/scale.go +++ b/controlplane/kubeadm/controllers/scale.go @@ -25,13 +25,14 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" + ctrl "sigs.k8s.io/controller-runtime" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - ctrl "sigs.k8s.io/controller-runtime" ) func (r *KubeadmControlPlaneReconciler) initializeControlPlane(ctx context.Context, cluster *clusterv1.Cluster, kcp *controlplanev1.KubeadmControlPlane, controlPlane *internal.ControlPlane) (ctrl.Result, error) { diff --git a/controlplane/kubeadm/controllers/scale_test.go b/controlplane/kubeadm/controllers/scale_test.go index 12b102a19329..bc81bc9d8680 100644 --- a/controlplane/kubeadm/controllers/scale_test.go +++ b/controlplane/kubeadm/controllers/scale_test.go @@ -25,14 +25,15 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + 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/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestKubeadmControlPlaneReconciler_initializeControlPlane(t *testing.T) { diff --git a/controlplane/kubeadm/controllers/status.go b/controlplane/kubeadm/controllers/status.go index c79c62ba2295..1617827ff3e5 100644 --- a/controlplane/kubeadm/controllers/status.go +++ b/controlplane/kubeadm/controllers/status.go @@ -20,13 +20,14 @@ import ( "context" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - ctrl "sigs.k8s.io/controller-runtime" ) // updateStatus is called after every reconcilitation loop in a defer statement to always make sure we have the diff --git a/controlplane/kubeadm/controllers/status_test.go b/controlplane/kubeadm/controllers/status_test.go index 357660f4f2f7..264ed233ca71 100644 --- a/controlplane/kubeadm/controllers/status_test.go +++ b/controlplane/kubeadm/controllers/status_test.go @@ -26,12 +26,13 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" ) func TestKubeadmControlPlaneReconciler_updateStatusNoMachines(t *testing.T) { diff --git a/controlplane/kubeadm/controllers/suite_test.go b/controlplane/kubeadm/controllers/suite_test.go index 60ad47aea924..7d350d7cd6a9 100644 --- a/controlplane/kubeadm/controllers/suite_test.go +++ b/controlplane/kubeadm/controllers/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/controlplane/kubeadm/controllers/upgrade.go b/controlplane/kubeadm/controllers/upgrade.go index ca51168466be..9913bb6ad576 100644 --- a/controlplane/kubeadm/controllers/upgrade.go +++ b/controlplane/kubeadm/controllers/upgrade.go @@ -21,12 +21,13 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/collections" - ctrl "sigs.k8s.io/controller-runtime" ) func (r *KubeadmControlPlaneReconciler) upgradeControlPlane( diff --git a/controlplane/kubeadm/controllers/upgrade_test.go b/controlplane/kubeadm/controllers/upgrade_test.go index a3f8798635f6..4f78f0247941 100644 --- a/controlplane/kubeadm/controllers/upgrade_test.go +++ b/controlplane/kubeadm/controllers/upgrade_test.go @@ -26,12 +26,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/collections" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) const UpdatedVersion string = "v1.17.4" diff --git a/controlplane/kubeadm/internal/cluster.go b/controlplane/kubeadm/internal/cluster.go index b1c6ac390afb..5fc8e3848bb3 100644 --- a/controlplane/kubeadm/internal/cluster.go +++ b/controlplane/kubeadm/internal/cluster.go @@ -25,12 +25,13 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/secret" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/controlplane/kubeadm/internal/cluster_test.go b/controlplane/kubeadm/internal/cluster_test.go index d2d8623dfc2b..1ee2ecfac6de 100644 --- a/controlplane/kubeadm/internal/cluster_test.go +++ b/controlplane/kubeadm/internal/cluster_test.go @@ -34,14 +34,15 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/secret" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" ) func TestGetMachinesForCluster(t *testing.T) { diff --git a/controlplane/kubeadm/internal/control_plane.go b/controlplane/kubeadm/internal/control_plane.go index 6f9d33c8e195..7293a5074ed6 100644 --- a/controlplane/kubeadm/internal/control_plane.go +++ b/controlplane/kubeadm/internal/control_plane.go @@ -28,6 +28,8 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apiserver/pkg/storage/names" "k8s.io/klog/v2/klogr" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" @@ -35,7 +37,6 @@ import ( "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/failuredomains" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" ) // Log is the global logger for the internal package. diff --git a/controlplane/kubeadm/internal/control_plane_test.go b/controlplane/kubeadm/internal/control_plane_test.go index 19badf19a2dc..34f35ed764aa 100644 --- a/controlplane/kubeadm/internal/control_plane_test.go +++ b/controlplane/kubeadm/internal/control_plane_test.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" + 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" diff --git a/controlplane/kubeadm/internal/etcd/etcd.go b/controlplane/kubeadm/internal/etcd/etcd.go index 50cb9d55f48b..393ebd646a89 100644 --- a/controlplane/kubeadm/internal/etcd/etcd.go +++ b/controlplane/kubeadm/internal/etcd/etcd.go @@ -26,6 +26,7 @@ import ( "go.etcd.io/etcd/api/v3/etcdserverpb" clientv3 "go.etcd.io/etcd/client/v3" "google.golang.org/grpc" + "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/proxy" ) diff --git a/controlplane/kubeadm/internal/etcd/etcd_test.go b/controlplane/kubeadm/internal/etcd/etcd_test.go index f9ac6e846ef2..84028d357513 100644 --- a/controlplane/kubeadm/internal/etcd/etcd_test.go +++ b/controlplane/kubeadm/internal/etcd/etcd_test.go @@ -23,8 +23,9 @@ import ( "github.com/pkg/errors" "go.etcd.io/etcd/api/v3/etcdserverpb" clientv3 "go.etcd.io/etcd/client/v3" - etcdfake "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" ctrl "sigs.k8s.io/controller-runtime" + + etcdfake "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" ) var ( diff --git a/controlplane/kubeadm/internal/etcd/util/util.go b/controlplane/kubeadm/internal/etcd/util/util.go index d9327fc50a6d..00b06bec6268 100644 --- a/controlplane/kubeadm/internal/etcd/util/util.go +++ b/controlplane/kubeadm/internal/etcd/util/util.go @@ -19,6 +19,7 @@ package util import ( "k8s.io/apimachinery/pkg/util/sets" + "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" ) diff --git a/controlplane/kubeadm/internal/etcd_client_generator.go b/controlplane/kubeadm/internal/etcd_client_generator.go index 06bee636d134..569db18e6629 100644 --- a/controlplane/kubeadm/internal/etcd_client_generator.go +++ b/controlplane/kubeadm/internal/etcd_client_generator.go @@ -26,6 +26,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/rest" + "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/proxy" ) diff --git a/controlplane/kubeadm/internal/etcd_client_generator_test.go b/controlplane/kubeadm/internal/etcd_client_generator_test.go index b9840ea92a64..76f0254d28b8 100644 --- a/controlplane/kubeadm/internal/etcd_client_generator_test.go +++ b/controlplane/kubeadm/internal/etcd_client_generator_test.go @@ -27,6 +27,7 @@ import ( "go.etcd.io/etcd/api/v3/etcdserverpb" clientv3 "go.etcd.io/etcd/client/v3" "k8s.io/client-go/rest" + "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" etcdfake "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" ) diff --git a/controlplane/kubeadm/internal/filters.go b/controlplane/kubeadm/internal/filters.go index 2af862a7287b..963b82959ebf 100644 --- a/controlplane/kubeadm/internal/filters.go +++ b/controlplane/kubeadm/internal/filters.go @@ -21,11 +21,12 @@ import ( "reflect" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "sigs.k8s.io/controller-runtime/pkg/client" + 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/util/collections" - "sigs.k8s.io/controller-runtime/pkg/client" ) // MatchesMachineSpec returns a filter to find all machines that matches with KCP config and do not require any rollout. diff --git a/controlplane/kubeadm/internal/filters_test.go b/controlplane/kubeadm/internal/filters_test.go index 9c00bbfbc31c..ec96ff45aabc 100644 --- a/controlplane/kubeadm/internal/filters_test.go +++ b/controlplane/kubeadm/internal/filters_test.go @@ -23,6 +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/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" diff --git a/controlplane/kubeadm/internal/suite_test.go b/controlplane/kubeadm/internal/suite_test.go index 5e0d5fa52f86..d4f113dc8eea 100644 --- a/controlplane/kubeadm/internal/suite_test.go +++ b/controlplane/kubeadm/internal/suite_test.go @@ -20,8 +20,9 @@ import ( "os" "testing" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/controlplane/kubeadm/internal/webhooks/scale.go b/controlplane/kubeadm/internal/webhooks/scale.go index 4075603742be..7dcf0efcc2ef 100644 --- a/controlplane/kubeadm/internal/webhooks/scale.go +++ b/controlplane/kubeadm/internal/webhooks/scale.go @@ -23,11 +23,12 @@ import ( "github.com/pkg/errors" autoscalingv1 "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + + "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ) func (v *ScaleValidator) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/controlplane/kubeadm/internal/webhooks/scale_test.go b/controlplane/kubeadm/internal/webhooks/scale_test.go index 8f2f0ac3f400..91919d58ec77 100644 --- a/controlplane/kubeadm/internal/webhooks/scale_test.go +++ b/controlplane/kubeadm/internal/webhooks/scale_test.go @@ -29,10 +29,11 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/utils/pointer" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ) func init() { diff --git a/controlplane/kubeadm/internal/workload_cluster.go b/controlplane/kubeadm/internal/workload_cluster.go index 9ea74cbc26e9..f386a8be10da 100644 --- a/controlplane/kubeadm/internal/workload_cluster.go +++ b/controlplane/kubeadm/internal/workload_cluster.go @@ -37,6 +37,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/util/retry" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/yaml" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" kubeadmtypes "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types" @@ -45,8 +48,6 @@ import ( "sigs.k8s.io/cluster-api/util/certs" containerutil "sigs.k8s.io/cluster-api/util/container" "sigs.k8s.io/cluster-api/util/patch" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/yaml" ) const ( diff --git a/controlplane/kubeadm/internal/workload_cluster_conditions.go b/controlplane/kubeadm/internal/workload_cluster_conditions.go index fcf980dda711..be9e1485168a 100644 --- a/controlplane/kubeadm/internal/workload_cluster_conditions.go +++ b/controlplane/kubeadm/internal/workload_cluster_conditions.go @@ -25,13 +25,14 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" etcdutil "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/util" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) // UpdateEtcdConditions is responsible for updating machine conditions reflecting the status of all the etcd members. diff --git a/controlplane/kubeadm/internal/workload_cluster_conditions_test.go b/controlplane/kubeadm/internal/workload_cluster_conditions_test.go index 7be1050a9a27..2b44f0d90549 100644 --- a/controlplane/kubeadm/internal/workload_cluster_conditions_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_conditions_test.go @@ -27,6 +27,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" @@ -34,7 +36,6 @@ import ( fake2 "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestUpdateEtcdConditions(t *testing.T) { diff --git a/controlplane/kubeadm/internal/workload_cluster_coredns.go b/controlplane/kubeadm/internal/workload_cluster_coredns.go index 9007d949f45b..97c062e0df21 100644 --- a/controlplane/kubeadm/internal/workload_cluster_coredns.go +++ b/controlplane/kubeadm/internal/workload_cluster_coredns.go @@ -31,12 +31,13 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" containerutil "sigs.k8s.io/cluster-api/util/container" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/version" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/controlplane/kubeadm/internal/workload_cluster_coredns_test.go b/controlplane/kubeadm/internal/workload_cluster_coredns_test.go index 42acb51b6a92..77b96f45ca7b 100644 --- a/controlplane/kubeadm/internal/workload_cluster_coredns_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_coredns_test.go @@ -27,11 +27,12 @@ import ( corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestUpdateCoreDNS(t *testing.T) { diff --git a/controlplane/kubeadm/internal/workload_cluster_etcd.go b/controlplane/kubeadm/internal/workload_cluster_etcd.go index a5b1f7c3e84b..14cea12d1424 100644 --- a/controlplane/kubeadm/internal/workload_cluster_etcd.go +++ b/controlplane/kubeadm/internal/workload_cluster_etcd.go @@ -22,6 +22,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" diff --git a/controlplane/kubeadm/internal/workload_cluster_etcd_test.go b/controlplane/kubeadm/internal/workload_cluster_etcd_test.go index bae50da49730..9972cd283b69 100644 --- a/controlplane/kubeadm/internal/workload_cluster_etcd_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_etcd_test.go @@ -28,12 +28,13 @@ import ( clientv3 "go.etcd.io/etcd/client/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" fake2 "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestUpdateEtcdVersionInKubeadmConfigMap(t *testing.T) { diff --git a/controlplane/kubeadm/internal/workload_cluster_test.go b/controlplane/kubeadm/internal/workload_cluster_test.go index 01958c151c03..d6c848ddc70e 100644 --- a/controlplane/kubeadm/internal/workload_cluster_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_test.go @@ -29,12 +29,13 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestUpdateKubeProxyImageInfo(t *testing.T) { diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go index f3e6fd4319e3..eeae736663d0 100644 --- a/controlplane/kubeadm/main.go +++ b/controlplane/kubeadm/main.go @@ -37,6 +37,10 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" @@ -47,9 +51,6 @@ import ( kcpwebhooks "sigs.k8s.io/cluster-api/controlplane/kubeadm/webhooks" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/controlplane/kubeadm/webhooks/alias.go b/controlplane/kubeadm/webhooks/alias.go index f9e8dcdd3d65..8890a6d465ad 100644 --- a/controlplane/kubeadm/webhooks/alias.go +++ b/controlplane/kubeadm/webhooks/alias.go @@ -17,9 +17,10 @@ limitations under the License. package webhooks import ( - "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/webhooks" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/webhooks" ) // ScaleValidator validates KCP for replicas. diff --git a/exp/addons/api/v1alpha3/clusterresourceset_types.go b/exp/addons/api/v1alpha3/clusterresourceset_types.go index 511224e0cecc..54b7fc2029c5 100644 --- a/exp/addons/api/v1alpha3/clusterresourceset_types.go +++ b/exp/addons/api/v1alpha3/clusterresourceset_types.go @@ -19,6 +19,7 @@ package v1alpha3 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) diff --git a/exp/addons/api/v1alpha3/conversion.go b/exp/addons/api/v1alpha3/conversion.go index 271044f6bc88..1f498c1d770a 100644 --- a/exp/addons/api/v1alpha3/conversion.go +++ b/exp/addons/api/v1alpha3/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha3 import ( - "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" ) func (src *ClusterResourceSet) ConvertTo(dstRaw conversion.Hub) error { diff --git a/exp/addons/api/v1alpha3/suite_test.go b/exp/addons/api/v1alpha3/suite_test.go index d951964c21e5..41e7f9e08430 100644 --- a/exp/addons/api/v1alpha3/suite_test.go +++ b/exp/addons/api/v1alpha3/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/exp/addons/api/v1alpha3/webhook_test.go b/exp/addons/api/v1alpha3/webhook_test.go index 537b5204c78d..a2e26f7799a6 100644 --- a/exp/addons/api/v1alpha3/webhook_test.go +++ b/exp/addons/api/v1alpha3/webhook_test.go @@ -23,8 +23,9 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/util" ) func TestClusterResourceSetConversion(t *testing.T) { diff --git a/exp/addons/api/v1alpha4/clusterresourceset_types.go b/exp/addons/api/v1alpha4/clusterresourceset_types.go index 011cb0d3face..fe2b75e433f9 100644 --- a/exp/addons/api/v1alpha4/clusterresourceset_types.go +++ b/exp/addons/api/v1alpha4/clusterresourceset_types.go @@ -19,6 +19,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/exp/addons/api/v1alpha4/conversion.go b/exp/addons/api/v1alpha4/conversion.go index df08b1a893f0..3f51cd44f4b0 100644 --- a/exp/addons/api/v1alpha4/conversion.go +++ b/exp/addons/api/v1alpha4/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha4 import ( - "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" ) func (src *ClusterResourceSet) ConvertTo(dstRaw conversion.Hub) error { diff --git a/exp/addons/api/v1beta1/clusterresourceset_types.go b/exp/addons/api/v1beta1/clusterresourceset_types.go index 579034caa332..77fd7dcc5eaf 100644 --- a/exp/addons/api/v1beta1/clusterresourceset_types.go +++ b/exp/addons/api/v1beta1/clusterresourceset_types.go @@ -19,6 +19,7 @@ package v1beta1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go b/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go index eeba6b8e38b5..c307af543f6f 100644 --- a/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go +++ b/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/exp/addons/controllers/alias.go b/exp/addons/controllers/alias.go index c410e0740628..4954954dd694 100644 --- a/exp/addons/controllers/alias.go +++ b/exp/addons/controllers/alias.go @@ -19,11 +19,12 @@ package controllers import ( "context" - "sigs.k8s.io/cluster-api/controllers/remote" - clusterresourcesets "sigs.k8s.io/cluster-api/exp/addons/internal/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + "sigs.k8s.io/cluster-api/controllers/remote" + clusterresourcesets "sigs.k8s.io/cluster-api/exp/addons/internal/controllers" ) // ClusterResourceSetReconciler reconciles a ClusterResourceSet object. diff --git a/exp/addons/internal/controllers/clusterresourceset_controller.go b/exp/addons/internal/controllers/clusterresourceset_controller.go index 968a1443bc07..0e1f542cf273 100644 --- a/exp/addons/internal/controllers/clusterresourceset_controller.go +++ b/exp/addons/internal/controllers/clusterresourceset_controller.go @@ -31,14 +31,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/controllers/remote" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" - resourcepredicates "sigs.k8s.io/cluster-api/exp/addons/internal/controllers/predicates" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" @@ -47,6 +39,15 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/remote" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + resourcepredicates "sigs.k8s.io/cluster-api/exp/addons/internal/controllers/predicates" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/conditions" + "sigs.k8s.io/cluster-api/util/patch" + "sigs.k8s.io/cluster-api/util/predicates" ) var ( diff --git a/exp/addons/internal/controllers/clusterresourceset_controller_test.go b/exp/addons/internal/controllers/clusterresourceset_controller_test.go index 655f83c5d473..33bc5919c2c4 100644 --- a/exp/addons/internal/controllers/clusterresourceset_controller_test.go +++ b/exp/addons/internal/controllers/clusterresourceset_controller_test.go @@ -26,10 +26,11 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/exp/addons/internal/controllers/clusterresourceset_helpers.go b/exp/addons/internal/controllers/clusterresourceset_helpers.go index fe66bf2cb92d..037fdf24e6d1 100644 --- a/exp/addons/internal/controllers/clusterresourceset_helpers.go +++ b/exp/addons/internal/controllers/clusterresourceset_helpers.go @@ -32,12 +32,13 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/util" utilresource "sigs.k8s.io/cluster-api/util/resource" utilyaml "sigs.k8s.io/cluster-api/util/yaml" - "sigs.k8s.io/controller-runtime/pkg/client" ) var jsonListPrefix = []byte("[") diff --git a/exp/addons/internal/controllers/clusterresourceset_helpers_test.go b/exp/addons/internal/controllers/clusterresourceset_helpers_test.go index b9c756cebbbd..28dc6071eb98 100644 --- a/exp/addons/internal/controllers/clusterresourceset_helpers_test.go +++ b/exp/addons/internal/controllers/clusterresourceset_helpers_test.go @@ -26,9 +26,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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/fake" ) const ( diff --git a/exp/addons/internal/controllers/clusterresourcesetbinding_controller.go b/exp/addons/internal/controllers/clusterresourcesetbinding_controller.go index bae1a5156e58..2421c49db110 100644 --- a/exp/addons/internal/controllers/clusterresourcesetbinding_controller.go +++ b/exp/addons/internal/controllers/clusterresourcesetbinding_controller.go @@ -21,16 +21,17 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/predicates" ) // +kubebuilder:rbac:groups=addons.cluster.x-k8s.io,resources=*,verbs=get;list;watch;create;update;patch;delete diff --git a/exp/addons/internal/controllers/suite_test.go b/exp/addons/internal/controllers/suite_test.go index c2696d06e73f..a49c0f52fb11 100644 --- a/exp/addons/internal/controllers/suite_test.go +++ b/exp/addons/internal/controllers/suite_test.go @@ -24,13 +24,14 @@ import ( // +kubebuilder:scaffold:imports corev1 "k8s.io/api/core/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/remote" v1alpha4 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/exp/api/v1alpha3/conversion.go b/exp/api/v1alpha3/conversion.go index d4322d7f32c6..a57405232ca2 100644 --- a/exp/api/v1alpha3/conversion.go +++ b/exp/api/v1alpha3/conversion.go @@ -18,9 +18,10 @@ package v1alpha3 import ( apimachineryconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) // Convert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec is an autogenerated conversion function. diff --git a/exp/api/v1alpha3/conversion_test.go b/exp/api/v1alpha3/conversion_test.go index f90cf9179228..0241814c9220 100644 --- a/exp/api/v1alpha3/conversion_test.go +++ b/exp/api/v1alpha3/conversion_test.go @@ -22,6 +22,7 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" diff --git a/exp/api/v1alpha3/machinepool_types.go b/exp/api/v1alpha3/machinepool_types.go index c46b71d171b5..b014cb7bbed3 100644 --- a/exp/api/v1alpha3/machinepool_types.go +++ b/exp/api/v1alpha3/machinepool_types.go @@ -19,6 +19,7 @@ package v1alpha3 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/exp/api/v1alpha3/suite_test.go b/exp/api/v1alpha3/suite_test.go index d951964c21e5..41e7f9e08430 100644 --- a/exp/api/v1alpha3/suite_test.go +++ b/exp/api/v1alpha3/suite_test.go @@ -23,8 +23,9 @@ import ( // +kubebuilder:scaffold:imports utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/exp/api/v1alpha3/webhook_test.go b/exp/api/v1alpha3/webhook_test.go index afc793cb3334..10f1b1e8d784 100644 --- a/exp/api/v1alpha3/webhook_test.go +++ b/exp/api/v1alpha3/webhook_test.go @@ -24,9 +24,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) func TestMachinePoolConversion(t *testing.T) { diff --git a/exp/api/v1alpha4/conversion.go b/exp/api/v1alpha4/conversion.go index dc798b0bf85d..03e5befd83dd 100644 --- a/exp/api/v1alpha4/conversion.go +++ b/exp/api/v1alpha4/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha4 import ( - "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) func (src *MachinePool) ConvertTo(dstRaw conversion.Hub) error { diff --git a/exp/api/v1alpha4/conversion_test.go b/exp/api/v1alpha4/conversion_test.go index 0e50bdd07a89..32e937b47931 100644 --- a/exp/api/v1alpha4/conversion_test.go +++ b/exp/api/v1alpha4/conversion_test.go @@ -20,6 +20,7 @@ import ( "testing" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/exp/api/v1alpha4/machinepool_types.go b/exp/api/v1alpha4/machinepool_types.go index b81c1e59fb20..b4982af3ed23 100644 --- a/exp/api/v1alpha4/machinepool_types.go +++ b/exp/api/v1alpha4/machinepool_types.go @@ -19,6 +19,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/exp/api/v1beta1/machinepool_types.go b/exp/api/v1beta1/machinepool_types.go index ff546eb720ae..36bf0341b427 100644 --- a/exp/api/v1beta1/machinepool_types.go +++ b/exp/api/v1beta1/machinepool_types.go @@ -19,6 +19,7 @@ package v1beta1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/exp/api/v1beta1/machinepool_webhook.go b/exp/api/v1beta1/machinepool_webhook.go index c34e0264ae5b..de5d08d29168 100644 --- a/exp/api/v1beta1/machinepool_webhook.go +++ b/exp/api/v1beta1/machinepool_webhook.go @@ -23,9 +23,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func (m *MachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/exp/api/v1beta1/machinepool_webhook_test.go b/exp/api/v1beta1/machinepool_webhook_test.go index b751b6438dd5..6308cb93505a 100644 --- a/exp/api/v1beta1/machinepool_webhook_test.go +++ b/exp/api/v1beta1/machinepool_webhook_test.go @@ -23,6 +23,7 @@ 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/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/exp/controllers/alias.go b/exp/controllers/alias.go index 2c6228bba376..91e6f6b7e657 100644 --- a/exp/controllers/alias.go +++ b/exp/controllers/alias.go @@ -19,10 +19,11 @@ package controllers import ( "context" - machinepool "sigs.k8s.io/cluster-api/exp/internal/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + machinepool "sigs.k8s.io/cluster-api/exp/internal/controllers" ) // MachinePoolReconciler reconciles a MachinePool object. diff --git a/exp/internal/controllers/machinepool_controller.go b/exp/internal/controllers/machinepool_controller.go index 27735575961b..ca980cf7a584 100644 --- a/exp/internal/controllers/machinepool_controller.go +++ b/exp/internal/controllers/machinepool_controller.go @@ -27,6 +27,13 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/remote" @@ -36,12 +43,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) // +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;patch diff --git a/exp/internal/controllers/machinepool_controller_noderef.go b/exp/internal/controllers/machinepool_controller_noderef.go index 0b4cb46e845e..466f8c33d21f 100644 --- a/exp/internal/controllers/machinepool_controller_noderef.go +++ b/exp/internal/controllers/machinepool_controller_noderef.go @@ -23,6 +23,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" @@ -31,8 +34,6 @@ import ( "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( diff --git a/exp/internal/controllers/machinepool_controller_phases.go b/exp/internal/controllers/machinepool_controller_phases.go index f9cb766c29fb..4f8921842402 100644 --- a/exp/internal/controllers/machinepool_controller_phases.go +++ b/exp/internal/controllers/machinepool_controller_phases.go @@ -27,6 +27,11 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" @@ -35,10 +40,6 @@ import ( "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) var ( diff --git a/exp/internal/controllers/machinepool_controller_phases_test.go b/exp/internal/controllers/machinepool_controller_phases_test.go index a1ec4eb5582b..f228f08cc9b3 100644 --- a/exp/internal/controllers/machinepool_controller_phases_test.go +++ b/exp/internal/controllers/machinepool_controller_phases_test.go @@ -26,11 +26,12 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/kubeconfig" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) const ( diff --git a/exp/internal/controllers/machinepool_controller_test.go b/exp/internal/controllers/machinepool_controller_test.go index 6f3ef53aa22d..718c11674094 100644 --- a/exp/internal/controllers/machinepool_controller_test.go +++ b/exp/internal/controllers/machinepool_controller_test.go @@ -25,14 +25,15 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/conditions" ) func TestMachinePoolFinalizer(t *testing.T) { diff --git a/exp/internal/controllers/suite_test.go b/exp/internal/controllers/suite_test.go index d9c19c6818be..dba911aa5e5d 100644 --- a/exp/internal/controllers/suite_test.go +++ b/exp/internal/controllers/suite_test.go @@ -22,11 +22,12 @@ import ( "os" "testing" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller" + // +kubebuilder:scaffold:imports "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/exp/util/util.go b/exp/util/util.go index 6abf7d5c41d7..592a8ccd20ce 100644 --- a/exp/util/util.go +++ b/exp/util/util.go @@ -24,10 +24,11 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) // GetOwnerMachinePool returns the MachinePool objects owning the current resource. diff --git a/internal/builder/builders.go b/internal/builder/builders.go index 7afd5fefd58c..201449628ee1 100644 --- a/internal/builder/builders.go +++ b/internal/builder/builders.go @@ -23,8 +23,9 @@ 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/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // ClusterBuilder holds the variables and objects required to build a clusterv1.Cluster. diff --git a/internal/builder/crds.go b/internal/builder/crds.go index 7b683623beba..89e6ea8920de 100644 --- a/internal/builder/crds.go +++ b/internal/builder/crds.go @@ -25,6 +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/v1beta1" ) diff --git a/internal/envtest/environment.go b/internal/envtest/environment.go index 7740bfc94977..166e2b95f70c 100644 --- a/internal/envtest/environment.go +++ b/internal/envtest/environment.go @@ -43,6 +43,11 @@ import ( "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/manager" + 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" @@ -52,10 +57,6 @@ import ( "sigs.k8s.io/cluster-api/internal/builder" "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/webhooks" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/manager" ) func init() { diff --git a/internal/envtest/webhooks.go b/internal/envtest/webhooks.go index 64e6d0a6f89b..86bed67d3587 100644 --- a/internal/envtest/webhooks.go +++ b/internal/envtest/webhooks.go @@ -27,8 +27,9 @@ import ( admissionv1 "k8s.io/api/admissionregistration/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog/v2" - utilyaml "sigs.k8s.io/cluster-api/util/yaml" "sigs.k8s.io/controller-runtime/pkg/envtest" + + utilyaml "sigs.k8s.io/cluster-api/util/yaml" ) const ( diff --git a/internal/topology/check/compatibility.go b/internal/topology/check/compatibility.go index 02f6ff950063..1e876a5e20f4 100644 --- a/internal/topology/check/compatibility.go +++ b/internal/topology/check/compatibility.go @@ -24,8 +24,9 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // ObjectsAreStrictlyCompatible checks if two referenced objects are strictly compatible, meaning that diff --git a/internal/topology/check/compatibility_test.go b/internal/topology/check/compatibility_test.go index 73a8f788633a..7e8628e46c37 100644 --- a/internal/topology/check/compatibility_test.go +++ b/internal/topology/check/compatibility_test.go @@ -24,6 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/builder" ) diff --git a/internal/topology/variables/cluster_variable_defaulting.go b/internal/topology/variables/cluster_variable_defaulting.go index d12b92e17fb7..495aa7063518 100644 --- a/internal/topology/variables/cluster_variable_defaulting.go +++ b/internal/topology/variables/cluster_variable_defaulting.go @@ -25,6 +25,7 @@ import ( structuralschema "k8s.io/apiextensions-apiserver/pkg/apiserver/schema" structuraldefaulting "k8s.io/apiextensions-apiserver/pkg/apiserver/schema/defaulting" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/cluster_variable_defaulting_test.go b/internal/topology/variables/cluster_variable_defaulting_test.go index 74e303cc30fa..e76c51406d82 100644 --- a/internal/topology/variables/cluster_variable_defaulting_test.go +++ b/internal/topology/variables/cluster_variable_defaulting_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/cluster_variable_validation.go b/internal/topology/variables/cluster_variable_validation.go index fe3913c825d9..ce844ae247f5 100644 --- a/internal/topology/variables/cluster_variable_validation.go +++ b/internal/topology/variables/cluster_variable_validation.go @@ -23,6 +23,7 @@ import ( "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/cluster_variable_validation_test.go b/internal/topology/variables/cluster_variable_validation_test.go index 75371fdbe9a4..7441af8848de 100644 --- a/internal/topology/variables/cluster_variable_validation_test.go +++ b/internal/topology/variables/cluster_variable_validation_test.go @@ -23,6 +23,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/clusterclass_variable_validation.go b/internal/topology/variables/clusterclass_variable_validation.go index 2295594c78bf..97d6c15a9c48 100644 --- a/internal/topology/variables/clusterclass_variable_validation.go +++ b/internal/topology/variables/clusterclass_variable_validation.go @@ -27,6 +27,7 @@ import ( "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/clusterclass_variable_validation_test.go b/internal/topology/variables/clusterclass_variable_validation_test.go index 7e94e323dfbd..c25b39a92441 100644 --- a/internal/topology/variables/clusterclass_variable_validation_test.go +++ b/internal/topology/variables/clusterclass_variable_validation_test.go @@ -23,6 +23,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/schema.go b/internal/topology/variables/schema.go index 77af5b4699c6..6520665101a1 100644 --- a/internal/topology/variables/schema.go +++ b/internal/topology/variables/schema.go @@ -20,6 +20,7 @@ import ( "github.com/pkg/errors" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/topology/variables/schema_test.go b/internal/topology/variables/schema_test.go index 1b6501293cea..d1b127579bc9 100644 --- a/internal/topology/variables/schema_test.go +++ b/internal/topology/variables/schema_test.go @@ -23,6 +23,7 @@ import ( "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/webhooks/cluster.go b/internal/webhooks/cluster.go index dad7e1b1fc0c..265aae9fa088 100644 --- a/internal/webhooks/cluster.go +++ b/internal/webhooks/cluster.go @@ -26,14 +26,15 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/webhook" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/internal/topology/check" "sigs.k8s.io/cluster-api/internal/topology/variables" "sigs.k8s.io/cluster-api/util/version" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook" ) // SetupWebhookWithManager sets up Cluster webhooks. diff --git a/internal/webhooks/cluster_test.go b/internal/webhooks/cluster_test.go index 402f97fc26f1..4c07a7dfcae8 100644 --- a/internal/webhooks/cluster_test.go +++ b/internal/webhooks/cluster_test.go @@ -25,11 +25,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/internal/builder" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func TestClusterDefaultNamespaces(t *testing.T) { diff --git a/internal/webhooks/clusterclass.go b/internal/webhooks/clusterclass.go index ec815d72b9f8..206617742de5 100644 --- a/internal/webhooks/clusterclass.go +++ b/internal/webhooks/clusterclass.go @@ -27,13 +27,14 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/webhook" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/internal/topology/check" "sigs.k8s.io/cluster-api/internal/topology/variables" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/webhook" ) func (webhook *ClusterClass) SetupWebhookWithManager(mgr ctrl.Manager) error { diff --git a/internal/webhooks/clusterclass_test.go b/internal/webhooks/clusterclass_test.go index bb243199874e..998220c3071d 100644 --- a/internal/webhooks/clusterclass_test.go +++ b/internal/webhooks/clusterclass_test.go @@ -26,12 +26,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" utilfeature "k8s.io/component-base/featuregate/testing" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/feature" - "sigs.k8s.io/cluster-api/internal/builder" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/feature" + "sigs.k8s.io/cluster-api/internal/builder" ) var ( diff --git a/internal/webhooks/patch_validation.go b/internal/webhooks/patch_validation.go index f69be161e8c2..c7874e6bbe3e 100644 --- a/internal/webhooks/patch_validation.go +++ b/internal/webhooks/patch_validation.go @@ -27,6 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/internal/webhooks/patch_validation_test.go b/internal/webhooks/patch_validation_test.go index 1a6d96a0e0c8..9f918c7e600e 100644 --- a/internal/webhooks/patch_validation_test.go +++ b/internal/webhooks/patch_validation_test.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/builder" ) diff --git a/main.go b/main.go index f3e9a1de2b32..44569692ac7e 100644 --- a/main.go +++ b/main.go @@ -35,6 +35,10 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -53,9 +57,6 @@ import ( "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/cluster-api/webhooks" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/test/e2e/cluster_upgrade.go b/test/e2e/cluster_upgrade.go index 70ba0194295c..087147432bd3 100644 --- a/test/e2e/cluster_upgrade.go +++ b/test/e2e/cluster_upgrade.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/test/framework/kubetest" diff --git a/test/e2e/cluster_upgrade_test.go b/test/e2e/cluster_upgrade_test.go index c575358586f9..a9ff9b55cf23 100644 --- a/test/e2e/cluster_upgrade_test.go +++ b/test/e2e/cluster_upgrade_test.go @@ -22,6 +22,7 @@ package e2e import ( . "github.com/onsi/ginkgo" "k8s.io/utils/pointer" + "sigs.k8s.io/cluster-api/test/framework/clusterctl" ) diff --git a/test/e2e/clusterclass_changes.go b/test/e2e/clusterclass_changes.go index fd4a870ca4c6..8061fbf24123 100644 --- a/test/e2e/clusterclass_changes.go +++ b/test/e2e/clusterclass_changes.go @@ -29,6 +29,8 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/test/e2e/internal/log" @@ -36,7 +38,6 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ClusterClassChangesSpecInput is the input for ClusterClassChangesSpec. diff --git a/test/e2e/clusterctl_upgrade.go b/test/e2e/clusterctl_upgrade.go index d7b635f4704b..d5fd407a81b8 100644 --- a/test/e2e/clusterctl_upgrade.go +++ b/test/e2e/clusterctl_upgrade.go @@ -33,6 +33,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/discovery" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" @@ -41,7 +43,6 @@ import ( "sigs.k8s.io/cluster-api/test/framework/bootstrap" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( diff --git a/test/e2e/common.go b/test/e2e/common.go index 2568e58d51c6..ca37c6d8ad1c 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -25,6 +25,7 @@ import ( . "github.com/onsi/ginkgo" "github.com/onsi/gomega/types" corev1 "k8s.io/api/core/v1" + 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 a186d8df848c..968911fb68b9 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -31,12 +31,13 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + 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" "sigs.k8s.io/cluster-api/test/framework/ginkgoextensions" - ctrl "sigs.k8s.io/controller-runtime" ) // Test suite flags. diff --git a/test/e2e/k8s_conformance.go b/test/e2e/k8s_conformance.go index add1bef15ef0..120a0c80590b 100644 --- a/test/e2e/k8s_conformance.go +++ b/test/e2e/k8s_conformance.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/test/framework/kubetest" diff --git a/test/e2e/kcp_adoption.go b/test/e2e/kcp_adoption.go index c734cd562e9d..5318408d4f92 100644 --- a/test/e2e/kcp_adoption.go +++ b/test/e2e/kcp_adoption.go @@ -30,13 +30,14 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" "k8s.io/utils/pointer" + ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" + 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" - ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) // KCPAdoptionSpecInput is the input for KCPAdoptionSpec. diff --git a/test/e2e/machine_pool.go b/test/e2e/machine_pool.go index dd5c7a9424d3..d4e3926307ad 100644 --- a/test/e2e/machine_pool.go +++ b/test/e2e/machine_pool.go @@ -29,6 +29,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "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/md_rollout.go b/test/e2e/md_rollout.go index cb1651dd3c15..f7593c294b01 100644 --- a/test/e2e/md_rollout.go +++ b/test/e2e/md_rollout.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "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/md_scale.go b/test/e2e/md_scale.go index fcfea638a410..9bc53f9c0666 100644 --- a/test/e2e/md_scale.go +++ b/test/e2e/md_scale.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "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/mhc_remediations.go b/test/e2e/mhc_remediations.go index 0d8275f0d10e..25b1bc4a52e5 100644 --- a/test/e2e/mhc_remediations.go +++ b/test/e2e/mhc_remediations.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "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 9ba6d9d16d86..260bf925aa5e 100644 --- a/test/e2e/node_drain_timeout.go +++ b/test/e2e/node_drain_timeout.go @@ -28,6 +28,7 @@ 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/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" diff --git a/test/e2e/quick_start.go b/test/e2e/quick_start.go index fe9a0cbc4862..9395364f5fe8 100644 --- a/test/e2e/quick_start.go +++ b/test/e2e/quick_start.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "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 a3068b157e12..254b20526327 100644 --- a/test/e2e/self_hosted.go +++ b/test/e2e/self_hosted.go @@ -27,13 +27,14 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) // SelfHostedSpecInput is the input for SelfHostedSpec. diff --git a/test/framework/alltypes_helpers.go b/test/framework/alltypes_helpers.go index 2e23d05ef792..85ef08136323 100644 --- a/test/framework/alltypes_helpers.go +++ b/test/framework/alltypes_helpers.go @@ -32,9 +32,10 @@ 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/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // GetCAPIResourcesInput is the input for GetCAPIResources. diff --git a/test/framework/bootstrap/kind_provider.go b/test/framework/bootstrap/kind_provider.go index 4c8949498d54..b054ebd96a7f 100644 --- a/test/framework/bootstrap/kind_provider.go +++ b/test/framework/bootstrap/kind_provider.go @@ -22,10 +22,11 @@ import ( "os" . "github.com/onsi/gomega" - 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" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/test/framework/internal/log" ) const ( diff --git a/test/framework/bootstrap/kind_util.go b/test/framework/bootstrap/kind_util.go index 219582f39030..b206fe2e9fae 100644 --- a/test/framework/bootstrap/kind_util.go +++ b/test/framework/bootstrap/kind_util.go @@ -24,12 +24,13 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" - "sigs.k8s.io/cluster-api/test/framework/clusterctl" - "sigs.k8s.io/cluster-api/test/framework/internal/log" - "sigs.k8s.io/cluster-api/test/infrastructure/container" kind "sigs.k8s.io/kind/pkg/cluster" kindnodes "sigs.k8s.io/kind/pkg/cluster/nodes" kindnodesutils "sigs.k8s.io/kind/pkg/cluster/nodeutils" + + "sigs.k8s.io/cluster-api/test/framework/clusterctl" + "sigs.k8s.io/cluster-api/test/framework/internal/log" + "sigs.k8s.io/cluster-api/test/infrastructure/container" ) // CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages. diff --git a/test/framework/cluster_helpers.go b/test/framework/cluster_helpers.go index 76f620e6cd34..9a91814dab08 100644 --- a/test/framework/cluster_helpers.go +++ b/test/framework/cluster_helpers.go @@ -23,10 +23,11 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) // CreateClusterInput is the input for CreateCluster. diff --git a/test/framework/cluster_proxy.go b/test/framework/cluster_proxy.go index efc6379517ba..73112cf5983d 100644 --- a/test/framework/cluster_proxy.go +++ b/test/framework/cluster_proxy.go @@ -32,12 +32,13 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ClusterProxy defines the behavior of a type that acts as an intermediary with an existing Kubernetes cluster. diff --git a/test/framework/cluster_topology_helpers.go b/test/framework/cluster_topology_helpers.go index 1319235b6be3..9c27ce002fe7 100644 --- a/test/framework/cluster_topology_helpers.go +++ b/test/framework/cluster_topology_helpers.go @@ -23,11 +23,12 @@ import ( . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/labels" + "sigs.k8s.io/controller-runtime/pkg/client" + 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/internal/log" "sigs.k8s.io/cluster-api/util/patch" - "sigs.k8s.io/controller-runtime/pkg/client" ) // GetClusterClassByNameInput is the input for GetClusterClassByName. diff --git a/test/framework/clusterctl/client.go b/test/framework/clusterctl/client.go index 2eecfbbe18e1..187d30939c05 100644 --- a/test/framework/clusterctl/client.go +++ b/test/framework/clusterctl/client.go @@ -26,6 +26,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + clusterctlclient "sigs.k8s.io/cluster-api/cmd/clusterctl/client" clusterctllog "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/test/framework/clusterctl/logger" diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index fabf92e4be15..7917f11c7464 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -22,6 +22,7 @@ import ( "path/filepath" . "github.com/onsi/gomega" + 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/v1beta1" diff --git a/test/framework/clusterctl/e2e_config.go b/test/framework/clusterctl/e2e_config.go index 9448a581b82c..896c382c42df 100644 --- a/test/framework/clusterctl/e2e_config.go +++ b/test/framework/clusterctl/e2e_config.go @@ -33,10 +33,11 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/version" "k8s.io/utils/pointer" + "sigs.k8s.io/yaml" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" clusterctlconfig "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/yaml" ) // Provides access to the configuration for an e2e test. diff --git a/test/framework/clusterctl/repository.go b/test/framework/clusterctl/repository.go index c0094b18e40a..8b8aa494e5a9 100644 --- a/test/framework/clusterctl/repository.go +++ b/test/framework/clusterctl/repository.go @@ -31,6 +31,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/pkg/errors" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/test/framework/exec" ) diff --git a/test/framework/clusterresourceset_helpers.go b/test/framework/clusterresourceset_helpers.go index 7abb11ce1efe..cbc44abb25be 100644 --- a/test/framework/clusterresourceset_helpers.go +++ b/test/framework/clusterresourceset_helpers.go @@ -24,9 +24,10 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) // GetClusterResourceSetsInput is the input for GetClusterResourceSets. diff --git a/test/framework/control_plane.go b/test/framework/control_plane.go index 057d4ab5fbd5..bc9145293334 100644 --- a/test/framework/control_plane.go +++ b/test/framework/control_plane.go @@ -21,8 +21,9 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" ) // WaitForControlPlaneToBeUpToDateInput is the input for WaitForControlPlaneToBeUpToDate. diff --git a/test/framework/controlplane_helpers.go b/test/framework/controlplane_helpers.go index 7f434e40bbf0..a59a46252396 100644 --- a/test/framework/controlplane_helpers.go +++ b/test/framework/controlplane_helpers.go @@ -26,12 +26,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) // CreateKubeadmControlPlaneInput is the input for CreateKubeadmControlPlane. diff --git a/test/framework/convenience.go b/test/framework/convenience.go index b59e36bda3cb..482af807a25f 100644 --- a/test/framework/convenience.go +++ b/test/framework/convenience.go @@ -25,6 +25,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" 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/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" diff --git a/test/framework/convenience_test.go b/test/framework/convenience_test.go index 9c6788f85266..64a08dc36398 100644 --- a/test/framework/convenience_test.go +++ b/test/framework/convenience_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/cluster-api/test/framework" ) diff --git a/test/framework/daemonset_helpers.go b/test/framework/daemonset_helpers.go index 9afcacbfc78f..452802ba68c5 100644 --- a/test/framework/daemonset_helpers.go +++ b/test/framework/daemonset_helpers.go @@ -23,8 +23,9 @@ import ( . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - containerutil "sigs.k8s.io/cluster-api/util/container" "sigs.k8s.io/controller-runtime/pkg/client" + + containerutil "sigs.k8s.io/cluster-api/util/container" ) // WaitForKubeProxyUpgradeInput is the input for WaitForKubeProxyUpgrade. diff --git a/test/framework/deployment_helpers.go b/test/framework/deployment_helpers.go index dcd2fcbb6cba..704d3c0e0c8f 100644 --- a/test/framework/deployment_helpers.go +++ b/test/framework/deployment_helpers.go @@ -36,9 +36,10 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/kubernetes" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) // WaitForDeploymentsAvailableInput is the input for WaitForDeploymentsAvailable. diff --git a/test/framework/docker_logcollector.go b/test/framework/docker_logcollector.go index baff13711d92..cacf9784767a 100644 --- a/test/framework/docker_logcollector.go +++ b/test/framework/docker_logcollector.go @@ -25,11 +25,12 @@ import ( "strings" kerrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/kind/pkg/errors" + 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" ) // DockerLogCollector collect logs from a CAPD workload cluster. diff --git a/test/framework/kubernetesversions/template.go b/test/framework/kubernetesversions/template.go index 863997e3d77e..78d88ece5b19 100644 --- a/test/framework/kubernetesversions/template.go +++ b/test/framework/kubernetesversions/template.go @@ -29,8 +29,9 @@ import ( "text/template" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/yaml" + + "sigs.k8s.io/cluster-api/test/framework" ) var ( diff --git a/test/framework/kubetest/run.go b/test/framework/kubetest/run.go index e60626bca841..30d71ec43000 100644 --- a/test/framework/kubetest/run.go +++ b/test/framework/kubetest/run.go @@ -32,10 +32,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/discovery" "k8s.io/client-go/tools/clientcmd" + "sigs.k8s.io/yaml" + "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/ginkgoextensions" "sigs.k8s.io/cluster-api/test/infrastructure/container" - "sigs.k8s.io/yaml" ) const ( diff --git a/test/framework/machine_helpers.go b/test/framework/machine_helpers.go index efc9998566e2..75bbed6d196f 100644 --- a/test/framework/machine_helpers.go +++ b/test/framework/machine_helpers.go @@ -25,11 +25,12 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) // GetMachinesByMachineDeploymentsInput is the input for GetMachinesByMachineDeployments. diff --git a/test/framework/machinedeployment_helpers.go b/test/framework/machinedeployment_helpers.go index e34f98867101..b7a6e24135fa 100644 --- a/test/framework/machinedeployment_helpers.go +++ b/test/framework/machinedeployment_helpers.go @@ -26,11 +26,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) // CreateMachineDeploymentInput is the input for CreateMachineDeployment. diff --git a/test/framework/machinehealthcheck_helpers.go b/test/framework/machinehealthcheck_helpers.go index a4922609270a..314601c41609 100644 --- a/test/framework/machinehealthcheck_helpers.go +++ b/test/framework/machinehealthcheck_helpers.go @@ -26,8 +26,9 @@ 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/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // DiscoverMachineHealthCheckAndWaitForRemediationInput is the input for DiscoverMachineHealthCheckAndWait. diff --git a/test/framework/machinepool_helpers.go b/test/framework/machinepool_helpers.go index be17e234e77f..6ad5bb5eeb31 100644 --- a/test/framework/machinepool_helpers.go +++ b/test/framework/machinepool_helpers.go @@ -23,11 +23,12 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterv1exp "sigs.k8s.io/cluster-api/exp/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" ) // GetMachinePoolsByClusterInput is the input for GetMachinePoolsByCluster. diff --git a/test/framework/machines.go b/test/framework/machines.go index f1179f9cec3b..a811dcb6cef5 100644 --- a/test/framework/machines.go +++ b/test/framework/machines.go @@ -22,9 +22,10 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) // WaitForClusterMachineNodeRefsInput is the input for WaitForClusterMachineNodesRefs. diff --git a/test/framework/namespace_helpers.go b/test/framework/namespace_helpers.go index 3ec8a6a87006..95bc9707d6f1 100644 --- a/test/framework/namespace_helpers.go +++ b/test/framework/namespace_helpers.go @@ -32,9 +32,10 @@ import ( "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/client" ) // CreateNamespaceInput is the input type for CreateNamespace. diff --git a/test/framework/node_helpers.go b/test/framework/node_helpers.go index 2b0f1da213cc..f1cc095668c0 100644 --- a/test/framework/node_helpers.go +++ b/test/framework/node_helpers.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" ) diff --git a/test/framework/suite_helpers.go b/test/framework/suite_helpers.go index 1f3afe43411f..7d5a8228932a 100644 --- a/test/framework/suite_helpers.go +++ b/test/framework/suite_helpers.go @@ -26,6 +26,7 @@ import ( "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/reporters" + . "sigs.k8s.io/cluster-api/test/framework/ginkgoextensions" ) diff --git a/test/infrastructure/container/docker.go b/test/infrastructure/container/docker.go index 9c1e1257f077..642cd48fd33f 100644 --- a/test/infrastructure/container/docker.go +++ b/test/infrastructure/container/docker.go @@ -35,6 +35,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/docker/go-connections/nat" "github.com/pkg/errors" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/test/infrastructure/docker/api/v1alpha3/conversion.go b/test/infrastructure/docker/api/v1alpha3/conversion.go index 78c5871914a6..6a86157b8630 100644 --- a/test/infrastructure/docker/api/v1alpha3/conversion.go +++ b/test/infrastructure/docker/api/v1alpha3/conversion.go @@ -18,9 +18,10 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *DockerCluster) ConvertTo(dstRaw conversion.Hub) error { diff --git a/test/infrastructure/docker/api/v1alpha3/dockercluster_types.go b/test/infrastructure/docker/api/v1alpha3/dockercluster_types.go index 8f9f1dcbf2ee..d91fe09f3a16 100644 --- a/test/infrastructure/docker/api/v1alpha3/dockercluster_types.go +++ b/test/infrastructure/docker/api/v1alpha3/dockercluster_types.go @@ -18,6 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) diff --git a/test/infrastructure/docker/api/v1alpha3/dockermachine_types.go b/test/infrastructure/docker/api/v1alpha3/dockermachine_types.go index a5123a2be1b2..978a0c168b83 100644 --- a/test/infrastructure/docker/api/v1alpha3/dockermachine_types.go +++ b/test/infrastructure/docker/api/v1alpha3/dockermachine_types.go @@ -18,6 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" ) diff --git a/test/infrastructure/docker/api/v1alpha4/conversion.go b/test/infrastructure/docker/api/v1alpha4/conversion.go index 77b54dae3fc4..e919628debe4 100644 --- a/test/infrastructure/docker/api/v1alpha4/conversion.go +++ b/test/infrastructure/docker/api/v1alpha4/conversion.go @@ -18,9 +18,10 @@ package v1alpha4 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *DockerCluster) ConvertTo(dstRaw conversion.Hub) error { diff --git a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go index e8b59f55d21e..7cdea6150d40 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go @@ -18,6 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go index 8229c89cd7ee..668598057c8e 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go @@ -18,6 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) diff --git a/test/infrastructure/docker/api/v1beta1/dockercluster_types.go b/test/infrastructure/docker/api/v1beta1/dockercluster_types.go index ea319729b03c..f55f4bb53c5b 100644 --- a/test/infrastructure/docker/api/v1beta1/dockercluster_types.go +++ b/test/infrastructure/docker/api/v1beta1/dockercluster_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go index f13088a61451..8ce477f0503d 100644 --- a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go +++ b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook.go b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook.go index 988cfb69df2c..1ad6af6b9844 100644 --- a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook.go +++ b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook.go @@ -23,9 +23,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + + "sigs.k8s.io/cluster-api/feature" ) const dockerClusterTemplateImmutableMsg = "DockerClusterTemplate spec.template.spec field is immutable. Please create a new resource instead." diff --git a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook_test.go b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook_test.go index ce3469bc812e..d32279166f4a 100644 --- a/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook_test.go +++ b/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_webhook_test.go @@ -22,6 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" + "sigs.k8s.io/cluster-api/feature" ) diff --git a/test/infrastructure/docker/api/v1beta1/dockermachine_types.go b/test/infrastructure/docker/api/v1beta1/dockermachine_types.go index d771b07792e2..2f4e0cee9be6 100644 --- a/test/infrastructure/docker/api/v1beta1/dockermachine_types.go +++ b/test/infrastructure/docker/api/v1beta1/dockermachine_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go b/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go index 020c680ef7d0..633913ca7d4b 100644 --- a/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go +++ b/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/test/infrastructure/docker/controllers/alias.go b/test/infrastructure/docker/controllers/alias.go index 3b3baf813221..5a136ed9198a 100644 --- a/test/infrastructure/docker/controllers/alias.go +++ b/test/infrastructure/docker/controllers/alias.go @@ -20,10 +20,11 @@ package controllers import ( "context" - dockercontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + dockercontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/controllers" ) // Following types provides access to reconcilers implemented in internal/controllers, thus diff --git a/test/infrastructure/docker/exp/api/v1alpha3/conversion.go b/test/infrastructure/docker/exp/api/v1alpha3/conversion.go index 3b7e1ac46cf3..3eeb15387b8b 100644 --- a/test/infrastructure/docker/exp/api/v1alpha3/conversion.go +++ b/test/infrastructure/docker/exp/api/v1alpha3/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha3 import ( - infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" ) func (src *DockerMachinePool) ConvertTo(dstRaw conversion.Hub) error { diff --git a/test/infrastructure/docker/exp/api/v1alpha3/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1alpha3/dockermachinepool_types.go index c84483f69de9..a081f2b93b8a 100644 --- a/test/infrastructure/docker/exp/api/v1alpha3/dockermachinepool_types.go +++ b/test/infrastructure/docker/exp/api/v1alpha3/dockermachinepool_types.go @@ -18,6 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3" ) diff --git a/test/infrastructure/docker/exp/api/v1alpha4/conversion.go b/test/infrastructure/docker/exp/api/v1alpha4/conversion.go index 782af043c0f7..acc200d9e51a 100644 --- a/test/infrastructure/docker/exp/api/v1alpha4/conversion.go +++ b/test/infrastructure/docker/exp/api/v1alpha4/conversion.go @@ -17,8 +17,9 @@ limitations under the License. package v1alpha4 import ( - infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" + + infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" ) func (src *DockerMachinePool) ConvertTo(dstRaw conversion.Hub) error { diff --git a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go index 8e0589b72507..da32f8b67ef0 100644 --- a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go +++ b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go @@ -18,6 +18,7 @@ package v1alpha4 import ( 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" ) diff --git a/test/infrastructure/docker/exp/api/v1beta1/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1beta1/dockermachinepool_types.go index bbeda8362fce..fe40293d0b4a 100644 --- a/test/infrastructure/docker/exp/api/v1beta1/dockermachinepool_types.go +++ b/test/infrastructure/docker/exp/api/v1beta1/dockermachinepool_types.go @@ -18,6 +18,7 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ) diff --git a/test/infrastructure/docker/exp/controllers/alias.go b/test/infrastructure/docker/exp/controllers/alias.go index dad233945633..1a8706d0bced 100644 --- a/test/infrastructure/docker/exp/controllers/alias.go +++ b/test/infrastructure/docker/exp/controllers/alias.go @@ -21,10 +21,11 @@ import ( "context" "k8s.io/apimachinery/pkg/runtime" - dockermachinepoolcontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" + + dockermachinepoolcontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/internal/controllers" ) // DockerMachinePoolReconciler reconciles a DockerMachinePool object. diff --git a/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go b/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go index 65f7e704bda6..fda2f67157cc 100644 --- a/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go +++ b/test/infrastructure/docker/exp/internal/controllers/dockermachinepool_controller.go @@ -25,6 +25,13 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" utilexp "sigs.k8s.io/cluster-api/exp/util" @@ -33,12 +40,6 @@ import ( "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) // DockerMachinePoolReconciler reconciles a DockerMachinePool object. diff --git a/test/infrastructure/docker/exp/internal/docker/nodepool.go b/test/infrastructure/docker/exp/internal/docker/nodepool.go index da4bad690d56..613cfcdcdc40 100644 --- a/test/infrastructure/docker/exp/internal/docker/nodepool.go +++ b/test/infrastructure/docker/exp/internal/docker/nodepool.go @@ -25,15 +25,16 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/kind/pkg/cluster/constants" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" infrav1exp "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/container" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/kind/pkg/cluster/constants" ) const ( diff --git a/test/infrastructure/docker/internal/controllers/dockercluster_controller.go b/test/infrastructure/docker/internal/controllers/dockercluster_controller.go index 9b5c17a0af31..0adcf23a12bb 100644 --- a/test/infrastructure/docker/internal/controllers/dockercluster_controller.go +++ b/test/infrastructure/docker/internal/controllers/dockercluster_controller.go @@ -22,6 +22,13 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + 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/internal/docker" @@ -29,12 +36,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" ) // DockerClusterReconciler reconciles a DockerCluster object. diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go index 0ccb61deb972..77a4305ab54c 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go @@ -25,6 +25,14 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/source" + "sigs.k8s.io/kind/pkg/cluster/constants" + 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/internal/docker" @@ -33,13 +41,6 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" - "sigs.k8s.io/kind/pkg/cluster/constants" ) // DockerMachineReconciler reconciles a DockerMachine object. diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller_test.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller_test.go index e546d2d2922e..20e4572f6ba5 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller_test.go +++ b/test/infrastructure/docker/internal/controllers/dockermachine_controller_test.go @@ -22,10 +22,11 @@ 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/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" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ) var ( diff --git a/test/infrastructure/docker/internal/controllers/suite_test.go b/test/infrastructure/docker/internal/controllers/suite_test.go index 505dd2d9a390..0596e0ac3651 100644 --- a/test/infrastructure/docker/internal/controllers/suite_test.go +++ b/test/infrastructure/docker/internal/controllers/suite_test.go @@ -19,6 +19,7 @@ package controllers import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ) diff --git a/test/infrastructure/docker/internal/docker/kind_manager.go b/test/infrastructure/docker/internal/docker/kind_manager.go index 00319c69ae88..27773b19b6dc 100644 --- a/test/infrastructure/docker/internal/docker/kind_manager.go +++ b/test/infrastructure/docker/internal/docker/kind_manager.go @@ -22,12 +22,13 @@ import ( "net" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/test/infrastructure/container" - "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" "sigs.k8s.io/kind/pkg/cluster/constants" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/test/infrastructure/container" + "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker/types" ) // KubeadmContainerPort is the port that kubeadm listens on in the container. diff --git a/test/infrastructure/docker/internal/docker/loadbalancer.go b/test/infrastructure/docker/internal/docker/loadbalancer.go index 8e16e9764224..557ad99750fc 100644 --- a/test/infrastructure/docker/internal/docker/loadbalancer.go +++ b/test/infrastructure/docker/internal/docker/loadbalancer.go @@ -22,13 +22,14 @@ import ( "net" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/kind/pkg/cluster/constants" + 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/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker/types" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/third_party/forked/loadbalancer" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/kind/pkg/cluster/constants" ) type lbCreator interface { diff --git a/test/infrastructure/docker/internal/docker/machine.go b/test/infrastructure/docker/internal/docker/machine.go index e982e09188ce..5a2ea4f071f3 100644 --- a/test/infrastructure/docker/internal/docker/machine.go +++ b/test/infrastructure/docker/internal/docker/machine.go @@ -29,15 +29,16 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/wait" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" + "sigs.k8s.io/kind/pkg/cluster/constants" + 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/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/cloudinit" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker/types" clusterapicontainer "sigs.k8s.io/cluster-api/util/container" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" - "sigs.k8s.io/kind/pkg/cluster/constants" ) const ( diff --git a/test/infrastructure/docker/internal/docker/types/node.go b/test/infrastructure/docker/internal/docker/types/node.go index f35045d50fa8..b75d1f198435 100644 --- a/test/infrastructure/docker/internal/docker/types/node.go +++ b/test/infrastructure/docker/internal/docker/types/node.go @@ -26,6 +26,7 @@ import ( "strings" "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/test/infrastructure/container" ) diff --git a/test/infrastructure/docker/internal/docker/util.go b/test/infrastructure/docker/internal/docker/util.go index 6d8d0af4c8b7..c3a112850c90 100644 --- a/test/infrastructure/docker/internal/docker/util.go +++ b/test/infrastructure/docker/internal/docker/util.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/pkg/errors" + "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/cluster-api/test/infrastructure/docker/internal/docker/types" ) diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go index e0fdbb9981fb..23ba3fd619c4 100644 --- a/test/infrastructure/docker/main.go +++ b/test/infrastructure/docker/main.go @@ -33,6 +33,9 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -45,8 +48,6 @@ import ( 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" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller" ) var ( diff --git a/util/annotations/helpers.go b/util/annotations/helpers.go index c5405eb1fafd..5e1b34ee845c 100644 --- a/util/annotations/helpers.go +++ b/util/annotations/helpers.go @@ -21,6 +21,7 @@ import ( "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/collections/helpers.go b/util/collections/helpers.go index be059c6e0be4..96ecd043e44b 100644 --- a/util/collections/helpers.go +++ b/util/collections/helpers.go @@ -21,8 +21,9 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // GetFilteredMachinesForCluster returns a list of machines that can be filtered or not. diff --git a/util/collections/machine_collection.go b/util/collections/machine_collection.go index 1f8534caf483..861456af3b69 100644 --- a/util/collections/machine_collection.go +++ b/util/collections/machine_collection.go @@ -31,6 +31,7 @@ import ( "sort" "github.com/blang/semver" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/util/collections/machine_collection_test.go b/util/collections/machine_collection_test.go index 517c0dc50930..e3623263d9e5 100644 --- a/util/collections/machine_collection_test.go +++ b/util/collections/machine_collection_test.go @@ -23,6 +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/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/collections/machine_filters.go b/util/collections/machine_filters.go index 53b5b4161936..82aa866659ca 100644 --- a/util/collections/machine_filters.go +++ b/util/collections/machine_filters.go @@ -21,11 +21,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) // Func is the functon definition for a filter. diff --git a/util/collections/machine_filters_test.go b/util/collections/machine_filters_test.go index 94bf34d7dc02..c96b1f943e7f 100644 --- a/util/collections/machine_filters_test.go +++ b/util/collections/machine_filters_test.go @@ -23,11 +23,12 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/conditions" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func falseFilter(_ *clusterv1.Machine) bool { diff --git a/util/collections/suite_test.go b/util/collections/suite_test.go index 1f7bc76e9ebb..72a5ef7a2973 100644 --- a/util/collections/suite_test.go +++ b/util/collections/suite_test.go @@ -20,8 +20,9 @@ import ( "os" "testing" - "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" + + "sigs.k8s.io/cluster-api/internal/envtest" ) var ( diff --git a/util/conditions/getter.go b/util/conditions/getter.go index 379e1ecb68a1..6bd866d8c8f0 100644 --- a/util/conditions/getter.go +++ b/util/conditions/getter.go @@ -19,8 +19,9 @@ package conditions import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Getter interface defines methods that a Cluster API object should implement in order to diff --git a/util/conditions/getter_test.go b/util/conditions/getter_test.go index 88b961b1e418..0c6a0f92580d 100644 --- a/util/conditions/getter_test.go +++ b/util/conditions/getter_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/matcher.go b/util/conditions/matcher.go index dc5757dece40..710232921c49 100644 --- a/util/conditions/matcher.go +++ b/util/conditions/matcher.go @@ -21,6 +21,7 @@ import ( "github.com/onsi/gomega" "github.com/onsi/gomega/types" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/matcher_test.go b/util/conditions/matcher_test.go index 0b9ca1b81e05..19b66b91d75f 100644 --- a/util/conditions/matcher_test.go +++ b/util/conditions/matcher_test.go @@ -22,6 +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/v1beta1" ) diff --git a/util/conditions/matchers.go b/util/conditions/matchers.go index 0bfaadcaa3c6..a2fd651744ef 100644 --- a/util/conditions/matchers.go +++ b/util/conditions/matchers.go @@ -21,6 +21,7 @@ import ( "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/merge.go b/util/conditions/merge.go index 54c1ec3d2eed..7566a093e5e0 100644 --- a/util/conditions/merge.go +++ b/util/conditions/merge.go @@ -20,6 +20,7 @@ import ( "sort" corev1 "k8s.io/api/core/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/merge_strategies_test.go b/util/conditions/merge_strategies_test.go index 0fa6170f4583..516f1a45c628 100644 --- a/util/conditions/merge_strategies_test.go +++ b/util/conditions/merge_strategies_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/merge_test.go b/util/conditions/merge_test.go index 2cd91370d4fe..8d8305190744 100644 --- a/util/conditions/merge_test.go +++ b/util/conditions/merge_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/patch.go b/util/conditions/patch.go index 51af0b398c5f..358c538ad69c 100644 --- a/util/conditions/patch.go +++ b/util/conditions/patch.go @@ -21,6 +21,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pkg/errors" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/patch_test.go b/util/conditions/patch_test.go index 137c94441909..2a925d895538 100644 --- a/util/conditions/patch_test.go +++ b/util/conditions/patch_test.go @@ -23,6 +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/v1beta1" ) diff --git a/util/conditions/setter.go b/util/conditions/setter.go index 415013739299..94755f4b3b3e 100644 --- a/util/conditions/setter.go +++ b/util/conditions/setter.go @@ -23,6 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/conditions/setter_test.go b/util/conditions/setter_test.go index 470ae4f8d98c..0b8d1a530eef 100644 --- a/util/conditions/setter_test.go +++ b/util/conditions/setter_test.go @@ -26,6 +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/v1beta1" ) diff --git a/util/conditions/suite_test.go b/util/conditions/suite_test.go index 9fa7fb7a8093..a03ec411fe3b 100644 --- a/util/conditions/suite_test.go +++ b/util/conditions/suite_test.go @@ -19,6 +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/v1beta1" ) diff --git a/util/conditions/unstructured.go b/util/conditions/unstructured.go index 00ec7ac3587f..cc6291c66aea 100644 --- a/util/conditions/unstructured.go +++ b/util/conditions/unstructured.go @@ -19,9 +19,10 @@ package conditions import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/log" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/log" ) // UnstructuredGetter return a Getter object that can read conditions from an Unstructured object. diff --git a/util/conditions/unstructured_test.go b/util/conditions/unstructured_test.go index c628ae8065db..578fd63b313b 100644 --- a/util/conditions/unstructured_test.go +++ b/util/conditions/unstructured_test.go @@ -24,6 +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/v1beta1" ) diff --git a/util/conversion/conversion.go b/util/conversion/conversion.go index 1af636c3321d..a901d5019700 100644 --- a/util/conversion/conversion.go +++ b/util/conversion/conversion.go @@ -37,11 +37,12 @@ import ( runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/json" "k8s.io/client-go/kubernetes/scheme" - 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" "sigs.k8s.io/controller-runtime/pkg/conversion" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util" ) const ( diff --git a/util/conversion/conversion_test.go b/util/conversion/conversion_test.go index 704f2c677a30..b6bcdcfe3e2d 100644 --- a/util/conversion/conversion_test.go +++ b/util/conversion/conversion_test.go @@ -23,6 +23,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/v1beta1" ) diff --git a/util/failuredomains/failure_domains.go b/util/failuredomains/failure_domains.go index 7755c823ba3d..005d2f36a477 100644 --- a/util/failuredomains/failure_domains.go +++ b/util/failuredomains/failure_domains.go @@ -22,6 +22,7 @@ import ( "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" + 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 fcbabe0f1d7e..cab68aad9ab8 100644 --- a/util/failuredomains/failure_domains_test.go +++ b/util/failuredomains/failure_domains_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/kubeconfig/kubeconfig.go b/util/kubeconfig/kubeconfig.go index 283c2817d737..2c8872bbb723 100644 --- a/util/kubeconfig/kubeconfig.go +++ b/util/kubeconfig/kubeconfig.go @@ -30,11 +30,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( diff --git a/util/kubeconfig/kubeconfig_test.go b/util/kubeconfig/kubeconfig_test.go index 1134c005bfca..8da369854a36 100644 --- a/util/kubeconfig/kubeconfig_test.go +++ b/util/kubeconfig/kubeconfig_test.go @@ -30,13 +30,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + 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" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/fake" ) var ( diff --git a/util/kubeconfig/testing.go b/util/kubeconfig/testing.go index 51da00ad1c94..72444d5b766b 100644 --- a/util/kubeconfig/testing.go +++ b/util/kubeconfig/testing.go @@ -22,6 +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/v1beta1" ) diff --git a/util/labels/helpers.go b/util/labels/helpers.go index 673ccd1cf5d4..848ec37cdf40 100644 --- a/util/labels/helpers.go +++ b/util/labels/helpers.go @@ -19,6 +19,7 @@ package labels import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) diff --git a/util/labels/helpers_test.go b/util/labels/helpers_test.go index 329f8d57f6eb..d627014800f2 100644 --- a/util/labels/helpers_test.go +++ b/util/labels/helpers_test.go @@ -22,6 +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/v1beta1" ) diff --git a/util/patch/patch.go b/util/patch/patch.go index 48f2efecc95f..8345a0cd8d74 100644 --- a/util/patch/patch.go +++ b/util/patch/patch.go @@ -29,10 +29,11 @@ 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/v1beta1" - "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/util/conditions" ) // Helper is a utility for ensuring the proper patching of objects. diff --git a/util/patch/patch_test.go b/util/patch/patch_test.go index 44c95d61e973..b29530dc0931 100644 --- a/util/patch/patch_test.go +++ b/util/patch/patch_test.go @@ -28,10 +28,11 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) func TestPatchHelper(t *testing.T) { diff --git a/util/patch/suite_test.go b/util/patch/suite_test.go index 6cb0c066b121..33478a249f5a 100644 --- a/util/patch/suite_test.go +++ b/util/patch/suite_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports "sigs.k8s.io/cluster-api/internal/envtest" - ctrl "sigs.k8s.io/controller-runtime" ) const ( diff --git a/util/patch/utils_test.go b/util/patch/utils_test.go index 9f4746475afc..e99f47df6de8 100644 --- a/util/patch/utils_test.go +++ b/util/patch/utils_test.go @@ -22,6 +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/v1beta1" ) diff --git a/util/predicates/cluster_predicates.go b/util/predicates/cluster_predicates.go index 3cf3f914d832..610993ec16fe 100644 --- a/util/predicates/cluster_predicates.go +++ b/util/predicates/cluster_predicates.go @@ -21,10 +21,11 @@ import ( "fmt" "github.com/go-logr/logr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // ClusterCreateInfraReady returns a predicate that returns true for a create event when a cluster has Status.InfrastructureReady set as true diff --git a/util/predicates/generic_predicates.go b/util/predicates/generic_predicates.go index cd3fdff6590f..551b58ed64c9 100644 --- a/util/predicates/generic_predicates.go +++ b/util/predicates/generic_predicates.go @@ -20,11 +20,12 @@ import ( "strings" "github.com/go-logr/logr" - "sigs.k8s.io/cluster-api/util/annotations" - "sigs.k8s.io/cluster-api/util/labels" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" + + "sigs.k8s.io/cluster-api/util/annotations" + "sigs.k8s.io/cluster-api/util/labels" ) // All returns a predicate that returns true only if all given predicates return true. diff --git a/util/secret/certificates.go b/util/secret/certificates.go index 178023e9e9bb..e3aadfbc7a37 100644 --- a/util/secret/certificates.go +++ b/util/secret/certificates.go @@ -34,10 +34,11 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/cert" + "sigs.k8s.io/controller-runtime/pkg/client" + 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" ) const ( diff --git a/util/secret/certificates_test.go b/util/secret/certificates_test.go index 16e778b12fcc..e6c48c252ba2 100644 --- a/util/secret/certificates_test.go +++ b/util/secret/certificates_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" + 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 86dca5158185..b8af09802b44 100644 --- a/util/suite_test.go +++ b/util/suite_test.go @@ -19,8 +19,9 @@ package util import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/util/util.go b/util/util.go index 4be7b2c68402..988e2548d49d 100644 --- a/util/util.go +++ b/util/util.go @@ -38,12 +38,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" k8sversion "k8s.io/apimachinery/pkg/version" - 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" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/util/util_test.go b/util/util_test.go index f933fd690775..f2c9d2b8780c 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -28,12 +28,13 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - 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" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestMachineToInfrastructureMapFunc(t *testing.T) { diff --git a/util/yaml/yaml.go b/util/yaml/yaml.go index 0f4ba309a8b9..d848937b373c 100644 --- a/util/yaml/yaml.go +++ b/util/yaml/yaml.go @@ -33,9 +33,10 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/streaming" apiyaml "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/kubernetes/scheme" + "sigs.k8s.io/yaml" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/yaml" ) // ExtractClusterReferences returns the references in a Cluster object. diff --git a/webhooks/alias.go b/webhooks/alias.go index e83f55ace3c2..9c1160c95e45 100644 --- a/webhooks/alias.go +++ b/webhooks/alias.go @@ -17,9 +17,10 @@ limitations under the License. package webhooks import ( - "sigs.k8s.io/cluster-api/internal/webhooks" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + "sigs.k8s.io/cluster-api/internal/webhooks" ) // Cluster implements a validating and defaulting webhook for Cluster.