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
ecd10442
Commit
ecd10442
authored
Oct 31, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle empty container name in dockershim.
parent
e6b2517f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
convert.go
pkg/kubelet/dockershim/convert.go
+6
-0
docker_container.go
pkg/kubelet/dockershim/docker_container.go
+1
-1
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+1
-1
No files found.
pkg/kubelet/dockershim/convert.go
View file @
ecd10442
...
...
@@ -77,6 +77,9 @@ func toPullableImageID(id string, image *dockertypes.ImageInspect) string {
func
toRuntimeAPIContainer
(
c
*
dockertypes
.
Container
)
(
*
runtimeApi
.
Container
,
error
)
{
state
:=
toRuntimeAPIContainerState
(
c
.
Status
)
if
len
(
c
.
Names
)
==
0
{
return
nil
,
fmt
.
Errorf
(
"unexpected empty container name: %+v"
,
c
)
}
metadata
,
err
:=
parseContainerName
(
c
.
Names
[
0
])
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -141,6 +144,9 @@ func toRuntimeAPISandboxState(state string) runtimeApi.PodSandBoxState {
func
toRuntimeAPISandbox
(
c
*
dockertypes
.
Container
)
(
*
runtimeApi
.
PodSandbox
,
error
)
{
state
:=
toRuntimeAPISandboxState
(
c
.
Status
)
if
len
(
c
.
Names
)
==
0
{
return
nil
,
fmt
.
Errorf
(
"unexpected empty sandbox name: %+v"
,
c
)
}
metadata
,
err
:=
parseSandboxName
(
c
.
Names
[
0
])
if
err
!=
nil
{
return
nil
,
err
...
...
pkg/kubelet/dockershim/docker_container.go
View file @
ecd10442
...
...
@@ -69,7 +69,7 @@ func (ds *dockerService) ListContainers(filter *runtimeApi.ContainerFilter) ([]*
converted
,
err
:=
toRuntimeAPIContainer
(
&
c
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API container: %v"
,
err
)
glog
.
V
(
4
)
.
Infof
(
"Unable to convert docker to runtime API container: %v"
,
err
)
continue
}
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
ecd10442
...
...
@@ -191,7 +191,7 @@ func (ds *dockerService) ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]
c
:=
containers
[
i
]
converted
,
err
:=
toRuntimeAPISandbox
(
&
c
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API sandbox: %v"
,
err
)
glog
.
V
(
4
)
.
Infof
(
"Unable to convert docker to runtime API sandbox: %v"
,
err
)
continue
}
if
filterOutReadySandboxes
&&
converted
.
GetState
()
==
runtimeApi
.
PodSandBoxState_READY
{
...
...
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