From 9575c376d85234726306f156b913775169d3a613 Mon Sep 17 00:00:00 2001 From: Nader Ziada Date: Wed, 13 Jan 2021 17:56:46 -0500 Subject: [PATCH] move version package from cmd to util since version is used from various locations in the code, made more sense to move it out of cmd --- bootstrap/kubeadm/main.go | 2 +- cmd/clusterctl/client/cluster/proxy.go | 2 +- cmd/clusterctl/client/cluster/proxy_test.go | 2 +- cmd/clusterctl/cmd/version.go | 2 +- cmd/clusterctl/cmd/version_checker.go | 2 +- cmd/clusterctl/cmd/version_checker_test.go | 2 +- controlplane/kubeadm/main.go | 2 +- hack/version.sh | 2 +- main.go | 2 +- {cmd/version => version}/version.go | 0 10 files changed, 9 insertions(+), 9 deletions(-) rename {cmd/version => version}/version.go (100%) diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index be9af4726953..a6c4f2a850c3 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -34,9 +34,9 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/controllers" - "sigs.k8s.io/cluster-api/cmd/version" expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" "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" diff --git a/cmd/clusterctl/client/cluster/proxy.go b/cmd/clusterctl/client/cluster/proxy.go index 88d7c20535ef..11321e390632 100644 --- a/cmd/clusterctl/client/cluster/proxy.go +++ b/cmd/clusterctl/client/cluster/proxy.go @@ -31,7 +31,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" - "sigs.k8s.io/cluster-api/cmd/version" + "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/cluster/proxy_test.go b/cmd/clusterctl/client/cluster/proxy_test.go index 0ffd8245b4dd..6735ad556c17 100644 --- a/cmd/clusterctl/client/cluster/proxy_test.go +++ b/cmd/clusterctl/client/cluster/proxy_test.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/cluster-api/cmd/version" + "sigs.k8s.io/cluster-api/version" ) var _ Proxy = &test.FakeProxy{} diff --git a/cmd/clusterctl/cmd/version.go b/cmd/clusterctl/cmd/version.go index 1935fb332440..f72bd5700f66 100644 --- a/cmd/clusterctl/cmd/version.go +++ b/cmd/clusterctl/cmd/version.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" - "sigs.k8s.io/cluster-api/cmd/version" + "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/yaml" ) diff --git a/cmd/clusterctl/cmd/version_checker.go b/cmd/clusterctl/cmd/version_checker.go index 4ab6e396a8d8..35db14e1d7f2 100644 --- a/cmd/clusterctl/cmd/version_checker.go +++ b/cmd/clusterctl/cmd/version_checker.go @@ -33,7 +33,7 @@ import ( "k8s.io/client-go/util/homedir" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - "sigs.k8s.io/cluster-api/cmd/version" + "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/yaml" ) diff --git a/cmd/clusterctl/cmd/version_checker_test.go b/cmd/clusterctl/cmd/version_checker_test.go index 135f7680e736..ab7da49c3675 100644 --- a/cmd/clusterctl/cmd/version_checker_test.go +++ b/cmd/clusterctl/cmd/version_checker_test.go @@ -28,7 +28,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/client-go/util/homedir" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" - "sigs.k8s.io/cluster-api/cmd/version" + "sigs.k8s.io/cluster-api/version" "sigs.k8s.io/yaml" ) diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go index 05e012e3b0a5..79def16593c9 100644 --- a/controlplane/kubeadm/main.go +++ b/controlplane/kubeadm/main.go @@ -33,9 +33,9 @@ import ( "k8s.io/klog/klogr" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - "sigs.k8s.io/cluster-api/cmd/version" kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" kubeadmcontrolplanecontrollers "sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers" + "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" diff --git a/hack/version.sh b/hack/version.sh index a81d7783457b..66c156ed4f3f 100755 --- a/hack/version.sh +++ b/hack/version.sh @@ -85,7 +85,7 @@ version::ldflags() { local key=${1} local val=${2} ldflags+=( - "-X 'sigs.k8s.io/cluster-api/cmd/version.${key}=${val}'" + "-X 'sigs.k8s.io/cluster-api/version.${key}=${val}'" ) } diff --git a/main.go b/main.go index 1730cb7a6eaa..db8f33c0092f 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,6 @@ import ( "k8s.io/klog" "k8s.io/klog/klogr" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/cmd/version" "sigs.k8s.io/cluster-api/controllers" "sigs.k8s.io/cluster-api/controllers/remote" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" @@ -40,6 +39,7 @@ import ( expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" expcontrollers "sigs.k8s.io/cluster-api/exp/controllers" "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" diff --git a/cmd/version/version.go b/version/version.go similarity index 100% rename from cmd/version/version.go rename to version/version.go