-
Notifications
You must be signed in to change notification settings - Fork 177
[WIP] convert create-user.sh to pure go functions #995
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for capsule-documentation canceled.
|
// KubeConfig represents the kubeconfig structure | ||
type KubeConfig struct { | ||
APIVersion string `json:"apiVersion"` | ||
Kind string `json:"kind"` | ||
Clusters []Cluster `json:"clusters"` | ||
Contexts []Context `json:"contexts"` | ||
CurrentContext string `json:"current-context"` | ||
Preferences interface{} `json:"preferences"` | ||
Users []User `json:"users"` | ||
} |
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.
You can rely on the clientcmdapi.Config
object: https://github.com/kubernetes/client-go/blob/8c4efe8d079e405329f314fb789a41ac6af101dc/tools/clientcmd/api/types.go#L28-L31
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.
So instead of defining my own types i could use the types for the k8 sdk
Nice will make some edits
@9trocode I'm very welcoming to your PR, and I'd like to know if you could revamp it. |
This pull request has been marked as stale because it has been inactive for more than 30 days. Please update this pull request or it will be automatically closed in 7 days. |
The result of this code would look like this it generates ${tenant}-${user}.kubeconfig