-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
[feature] add command get k3stoken to retrieve cluster token #257
[feature] add command get k3stoken to retrieve cluster token #257
Conversation
I'm fixing CI and the tests :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, it looks great! :)
However, I'm unsure if it should really be a separate command or if it should rather be part of k3d get cluster
, e.g. as a --token
flag or via extending the whole get cluster
command with JSON/YAML/template output, where the token can easily be retrieved from. What do you think?
Yes good idea i will change it 👍 |
18811fe
to
1c0028d
Compare
This already looks pretty good :) |
Yes i will do change for Question about another topic do you know why CI complain about that : Maybe related to this change :
|
@RouxAntoine the error is due to recent changes in master, introducing |
Thanks 👌 |
Add go compiler flag to makefile Add makefile target with debug compiler flag Exclude Idea project file
Print usage When no k3d verb was specify Replace fake Cluster object create into getKubeConfig by realy complete object obtain thanks to cluster.GetCluster() function Use constant variable for node Label name use into populateClusterFieldsFromLabels() function, in forecast to rename label `k3d.cluster.secret` to `k3d.cluster.token`
Add new command verb `k3stoken` to `k3d get` Populate cluster secret field Add test for `k3d get k3stoken` command Externalize validable flag `--all`, in anticipation to reuse into `getKubeConfig.go`
Use `log.Fatalln(err)` instead of `log.Errorln(err)` + `os.Exit(1)` Use Label prefix instead of LabelName suffix Rename all secret occurence with token
40d47b1
to
0862f11
Compare
That's it, open for second review :) with this new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -37,96 +37,90 @@ import ( | |||
"github.com/liggitt/tabwriter" | |||
) | |||
|
|||
// TODO : deal with --all flag to manage differentiate started cluster and stopped cluster like `docker ps` and `docker ps -a` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, but still worth mentioning: during development of k3d v1.x, we had this differentiation and the community didn't like it, so we made --all
the default.
I think we should rather stick to kubectl
-similar style and show all clusters, when no flag is set and only filter them by setting new flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes i think i will update getkubeconfig in another PR to remove --all
flag. I am not sure to understand, k3d style should show only started cluster without --all
or not ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made proposal for this change here #268.
This will certainly be a breaking change, but I really like it 👍 |
This pull request
🔧 Update Makefile and .gitignore
♻️ Some side effect refactoring
✨ Add get k3stoken feature
More information and discussion here : #211