-
Notifications
You must be signed in to change notification settings - Fork 1
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
Connect cluster cmd #3239
Connect cluster cmd #3239
Conversation
2f64295
to
b57cde9
Compare
b57cde9
to
3c5b17d
Compare
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.
We need to figure out the kubeconfig situation.
We can land it, but we should address before it goes public.
} | ||
|
||
logger := stdr.New(nil) | ||
ctx := log.IntoContext(context.Background(), logger) |
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.
This could probably call cmd.Context()
rather than creating a new Background
context?
1f14567
to
82c8f99
Compare
cmd.Flags().StringVar(&connectOptionsCmdFlags.ServiceAccountName, "service-account", "weave-gitops-enterprise", "Service account name to be created/used") | ||
cmd.Flags().StringVar(&connectOptionsCmdFlags.ClusterRoleName, "cluster-role", "weave-gitops-enterprise", "Cluster role name to be created/used") | ||
cmd.Flags().StringVar(&connectOptionsCmdFlags.ClusterRoleBindingName, "cluster-role-binding", "weave-gitops-enterprise", "Cluster role binding name to be created/used") | ||
cmd.Flags().StringVar(&connectOptionsCmdFlags.Namespace, "namespace", "default", "namespace of remote cluster") |
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.
We could change this to a StringVarP
https://pkg.go.dev/github.com/spf13/pflag#StringToStringVarP and add a "short name" of n
which would allow it to be used as -n
for the namespace which has the same semantic as kubectl
.
I also think we need to remove the two different ways of loading the config, but I've covered that elsewhere 😄 |
c7d7797
to
ba3ae07
Compare
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.
Some minor textual tidyups, looks good, thank you!
cmd.Flags().StringVar(&connectOptionsCmdFlags.ServiceAccountName, "service-account", "weave-gitops-enterprise", "Service account name to be created/used") | ||
cmd.Flags().StringVar(&connectOptionsCmdFlags.ClusterRoleName, "cluster-role", "weave-gitops-enterprise", "Cluster role name to be created/used") | ||
cmd.Flags().StringVar(&connectOptionsCmdFlags.ClusterRoleBindingName, "cluster-role-binding", "weave-gitops-enterprise", "Cluster role binding name to be created/used") | ||
cmd.Flags().StringVarP(&connectOptionsCmdFlags.Namespace, "namespace", "n", "default", "namespace of remote cluster") |
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.
Let's make this Namespace of remote cluster
in keeping with the other descriptions?
…ng two config loading methods
Co-authored-by: Kevin McDermott <[email protected]>
Co-authored-by: Kevin McDermott <[email protected]>
499d05e
to
b927471
Compare
Closes #3086
What changed?
Add
connect cluster
cmd to gitopsWhy was this change made?
to use connector pkg to connect a remote cluster to a cluster
How was this change implemented?
How did you validate the change?
Once building the gitops cmd with the updates:
Release notes
Documentation Changes
Other follow ups