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

Use context passed via the commandline when discovering cluster version #61

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

DanHam
Copy link
Contributor

@DanHam DanHam commented Dec 21, 2023

The current implementation of kuberlr disregards the context provided via the command line (--context flag) and instead always uses the current-context specified in the merged kubeconfig.

It is very likely that the current-context specified in the kubeconfig will differ from the context specified on the command line — otherwise, the user would have no need to utilize the --context flag! By defaulting to the current-context in these scenarios, kuberlr connects to the wrong cluster when determining the cluster version. The end result is that the wrong version of kubectl may be used to run the users commands.

This pull request introduces the necessary code changes to parse the command line arguments and ensure that the specified context is honoured when determining the cluster version.

Thanks for creating kuberlr!

@flavio
Copy link
Owner

flavio commented Jan 8, 2024

Sorry, I was on vacation. Thanks for your fix

@flavio flavio merged commit 919c84e into flavio:master Jan 8, 2024
4 checks passed
@flavio
Copy link
Owner

flavio commented Jan 8, 2024

I've just tagged v0.4.5 which will feature this fix

@DanHam DanHam deleted the respect-context branch January 8, 2024 15:37
@DanHam
Copy link
Contributor Author

DanHam commented Jan 8, 2024

Hope you had a great vacation! Thanks Flavio.

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

Successfully merging this pull request may close these issues.

2 participants