From c628afe9ffe7326363d60a42712eb74658b2472a Mon Sep 17 00:00:00 2001 From: Ryan Savino Date: Fri, 20 Oct 2023 16:57:19 -0500 Subject: [PATCH] nydus: cleanup Cleanup created nydus snapshots and var directory Fixes: #5787 Signed-Off-By: Ryan Savino --- integration/kubernetes/cleanup_env.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration/kubernetes/cleanup_env.sh b/integration/kubernetes/cleanup_env.sh index a227b18c8..af275bdd6 100755 --- a/integration/kubernetes/cleanup_env.sh +++ b/integration/kubernetes/cleanup_env.sh @@ -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 || true`; 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"