Skip to content

Commit

Permalink
nydus: cleanup
Browse files Browse the repository at this point in the history
Cleanup created nydus snapshots and var directory

Fixes: kata-containers#5787

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
  • Loading branch information
ryansavino committed Oct 23, 2023
1 parent 69dafd0 commit dd88b7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integration/kubernetes/cleanup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ main () {
[ "${container_engine}" == "docker" ] && restart_docker_service
registry_server_teardown

# Remove created nydus snapshots
for i in `sudo ctr -n k8s.io snapshot --snapshotter nydus list | grep -v KEY | cut -d' ' -f1`; do
sudo ctr -n k8s.io snapshot --snapshotter nydus rm $i
done

info "Stop ${CRI_RUNTIME} service"
sudo systemctl stop "${CRI_RUNTIME}"

# Cleanup nydus process, directories and binaries
sudo kill -9 $(pidof "containerd-nydus-grpc") || true
sudo rm -rf "/var/lib/containerd-nydus" || true
sudo rm -f "/usr/local/bin/nydus-overlayfs"
sudo rm -f "/usr/local/bin/nydus-image"

Expand Down

0 comments on commit dd88b7b

Please sign in to comment.