Unverified Commit c7f8c208 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #55131 from stewart-yu/addnamespaces

Automatic merge from submit-queue (batch tested with PRs 55682, 55444, 55456, 55717, 55131). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. hint command missing namespace parameters **What this PR does / why we need it**: hint command miss namespace parameters. before change, the hint is: ```shell Use 'kubectl describe pod/<podname>' to see all of the containers in this pod. ``` after change, the hint is: ```shell Use 'kubectl describe pod/<podname> -n <podnamespace>' to see all of the containers in this pod. ``` **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents a2efcf83 21e56e67
...@@ -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