kubecm icon indicating copy to clipboard operation
kubecm copied to clipboard

kubecm uses wrong user and cluster name

Open thesn10 opened this issue 2 years ago • 3 comments

kube cm adds the cluster with wrong cluster name and wrong user name:

image

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

thesn10 avatar May 24 '22 16:05 thesn10

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.

sunny0826 avatar May 26 '22 00:05 sunny0826

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

thesn10 avatar May 26 '22 15:05 thesn10

This is a great idea, thanks for the feedback

sunny0826 avatar May 27 '22 00:05 sunny0826

Fixed by #536. Please update to the latest version.

astraw99 avatar Sep 08 '22 11:09 astraw99

@astraw99 Thank you for fixing the issue!

thesn10 avatar Sep 08 '22 15:09 thesn10