feat(sks): add --name option to kubeconfig command#843
Open
nhedger wants to merge 3 commits into
Open
Conversation
nhedger
commented
Jun 12, 2026
| golang.org/x/text v0.31.0 | ||
| gopkg.in/h2non/gentleman.v2 v2.0.4 | ||
| gopkg.in/yaml.v2 v2.4.0 | ||
| gopkg.in/yaml.v3 v3.0.1 |
Contributor
Author
There was a problem hiding this comment.
I added yaml.v3 as a direct dependency so we can cleanly generate double-quoted strings. Since it was already included transitively, I figured this was acceptable.
nhedger
commented
Jun 12, 2026
Comment on lines
+115
to
+118
| if c.ExecCredential && c.Name != "" { | ||
| return fmt.Errorf("--name cannot be used with --exec-credential") | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Being a bit defensive here, could also just ignore --name when using --exec-credential. I leave that to your appreciation.
name flag to kubeconfig command--name option to kubeconfig command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
Disclosure:
Description
This PR adds a
-n|--nameoption toexo compute sks kubeconfig, allowing users to set a custom cluster and context name in the generated kubeconfig.Why this matters
Currently, the cluster and context names are set to the cluster UUID, making kubeconfigs harder to distinguish when users manage multiple configurations.
Examples
Without
--nameWith
--nameWhy you may NOT want to merge this
You may prefer to implement this API-side rather than having the CLI rewrite the kubeconfig locally. I do not think there is anything inherently wrong with the CLI-based approach, but if you want to offer the same capability in the portal, the API may be the better place for it.
That said, this PR could still be merged as-is, and the CLI-local rewriting could later be replaced by an API-backed implementation.
Checklist
(For exoscale contributors)
CHANGELOG.md)Testing