@@ -56,24 +56,24 @@ spec:
56
56
etcContainerd=${HOST_MOUNT_DIR}{{ .Values.containerRuntime.containerd.configFile }}
57
57
containerd_namespace=k8s.io
58
58
59
- # grep -q "# corrupted contents cleaned" $etcContainerd
60
- #
61
- # if [ $? -eq 0 ]; then
62
- # echo "The corrupted containerd images and contants have been cleaned."
63
- # else
64
- # namesapces=$(ctr namespace ls | tail +2 | awk '{print $1}')
65
- #
66
- # echo "Removing all corrupted images and contents in containerd..."
67
- # for namespace in $namesapces
68
- # do
69
- # echo "Removing corrupted images and contents in $namespace"
70
- # ctr -n $namespace image ls | tail +2 | awk '{print $1}' | xargs -I {} sudo ctr -n $namespace image rm {}
71
- # ctr -n $namespace content ls | tail +2 | awk '{print $1}' | xargs -I {} sudo ctr -n $namespace content rm {}
72
- # echo "Removed corrupted images and contents in $namespace"
73
- # done
74
- # echo "Removed all corrupted images and contents in containerd"
75
- # echo "# corrupted contents cleaned" >> $etcContainerd
76
- # fi
59
+ grep -q "# corrupted contents cleaned" $etcContainerd
60
+
61
+ if [ $? -eq 0 ]; then
62
+ echo "The corrupted containerd images and contants have been cleaned."
63
+ else
64
+ namesapces=$(ctr namespace ls | tail +2 | awk '{print $1}')
65
+
66
+ echo "Removing all corrupted images and contents in containerd..."
67
+ for namespace in $namesapces
68
+ do
69
+ echo "Removing corrupted images and contents in $namespace"
70
+ ctr -n $namespace image ls | tail +2 | awk '{print $1}' | xargs -I {} sudo ctr -n $namespace image rm {}
71
+ ctr -n $namespace content ls | tail +2 | awk '{print $1}' | xargs -I {} sudo ctr -n $namespace content rm {}
72
+ echo "Removed corrupted images and contents in $namespace"
73
+ done
74
+ echo "Removed all corrupted images and contents in containerd"
75
+ echo "# corrupted contents cleaned" >> $etcContainerd
76
+ fi
77
77
78
78
toml set --overwrite $etcContainerd plugins.\"io.containerd.grpc.v1.cri\".containerd.discard_unpacked_layers false
79
79
toml set --overwrite $etcContainerd plugins.\"io.containerd.grpc.v1.cri\".containerd.disable_snapshot_annotations false
0 commit comments