Use context passed via the commandline when discovering cluster version #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation of
kuberlr
disregards the context provided via the command line (--context
flag) and instead always uses thecurrent-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 thecurrent-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
!