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
1cfcb24f
Commit
1cfcb24f
authored
Jun 03, 2016
by
AdoHe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exec support init container
parent
77de942e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
kubectl_exec.md
docs/user-guide/kubectl/kubectl_exec.md
+1
-1
exec.go
pkg/kubectl/cmd/exec.go
+0
-4
strategy.go
pkg/registry/pod/strategy.go
+5
-0
No files found.
docs/user-guide/kubectl/kubectl_exec.md
View file @
1cfcb24f
...
...
@@ -100,7 +100,7 @@ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
*
[
kubectl
](
kubectl.md
)
- kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra on
5-Apr
-2016
###### Auto generated by spf13/cobra on
3-Jun
-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[

]()
...
...
pkg/kubectl/cmd/exec.go
View file @
1cfcb24f
...
...
@@ -174,10 +174,6 @@ func (p *ExecOptions) Run() error {
return
err
}
if
pod
.
Status
.
Phase
!=
api
.
PodRunning
{
return
fmt
.
Errorf
(
"pod %s is not running and cannot execute commands; current phase is %s"
,
p
.
PodName
,
pod
.
Status
.
Phase
)
}
containerName
:=
p
.
ContainerName
if
len
(
containerName
)
==
0
{
glog
.
V
(
4
)
.
Infof
(
"defaulting container name to %s"
,
pod
.
Spec
.
Containers
[
0
]
.
Name
)
...
...
pkg/registry/pod/strategy.go
View file @
1cfcb24f
...
...
@@ -332,6 +332,11 @@ func podHasContainerWithName(pod *api.Pod, containerName string) bool {
return
true
}
}
for
_
,
c
:=
range
pod
.
Spec
.
InitContainers
{
if
c
.
Name
==
containerName
{
return
true
}
}
return
false
}
...
...
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