Commit 21e56e67 authored by stewart-yu's avatar stewart-yu

add namespace parameters on command

parent 21062657
...@@ -167,20 +167,20 @@ func (p *ExecOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []s ...@@ -167,20 +167,20 @@ func (p *ExecOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []s
} }
} }
namespace, _, err := f.DefaultNamespace()
if err != nil {
return err
}
p.Namespace = namespace
cmdParent := cmd.Parent() cmdParent := cmd.Parent()
if cmdParent != nil { if cmdParent != nil {
p.FullCmdName = cmdParent.CommandPath() p.FullCmdName = cmdParent.CommandPath()
} }
if len(p.FullCmdName) > 0 && cmdutil.IsSiblingCommandExists(cmd, "describe") { if len(p.FullCmdName) > 0 && cmdutil.IsSiblingCommandExists(cmd, "describe") {
p.SuggestedCmdUsage = fmt.Sprintf("Use '%s describe pod/%s' to see all of the containers in this pod.", p.FullCmdName, p.PodName) p.SuggestedCmdUsage = fmt.Sprintf("Use '%s describe pod/%s -n %s' to see all of the containers in this pod.", p.FullCmdName, p.PodName, p.Namespace)
} }
namespace, _, err := f.DefaultNamespace()
if err != nil {
return err
}
p.Namespace = namespace
config, err := f.ClientConfig() config, err := f.ClientConfig()
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment