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
e416f374
Commit
e416f374
authored
Feb 07, 2018
by
hangaoshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up unused function GetKubeletDockerContainers
parent
7223729d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
+0
-31
client.go
pkg/kubelet/dockershim/libdocker/client.go
+0
-31
No files found.
pkg/kubelet/dockershim/libdocker/client.go
View file @
e416f374
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
libdocker
import
(
"strings"
"time"
dockertypes
"github.com/docker/docker/api/types"
...
...
@@ -37,10 +36,6 @@ const (
StatusCreatedPrefix
=
"Created"
StatusExitedPrefix
=
"Exited"
// This is only used by GetKubeletDockerContainers(), and should be removed
// along with the function.
containerNamePrefix
=
"k8s"
// Fake docker endpoint
FakeDockerEndpoint
=
"fake://"
)
...
...
@@ -109,29 +104,3 @@ func ConnectToDockerOrDie(dockerEndpoint string, requestTimeout, imagePullProgre
glog
.
Infof
(
"Start docker client with request timeout=%v"
,
requestTimeout
)
return
newKubeDockerClient
(
client
,
requestTimeout
,
imagePullProgressDeadline
)
}
// GetKubeletDockerContainers lists all container or just the running ones.
// Returns a list of docker containers that we manage
// TODO: This function should be deleted after migrating
// test/e2e_node/garbage_collector_test.go off of it.
func
GetKubeletDockerContainers
(
client
Interface
,
allContainers
bool
)
([]
*
dockertypes
.
Container
,
error
)
{
result
:=
[]
*
dockertypes
.
Container
{}
containers
,
err
:=
client
.
ListContainers
(
dockertypes
.
ContainerListOptions
{
All
:
allContainers
})
if
err
!=
nil
{
return
nil
,
err
}
for
i
:=
range
containers
{
container
:=
&
containers
[
i
]
if
len
(
container
.
Names
)
==
0
{
continue
}
// Skip containers that we didn't create to allow users to manually
// spin up their own containers if they want.
if
!
strings
.
HasPrefix
(
container
.
Names
[
0
],
"/"
+
containerNamePrefix
+
"_"
)
{
glog
.
V
(
5
)
.
Infof
(
"Docker Container: %s is not managed by kubelet."
,
container
.
Names
[
0
])
continue
}
result
=
append
(
result
,
container
)
}
return
result
,
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