File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,11 @@ else
153153 if command -v ctr > /dev/null 2>&1 ; then
154154 echo " Cleaning up containerd snapshots..."
155155 # List and remove any active snapshots using containerd API
156- for snap in $( ctr --address /run/firecracker-containerd/containerd.sock snapshots list -q 2> /dev/null || true) ; do
157- echo " Removing containerd snapshot: $snap "
158- ctr --address /run/firecracker-containerd/containerd.sock snapshots remove " $snap " 2> /dev/null || true
156+ for snap in $( ctr --address /run/firecracker-containerd/containerd.sock snapshots list 2> /dev/null | tail -n +2 | awk ' {print $1}' || true) ; do
157+ if [ -n " $snap " ] && [ " $snap " != " KEY" ]; then
158+ echo " Removing containerd snapshot: $snap "
159+ ctr --address /run/firecracker-containerd/containerd.sock snapshots remove " $snap " 2> /dev/null || true
160+ fi
159161 done
160162
161163 # Give containerd time to release device references
164166
165167 # Sync filesystem and drop caches to help release any remaining references
166168 sync
167- echo 1 > /proc/sys/vm/drop_caches 2> /dev/null || true
169+ sudo bash -c ' echo 1 > /proc/sys/vm/drop_caches' 2> /dev/null || true
168170
169171 pool_remove
170172 fi
You can’t perform that action at this time.
0 commit comments