Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Misleading error message for clusterctl init #5738

Closed
mkumatag opened this issue Nov 26, 2021 · 3 comments · Fixed by #5739
Closed

Misleading error message for clusterctl init #5738

mkumatag opened this issue Nov 26, 2021 · 3 comments · Fixed by #5739
Assignees
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@mkumatag
Copy link
Member

What steps did you take and what happened:

  1. Install the core and infra providers:
$ ./bin/clusterctl init -i aws              
No default config file available
Fetching providers
Fetching File="core-components.yaml" Provider="cluster-api" Type="CoreProvider" Version="v1.0.1"
...
....
Creating inventory entry Provider="infrastructure-aws" Version="v1.1.0" TargetNamespace="capa-system"

Your management cluster has been initialized successfully!

You can now create your first workload cluster by running the following:

  clusterctl generate cluster [name] --kubernetes-version [version] | kubectl apply -f -
  1. Installed providers
$ k get providers -A                        
NAMESPACE                           NAME                    AGE   TYPE                     PROVIDER      VERSION
capa-system                         infrastructure-aws      33s   InfrastructureProvider   aws           v1.1.0
capi-kubeadm-bootstrap-system       bootstrap-kubeadm       44s   BootstrapProvider        kubeadm       v1.0.1
capi-kubeadm-control-plane-system   control-plane-kubeadm   40s   ControlPlaneProvider     kubeadm       v1.0.1
capi-system                         cluster-api             47s   CoreProvider             cluster-api   v1.0.1
  1. Try installing same infra provider in a different namespace
$ ./bin/clusterctl init -i aws --target-namespace something-else
No default config file available
Fetching providers
Fetching File="infrastructure-components.yaml" Provider="aws" Type="InfrastructureProvider" Version="v1.1.0"
Error: installing provider "infrastructure-aws" can lead to a non functioning management cluster: there is already an instance of the "infrastructure-aws" provider installed in the "something-else" namespace

In the above error message it says there is already an instance of the "infrastructure-aws" provider installed in the "something-else" namespace which is false because this infra provider is installed in a capa-system namespace and a different one

What did you expect to happen:
clusterctl should throw a following error message instead:

Error: installing provider "infrastructure-aws" can lead to a non functioning management cluster: there is already an instance of the "infrastructure-aws" provider installed in the "capa-system" namespace

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api version:
./bin/clusterctl version                                                                                                                                                              1 ↵
clusterctl version: &version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.0-317-4b858f625c3e02-dirty", GitCommit:"4b858f625c3e02700d965bcb59de0be5937f7b95", GitTreeState:"dirty", BuildDate:"2021-11-25T23:51:28Z", GoVersion:"go1.17.3", Compiler:"gc", Platform:"darwin/amd64"}
No default config file available
⚠️  Using a development build of clusterctl. CLIVersion="1.0.0-317-4b858f625c3e02-dirty" LatestGithubRelease="v1.0.1"

  • Minikube/KIND version: NA
  • Kubernetes version: (use kubectl version): NA
  • OS (e.g. from /etc/os-release): NA

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 26, 2021
@mkumatag mkumatag changed the title Misleading error message Misleading error message for clusterctl init Nov 26, 2021
@mkumatag
Copy link
Member Author

/area clusterctl

@mkumatag
Copy link
Member Author

/assign

@fabriziopandini
Copy link
Member

/milestone v1.1

@k8s-ci-robot k8s-ci-robot added this to the v1.1 milestone Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
3 participants