Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
56e72a6b
Commit
56e72a6b
authored
9 years ago
by
Jenkins
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Updates cleanup-containers"
parents
08f95533
556388e7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/cleanup-containers
+37
-1
37 additions, 1 deletion
tools/cleanup-containers
with
37 additions
and
1 deletion
tools/cleanup-containers
+
37
−
1
View file @
56e72a6b
#!/bin/bash
#!/bin/bash
docker
rm
$@
$(
docker ps
-a
-q
)
# Check if user is root
if
[[
$EUID
-ne
0
]]
;
then
echo
"You must execute this script as root."
1>&2
exit
1
fi
# Move to top level directory
REAL_PATH
=
$(
python
-c
"import os,sys;print os.path.realpath('
$0
')"
)
cd
"
$(
dirname
"
$REAL_PATH
"
)
/.."
# Remove docker containers
docker ps
-a
-q
|
while
read
-r
line
;
do
echo
"Removing docker containers"
docker
rm
-f
$line
done
# Spawning the neutron-agents container leaves artifacts on the host.
# This script removes these artifacts.
ip netns list |
while
read
-r
line
;
do
echo
"Removing network namespaces on the host"
ip netns delete
$line
done
ifconfig |
grep
tap |
awk
'{print $1;}'
|
cut
-f1
-d
':'
|
while
read
-r
line
;
do
echo
"Removing tap interfaces on the host"
ip
link
delete
$line
type
veth
done
ifconfig |
grep
brq |
awk
'{print $1;}'
|
cut
-f1
-d
':'
|
while
read
-r
line
;
do
echo
"Removing linux bridges on the host"
ip
link
delete
$line
type
bridge
done
ifconfig |
grep
vxlan |
awk
'{print $1;}'
|
cut
-f1
-d
':'
|
while
read
-r
line
;
do
echo
"Removing vxlan interfaces on the host"
ip
link
delete
$line
type
vxlan
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment