mirror of https://github.com/docker/cli.git
Using Flags instead of PersistentFlags, as Kubernetes flags seem not to be defined in the "persistent space".
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
parent
b6a628c295
commit
14fcadffb1
|
@ -27,15 +27,15 @@ func WrapCli(dockerCli command.Cli, cmd *cobra.Command) (*KubeCli, error) {
|
||||||
Cli: dockerCli,
|
Cli: dockerCli,
|
||||||
kubeNamespace: "default",
|
kubeNamespace: "default",
|
||||||
}
|
}
|
||||||
if cmd.PersistentFlags().Changed("namespace") {
|
if cmd.Flags().Changed("namespace") {
|
||||||
cli.kubeNamespace, err = cmd.PersistentFlags().GetString("namespace")
|
cli.kubeNamespace, err = cmd.Flags().GetString("namespace")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kubeConfig := ""
|
kubeConfig := ""
|
||||||
if cmd.PersistentFlags().Changed("kubeconfig") {
|
if cmd.Flags().Changed("kubeconfig") {
|
||||||
kubeConfig, err = cmd.PersistentFlags().GetString("kubeconfig")
|
kubeConfig, err = cmd.Flags().GetString("kubeconfig")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue