mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Merge pull request #3992 from smarterclayton/allow_namespace_short
Allow commands to specify a short namespace
This commit is contained in:
commit
d9c9856889
@ -54,6 +54,8 @@ type ContextOverrideFlags struct {
|
|||||||
ClusterName string
|
ClusterName string
|
||||||
AuthInfoName string
|
AuthInfoName string
|
||||||
Namespace string
|
Namespace string
|
||||||
|
// allow the potential for shorter namespace flags for commands that tend to work across namespaces
|
||||||
|
NamespaceShort string
|
||||||
NamespacePath string
|
NamespacePath string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,6 +152,6 @@ func BindOverrideFlags(overrides *ConfigOverrides, flags *pflag.FlagSet, flagNam
|
|||||||
func BindContextFlags(contextInfo *clientcmdapi.Context, flags *pflag.FlagSet, flagNames ContextOverrideFlags) {
|
func BindContextFlags(contextInfo *clientcmdapi.Context, flags *pflag.FlagSet, flagNames ContextOverrideFlags) {
|
||||||
flags.StringVar(&contextInfo.Cluster, flagNames.ClusterName, "", "The name of the kubeconfig cluster to use")
|
flags.StringVar(&contextInfo.Cluster, flagNames.ClusterName, "", "The name of the kubeconfig cluster to use")
|
||||||
flags.StringVar(&contextInfo.AuthInfo, flagNames.AuthInfoName, "", "The name of the kubeconfig user to use")
|
flags.StringVar(&contextInfo.AuthInfo, flagNames.AuthInfoName, "", "The name of the kubeconfig user to use")
|
||||||
flags.StringVar(&contextInfo.Namespace, flagNames.Namespace, "", "If present, the namespace scope for this CLI request.")
|
flags.StringVarP(&contextInfo.Namespace, flagNames.Namespace, flagNames.NamespaceShort, "", "If present, the namespace scope for this CLI request.")
|
||||||
flags.StringVar(&contextInfo.NamespacePath, flagNames.NamespacePath, "", "Path to the namespace info file that holds the namespace context to use for CLI requests.")
|
flags.StringVar(&contextInfo.NamespacePath, flagNames.NamespacePath, "", "Path to the namespace info file that holds the namespace context to use for CLI requests.")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user