feat: use generic cli args for get-kubeconfig plugin #787
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.
📝 Description
When working with different accounts from the CLI, it is useful to set one specific account on-demand using the
--as-user
argument. Theget-kubeconfig
plugin did not pass such global CLI arguments through, making it necessary having to make an extra call withset-user
, and switching back after.✔️ How to Test
There was no extra unit test written for this, as all other plugins use the same functionality.
Manual testing can be performed by adding two accounts to the Linode CLI config where each account has at least one LKE cluster.
Given that
account1
hascluster1
andaccount2
hascluster2
, making a call such aslinode-cli get-kubeconfig --as-user account1 cluster1
andlinode-cli get-kubeconfig --as-user account2 cluster2
will download and add two contexts to the localkubectl
configuration.Without this change, the commands return
unrecognized arguments: --as-user account[1 or 2]
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.