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
434fba9e
Commit
434fba9e
authored
Mar 29, 2017
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm: clean up exited containers and network checkpoints
parent
f657607d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
reset.go
cmd/kubeadm/app/cmd/reset.go
+2
-2
No files found.
cmd/kubeadm/app/cmd/reset.go
View file @
434fba9e
...
@@ -107,14 +107,14 @@ func (r *Reset) Run(out io.Writer) error {
...
@@ -107,14 +107,14 @@ func (r *Reset) Run(out io.Writer) error {
dockerCheck
:=
preflight
.
ServiceCheck
{
Service
:
"docker"
,
CheckIfActive
:
true
}
dockerCheck
:=
preflight
.
ServiceCheck
{
Service
:
"docker"
,
CheckIfActive
:
true
}
if
warnings
,
errors
:=
dockerCheck
.
Check
();
len
(
warnings
)
==
0
&&
len
(
errors
)
==
0
{
if
warnings
,
errors
:=
dockerCheck
.
Check
();
len
(
warnings
)
==
0
&&
len
(
errors
)
==
0
{
fmt
.
Println
(
"[reset] Removing kubernetes-managed containers"
)
fmt
.
Println
(
"[reset] Removing kubernetes-managed containers"
)
if
err
:=
exec
.
Command
(
"sh"
,
"-c"
,
"docker ps
| grep 'k8s_' | awk '{print $1}'
| xargs -r docker rm --force --volumes"
)
.
Run
();
err
!=
nil
{
if
err
:=
exec
.
Command
(
"sh"
,
"-c"
,
"docker ps
-a --filter name=k8s_ -q
| xargs -r docker rm --force --volumes"
)
.
Run
();
err
!=
nil
{
fmt
.
Println
(
"[reset] Failed to stop the running containers"
)
fmt
.
Println
(
"[reset] Failed to stop the running containers"
)
}
}
}
else
{
}
else
{
fmt
.
Println
(
"[reset] docker doesn't seem to be running, skipping the removal of running kubernetes containers"
)
fmt
.
Println
(
"[reset] docker doesn't seem to be running, skipping the removal of running kubernetes containers"
)
}
}
dirsToClean
:=
[]
string
{
"/var/lib/kubelet"
,
"/etc/cni/net.d"
}
dirsToClean
:=
[]
string
{
"/var/lib/kubelet"
,
"/etc/cni/net.d"
,
"/var/lib/dockershim"
}
// Only clear etcd data when the etcd manifest is found. In case it is not found, we must assume that the user
// Only clear etcd data when the etcd manifest is found. In case it is not found, we must assume that the user
// provided external etcd endpoints. In that case, it is his own responsibility to reset etcd
// provided external etcd endpoints. In that case, it is his own responsibility to reset etcd
...
...
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