Skip to content

Overwrite existing k3s entries in the kubectx in install-k3s-kubeconfig.sh #9579

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

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

mads-hartmann
Copy link
Contributor

Description

Currently install-k3s-kubeconfig.sh would not update the .kube/config if it already had an entry to the k3s cluster. This means that your kubectx config can become stale if you change branches or use with-clean-slate-deployment.

The fix was the ensure that K3S_KUBECONFIG_PATH entries takes precedence over KUBECONFIG_PATH when merging the kubeconfig.

Related Issue(s)

No issue, was reported in our internal Slack here.

How to test

I tested this manually by using two branches with VMs and re-running the script after having changed branches. Before this changeset it didn't update the kubectx after the first invocation. With this changeset it did.

Release Notes

NONE

Documentation

N/A

This is needed when switching bracnhes or when using
clean-slate-deployment.
Copy link
Member

@meysholdt meysholdt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM

@roboquat roboquat merged commit 5706b83 into main Apr 27, 2022
@roboquat roboquat deleted the mads/overwrite-k3s-kubeconfig branch April 27, 2022 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants