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
4d85e485
Commit
4d85e485
authored
Sep 13, 2016
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRI: remove name from ContainerFilter and PodSandboxFilter
parent
ac8aae58
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
28 deletions
+8
-28
fake_runtime_service.go
pkg/kubelet/api/testing/fake_runtime_service.go
+0
-6
api.pb.go
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
+0
-0
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+7
-11
docker_container.go
pkg/kubelet/dockershim/docker_container.go
+1
-5
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+0
-6
No files found.
pkg/kubelet/api/testing/fake_runtime_service.go
View file @
4d85e485
...
@@ -188,9 +188,6 @@ func (r *FakeRuntimeService) ListPodSandbox(filter *runtimeApi.PodSandboxFilter)
...
@@ -188,9 +188,6 @@ func (r *FakeRuntimeService) ListPodSandbox(filter *runtimeApi.PodSandboxFilter)
if
filter
.
Id
!=
nil
&&
filter
.
GetId
()
!=
id
{
if
filter
.
Id
!=
nil
&&
filter
.
GetId
()
!=
id
{
continue
continue
}
}
if
filter
.
Name
!=
nil
&&
filter
.
GetName
()
!=
s
.
Metadata
.
GetName
()
{
continue
}
if
filter
.
State
!=
nil
&&
filter
.
GetState
()
!=
s
.
GetState
()
{
if
filter
.
State
!=
nil
&&
filter
.
GetState
()
!=
s
.
GetState
()
{
continue
continue
}
}
...
@@ -304,9 +301,6 @@ func (r *FakeRuntimeService) ListContainers(filter *runtimeApi.ContainerFilter)
...
@@ -304,9 +301,6 @@ func (r *FakeRuntimeService) ListContainers(filter *runtimeApi.ContainerFilter)
if
filter
.
Id
!=
nil
&&
filter
.
GetId
()
!=
s
.
GetId
()
{
if
filter
.
Id
!=
nil
&&
filter
.
GetId
()
!=
s
.
GetId
()
{
continue
continue
}
}
if
filter
.
Name
!=
nil
&&
filter
.
GetName
()
!=
s
.
Metadata
.
GetName
()
{
continue
}
if
filter
.
PodSandboxId
!=
nil
&&
filter
.
GetPodSandboxId
()
!=
s
.
SandboxID
{
if
filter
.
PodSandboxId
!=
nil
&&
filter
.
GetPodSandboxId
()
!=
s
.
SandboxID
{
continue
continue
}
}
...
...
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
4d85e485
This diff is collapsed.
Click to expand it.
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
4d85e485
...
@@ -271,16 +271,14 @@ message PodSandboxStatusResponse {
...
@@ -271,16 +271,14 @@ message PodSandboxStatusResponse {
// PodSandboxFilter is used to filter a list of PodSandboxes.
// PodSandboxFilter is used to filter a list of PodSandboxes.
// All those fields are combined with 'AND'
// All those fields are combined with 'AND'
message
PodSandboxFilter
{
message
PodSandboxFilter
{
// Name of the sandbox.
optional
string
name
=
1
;
// ID of the sandbox.
// ID of the sandbox.
optional
string
id
=
2
;
optional
string
id
=
1
;
// State of the sandbox.
// State of the sandbox.
optional
PodSandBoxState
state
=
3
;
optional
PodSandBoxState
state
=
2
;
// LabelSelector to select matches.
// LabelSelector to select matches.
// Only api.MatchLabels is supported for now and the requirements
// Only api.MatchLabels is supported for now and the requirements
// are ANDed. MatchExpressions is not supported yet.
// are ANDed. MatchExpressions is not supported yet.
map
<
string
,
string
>
label_selector
=
4
;
map
<
string
,
string
>
label_selector
=
3
;
}
}
message
ListPodSandboxRequest
{
message
ListPodSandboxRequest
{
...
@@ -495,18 +493,16 @@ enum ContainerState {
...
@@ -495,18 +493,16 @@ enum ContainerState {
// ContainerFilter is used to filter containers.
// ContainerFilter is used to filter containers.
// All those fields are combined with 'AND'
// All those fields are combined with 'AND'
message
ContainerFilter
{
message
ContainerFilter
{
// Name of the container.
optional
string
name
=
1
;
// ID of the container.
// ID of the container.
optional
string
id
=
2
;
optional
string
id
=
1
;
// State of the container.
// State of the container.
optional
ContainerState
state
=
3
;
optional
ContainerState
state
=
2
;
// The id of the pod sandbox
// The id of the pod sandbox
optional
string
pod_sandbox_id
=
4
;
optional
string
pod_sandbox_id
=
3
;
// LabelSelector to select matches.
// LabelSelector to select matches.
// Only api.MatchLabels is supported for now and the requirements
// Only api.MatchLabels is supported for now and the requirements
// are ANDed. MatchExpressions is not supported yet.
// are ANDed. MatchExpressions is not supported yet.
map
<
string
,
string
>
label_selector
=
5
;
map
<
string
,
string
>
label_selector
=
4
;
}
}
message
ListContainersRequest
{
message
ListContainersRequest
{
...
...
pkg/kubelet/dockershim/docker_container.go
View file @
4d85e485
...
@@ -71,11 +71,7 @@ func (ds *dockerService) ListContainers(filter *runtimeApi.ContainerFilter) ([]*
...
@@ -71,11 +71,7 @@ func (ds *dockerService) ListContainers(filter *runtimeApi.ContainerFilter) ([]*
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API container: %v"
,
err
)
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API container: %v"
,
err
)
continue
continue
}
}
if
len
(
filter
.
GetName
())
!=
0
&&
converted
.
Metadata
.
GetName
()
!=
filter
.
GetName
()
{
// TODO: Remove "name" from the ContainerFilter because name can no
// longer be used to identify a container.
continue
}
result
=
append
(
result
,
converted
)
result
=
append
(
result
,
converted
)
}
}
return
result
,
nil
return
result
,
nil
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
4d85e485
...
@@ -180,17 +180,11 @@ func (ds *dockerService) ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]
...
@@ -180,17 +180,11 @@ func (ds *dockerService) ListPodSandbox(filter *runtimeApi.PodSandboxFilter) ([]
result
:=
[]
*
runtimeApi
.
PodSandbox
{}
result
:=
[]
*
runtimeApi
.
PodSandbox
{}
for
i
:=
range
containers
{
for
i
:=
range
containers
{
c
:=
containers
[
i
]
c
:=
containers
[
i
]
converted
,
err
:=
toRuntimeAPISandbox
(
&
c
)
converted
,
err
:=
toRuntimeAPISandbox
(
&
c
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API sandbox: %v"
,
err
)
glog
.
V
(
5
)
.
Infof
(
"Unable to convert docker to runtime API sandbox: %v"
,
err
)
continue
continue
}
}
if
len
(
filter
.
GetName
())
>
0
&&
converted
.
Metadata
.
GetName
()
!=
filter
.
GetName
()
{
// TODO: Remove "name" from the SandboxFilter because name can no
// longer be used to identify a container.
continue
}
if
filterOutReadySandboxes
&&
converted
.
GetState
()
==
runtimeApi
.
PodSandBoxState_READY
{
if
filterOutReadySandboxes
&&
converted
.
GetState
()
==
runtimeApi
.
PodSandBoxState_READY
{
continue
continue
}
}
...
...
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