Skip to content

Commit 761a48e

Browse files
author
ChengyuZhu6
committed
nydus-snapshotter: remove config related to nydus after uninstalling
Remove config related to nydus after uninstalling nydus snapshotter. Fixes dragonflyoss#206 Signed-off-by: ChengyuZhu6 <[email protected]>
1 parent 73f3d70 commit 761a48e

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

charts/nydus-snapshotter/templates/nydus-snapshotter/snapshotter-daemonset.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,26 @@ spec:
101101
- name: update-containerd
102102
image: "{{ .Values.containerRuntime.initContainerImage }}"
103103
imagePullPolicy: {{ .Values.pullPolicy | quote }}
104-
resources:
105-
{{ toYaml .Values.resources | indent 12 }}
104+
resources: {{ toYaml .Values.resources | indent 12 }}
105+
lifecycle:
106+
preStop:
107+
exec:
108+
command:
109+
- "/bin/sh"
110+
- "-c"
111+
- |
112+
# Recover the containerd config file.
113+
etcContainerd={{ .Values.containerRuntime.containerd.configFile }}
114+
rm -f ${etcContainerd}
115+
mv ${etcContainerd}.bak ${etcContainerd}
116+
# currently, without host pid in container, we can not nsenter with pid and can not invoke systemctl correctly.
117+
nsenter -t 1 -m systemctl -- restart containerd.service
106118
command:
107119
- /bin/sh
108120
- -cx
109121
- |-
110122
etcContainerd={{ .Values.containerRuntime.containerd.configFile }}
123+
cp ${etcContainerd} ${etcContainerd}.bak
111124
112125
toml check $etcContainerd proxy_plugins.nydus
113126
if [ $? -eq 0 ]; then

0 commit comments

Comments
 (0)