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
37273693
Commit
37273693
authored
Oct 01, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in dockershim to set sandbox id properly.
parent
56be1976
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
convert.go
pkg/kubelet/dockershim/convert.go
+9
-7
docker_container_test.go
pkg/kubelet/dockershim/docker_container_test.go
+8
-7
No files found.
pkg/kubelet/dockershim/convert.go
View file @
37273693
...
...
@@ -56,14 +56,16 @@ func toRuntimeAPIContainer(c *dockertypes.Container) (*runtimeApi.Container, err
return
nil
,
err
}
labels
,
annotations
:=
extractLabels
(
c
.
Labels
)
sandboxID
:=
c
.
Labels
[
sandboxIDLabelKey
]
return
&
runtimeApi
.
Container
{
Id
:
&
c
.
ID
,
Metadata
:
metadata
,
Image
:
&
runtimeApi
.
ImageSpec
{
Image
:
&
c
.
Image
},
ImageRef
:
&
c
.
ImageID
,
State
:
&
state
,
Labels
:
labels
,
Annotations
:
annotations
,
Id
:
&
c
.
ID
,
PodSandboxId
:
&
sandboxID
,
Metadata
:
metadata
,
Image
:
&
runtimeApi
.
ImageSpec
{
Image
:
&
c
.
Image
},
ImageRef
:
&
c
.
ImageID
,
State
:
&
state
,
Labels
:
labels
,
Annotations
:
annotations
,
},
nil
}
...
...
pkg/kubelet/dockershim/docker_container_test.go
View file @
37273693
...
...
@@ -73,13 +73,14 @@ func TestListContainers(t *testing.T) {
// Prepend to the expected list because ListContainers returns
// the most recent containers first.
expected
=
append
([]
*
runtimeApi
.
Container
{{
Metadata
:
configs
[
i
]
.
Metadata
,
Id
:
&
id
,
State
:
&
state
,
Image
:
configs
[
i
]
.
Image
,
ImageRef
:
&
imageRef
,
Labels
:
configs
[
i
]
.
Labels
,
Annotations
:
configs
[
i
]
.
Annotations
,
Metadata
:
configs
[
i
]
.
Metadata
,
Id
:
&
id
,
PodSandboxId
:
&
sandboxID
,
State
:
&
state
,
Image
:
configs
[
i
]
.
Image
,
ImageRef
:
&
imageRef
,
Labels
:
configs
[
i
]
.
Labels
,
Annotations
:
configs
[
i
]
.
Annotations
,
}},
expected
...
)
}
containers
,
err
:=
ds
.
ListContainers
(
nil
)
...
...
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