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

cluster and user name conflict on add kubeconfig with same context cluster and user #1047

Closed
poneding opened this issue Dec 31, 2024 · 0 comments · Fixed by #1048
Closed
Labels
kind/bug Something isn't working

Comments

@poneding
Copy link
Contributor

Describe the bug
If the cluster and user names of multiple KubeConfig contexts are duplicated, the final merged kubeconfig will have the wrong content!

To Reproduce
Steps to reproduce the behavior:

  1. Prepare three kubeconfig files, such as .kube/cluster1,kube/cluster2,kube/cluster3
  2. They have same context:
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
  1. use kubecm merge them:
touch ~/.kube/config
kubecm add --file .kube/cluster1
kubecm rename # cluster1
kubecm add --file .kube/cluster2
kubecm rename # cluster2
kubecm add --file .kube/cluster3
  1. Result: .kube/cluster3 add done, but context
image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
2 participants