Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
21e56e67
Commit
21e56e67
authored
Nov 06, 2017
by
stewart-yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add namespace parameters on command
parent
21062657
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
exec.go
pkg/kubectl/cmd/exec.go
+7
-7
No files found.
pkg/kubectl/cmd/exec.go
View file @
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
.
PodNam
e
)
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
.
Namespac
e
)
}
}
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment