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

Problem with add and merge #602

Open
Evantage-WS opened this issue Dec 19, 2022 · 5 comments
Open

Problem with add and merge #602

Evantage-WS opened this issue Dec 19, 2022 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Evantage-WS
Copy link

Evantage-WS commented Dec 19, 2022

Describe the bug
When merging 2 configs or adding a config, the name is not preserved

To Reproduce
I have a cluster
+------------+---------+------------+ .....
|..CURRENT...|....NAME...|...CLUSTER..| .....
+=========+=======+=========+ .....
| ....................|..test-vm..|...test-vm.....| .....

When adding a second config via kubecm add -f /tmp/config or kubecm merge "~/.kube/config" /tmp/config -y the name (context) of the first cluster is changed to config

+------------+---------+------------+ .....
|..CURRENT...|....NAME...|...CLUSTER..| .....
+=========+=======+=========+ .....
| ....................|...config...|...test-vm.....| .....
+------------+---------+------------+ .....
| ....................|..cluster2.|....cluster2....| .....

Expected behavior
It should not rename the cluster config name

Desktop (please complete the following information):

  • OS: MacOS
  • Version Ventura 13.0.1

Thanks!

@sunny0826
Copy link
Owner

In order to avoid cluster name conflicts, cluster names are renamed when adding and merging. I would also like to try to change this situation, please ask if there is a better suggestion for improvement to solve this problem.

@sunny0826 sunny0826 added the question Further information is requested label Dec 20, 2022
@Evantage-WS
Copy link
Author

Evantage-WS commented Dec 20, 2022

Just check for duplicate names first or do a dry-run of the merge or merge it to a temp place first and check if the names are ok?

With the current renaming it is pretty hard to remove a config based on the clustername.

@sunny0826 sunny0826 self-assigned this Dec 26, 2022
@sunny0826
Copy link
Owner

This issue will be fixed in the next version.

@soostdijck
Copy link

I love the concept of kubecm, but it wrecked my existing kube config in the first minute of trying it out when I used merge to add a kubeconfig to my existing config.
Shame this has been open for 9 months without a fix. I'll just restore a backup and go back to kubectx I suppose.

@sunny0826
Copy link
Owner

@soostdijck Very sorry for the bad experience. You can actually use the -cover and --config flags to generate kubeconfig in the specified directory instead of overwriting the source kubeconfig file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants