Modify the usage of cluster-namespace
Signed-off-by: chen zechun <zechun.chen@daocloud.io>
This commit is contained in:
parent
fbe7d49917
commit
4111e8342a
|
@ -90,7 +90,7 @@ func NewCmdGet(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Command
|
||||||
cmd.Flags().StringVarP(&o.Namespace, "namespace", "n", "default", "-n=namespace or -n namespace")
|
cmd.Flags().StringVarP(&o.Namespace, "namespace", "n", "default", "-n=namespace or -n namespace")
|
||||||
cmd.Flags().StringVarP(&o.LabelSelector, "labels", "l", "", "-l=label or -l label")
|
cmd.Flags().StringVarP(&o.LabelSelector, "labels", "l", "", "-l=label or -l label")
|
||||||
cmd.Flags().StringSliceVarP(&o.Clusters, "clusters", "C", []string{}, "-C=member1,member2")
|
cmd.Flags().StringSliceVarP(&o.Clusters, "clusters", "C", []string{}, "-C=member1,member2")
|
||||||
cmd.Flags().StringVar(&o.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster are stored.")
|
cmd.Flags().StringVar(&o.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster secrets are stored.")
|
||||||
cmd.Flags().BoolVarP(&o.AllNamespaces, "all-namespaces", "A", o.AllNamespaces, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
|
cmd.Flags().BoolVarP(&o.AllNamespaces, "all-namespaces", "A", o.AllNamespaces, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
|
||||||
cmd.Flags().BoolVar(&o.IgnoreNotFound, "ignore-not-found", o.IgnoreNotFound, "If the requested object does not exist the command will return exit code 0.")
|
cmd.Flags().BoolVar(&o.IgnoreNotFound, "ignore-not-found", o.IgnoreNotFound, "If the requested object does not exist the command will return exit code 0.")
|
||||||
cmd.Flags().BoolVarP(&o.Watch, "watch", "w", o.Watch, "After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.")
|
cmd.Flags().BoolVarP(&o.Watch, "watch", "w", o.Watch, "After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.")
|
||||||
|
|
|
@ -143,7 +143,7 @@ func (j *CommandJoinOption) Validate() error {
|
||||||
func (j *CommandJoinOption) AddFlags(flags *pflag.FlagSet) {
|
func (j *CommandJoinOption) AddFlags(flags *pflag.FlagSet) {
|
||||||
j.GlobalCommandOptions.AddFlags(flags)
|
j.GlobalCommandOptions.AddFlags(flags)
|
||||||
|
|
||||||
flags.StringVar(&j.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member secrets cluster are stored.")
|
flags.StringVar(&j.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster secrets are stored.")
|
||||||
|
|
||||||
flags.StringVar(&j.ClusterContext, "cluster-context", "",
|
flags.StringVar(&j.ClusterContext, "cluster-context", "",
|
||||||
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
||||||
|
|
|
@ -129,7 +129,7 @@ func (o *CommandPromoteOption) AddFlags(flags *pflag.FlagSet) {
|
||||||
|
|
||||||
flags.StringVarP(&o.Namespace, "namespace", "n", "default", "-n=namespace or -n namespace")
|
flags.StringVarP(&o.Namespace, "namespace", "n", "default", "-n=namespace or -n namespace")
|
||||||
flags.StringVarP(&o.Cluster, "cluster", "c", "", "the name of legacy cluster (eg -c=member1)")
|
flags.StringVarP(&o.Cluster, "cluster", "c", "", "the name of legacy cluster (eg -c=member1)")
|
||||||
flags.StringVar(&o.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster are stored.")
|
flags.StringVar(&o.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster secrets are stored.")
|
||||||
flags.StringVar(&o.ClusterContext, "cluster-context", "",
|
flags.StringVar(&o.ClusterContext, "cluster-context", "",
|
||||||
"Context name of legacy cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
"Context name of legacy cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
||||||
flags.StringVar(&o.ClusterKubeConfig, "cluster-kubeconfig", "",
|
flags.StringVar(&o.ClusterKubeConfig, "cluster-kubeconfig", "",
|
||||||
|
|
|
@ -122,7 +122,7 @@ func (j *CommandUnjoinOption) Validate() error {
|
||||||
func (j *CommandUnjoinOption) AddFlags(flags *pflag.FlagSet) {
|
func (j *CommandUnjoinOption) AddFlags(flags *pflag.FlagSet) {
|
||||||
j.GlobalCommandOptions.AddFlags(flags)
|
j.GlobalCommandOptions.AddFlags(flags)
|
||||||
|
|
||||||
flags.StringVar(&j.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster are stored.")
|
flags.StringVar(&j.ClusterNamespace, "cluster-namespace", options.DefaultKarmadaClusterNamespace, "Namespace in the control plane where member cluster secrets are stored.")
|
||||||
flags.StringVar(&j.ClusterContext, "cluster-context", "",
|
flags.StringVar(&j.ClusterContext, "cluster-context", "",
|
||||||
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
"Context name of cluster in kubeconfig. Only works when there are multiple contexts in the kubeconfig.")
|
||||||
flags.StringVar(&j.ClusterKubeConfig, "cluster-kubeconfig", "",
|
flags.StringVar(&j.ClusterKubeConfig, "cluster-kubeconfig", "",
|
||||||
|
|
Loading…
Reference in New Issue