Skip to content

Commit

Permalink
nydus-snapshotter: remove config related to nydus after uninstalling
Browse files Browse the repository at this point in the history
Remove config related to nydus after uninstalling nydus snapshotter.

Fixes dragonflyoss#206

Signed-off-by: ChengyuZhu6 <[email protected]>
  • Loading branch information
ChengyuZhu6 committed Dec 14, 2023
1 parent 73f3d70 commit 75f98eb
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ spec:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.containerRuntime.containerd.enable }}
lifecycle:
preStop:
exec:
command:
- "/bin/sh"
- "-c"
- |
# Recover the containerd config file.
etcContainerd={{ .Values.containerRuntime.containerd.configFile }}
rm -f ${etcContainerd}
mv ${etcContainerd}.bak ${etcContainerd}
# currently, without host pid in container, we can not nsenter with pid and can not invoke systemctl correctly.
nsenter -t 1 -m systemctl -- restart containerd.service
postStart:
exec:
command:
Expand Down Expand Up @@ -101,13 +113,13 @@ spec:
- name: update-containerd
image: "{{ .Values.containerRuntime.initContainerImage }}"
imagePullPolicy: {{ .Values.pullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 12 }}
resources: {{ toYaml .Values.resources | indent 12 }}
command:
- /bin/sh
- -cx
- |-
etcContainerd={{ .Values.containerRuntime.containerd.configFile }}
cp ${etcContainerd} ${etcContainerd}.bak
toml check $etcContainerd proxy_plugins.nydus
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit 75f98eb

Please sign in to comment.