kubecm
kubecm copied to clipboard
kubecm uses wrong user and cluster name
kube cm adds the cluster with wrong cluster name and wrong user name:
kubecm uses the wrong names cluster-95ct8cddbt
and user-95ct8cddbt
instead of the correct names k3d-testkube
and admin@k3d-testkube
Here is original kubeconfig:
---
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: REDACTED
name: k3d-testkube
contexts:
- context:
cluster: k3d-testkube
user: admin@k3d-testkube
name: k3d-testkube
current-context: k3d-testkube
kind: Config
preferences: {}
users:
- name: admin@k3d-testkube
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
Here is after kubecm add -f
:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: REDACTED
name: cluster-95ct8cddbt # wrong
contexts:
- context:
cluster: cluster-95ct8cddbt # wrong
user: user-95ct8cddbt # wrong
name: k3d-testkube
current-context: ""
kind: Config
preferences: {}
users:
- name: user-95ct8cddbt # wrong
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
CLUSTER
and USER
often have duplicate names, so they are hashed and renamed once each time they are merged, and do not affect their use.
Yes it does not affect their use, but it is still annoying. I think kubecm should keep the names by default and only if there is a duplicate it should ask to rename
This is a great idea, thanks for the feedback
Fixed by #536. Please update to the latest version.
@astraw99 Thank you for fixing the issue!