diff --git a/integration/kubernetes/cleanup_env.sh b/integration/kubernetes/cleanup_env.sh index a227b18c8..5f64190ad 100755 --- a/integration/kubernetes/cleanup_env.sh +++ b/integration/kubernetes/cleanup_env.sh @@ -40,7 +40,14 @@ main () { info "Stop ${CRI_RUNTIME} service" sudo systemctl stop "${CRI_RUNTIME}" + # 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 + + # 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"