Removing armada log traces, binaries, and other files during cleanup

Change-Id: I07ca4ff0f07da1fc4515fece496f1b9118f0fbf4
This commit is contained in:
Roman Gorshunov 2018-01-30 09:47:51 -05:00
parent 7917237ae0
commit 1fe3ce3509

View File

@ -8,20 +8,35 @@ log () {
TO_RM=(
"/etc/apt/apt.conf.d/20-proxy.conf"
"/etc/apt/sources.list.d/promenade-sources.list"
"/etc/cni"
"/etc/coredns"
"/etc/docker/daemon.json"
"/etc/etcd"
"/etc/genesis"
"/etc/kubernetes"
"/etc/logrotate.d/json-logrotate"
"/etc/systemd/system/kubelet.service"
"/etc/systemd/system/docker.service.d/http-proxy.conf"
"/home/ceph"
"/usr/local/bin/armada"
"/usr/local/bin/helm"
"/usr/local/bin/kubectl"
"/usr/local/bin/promenade-teardown"
"/var/lib/anchor/calico-etcd-bootstrap"
"/var/lib/etcd"
"/var/lib/kubelet/pods"
"/var/lib/openstack-helm"
"/var/log/armada"
"/var/log/containers"
"/var/log/pods"
)
TO_LEAVE=(
"/etc/hosts"
"/etc/resolv.conf"
)
prune_docker() {
log "Docker prune"
@ -41,6 +56,12 @@ remove_files() {
done
}
leave_files() {
for item in "${TO_LEAVE[@]}"; do
log "WARNING: === ${item} === has been modified, but we didn't revert changes."
done
}
reset_docker() {
log "Remove all local Docker images"
docker images -qa | xargs --no-run-if-empty docker rmi -f
@ -113,3 +134,5 @@ systemctl daemon-reload
if [[ $RESET_DOCKER == "1" ]]; then
reset_docker
fi
leave_files