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 15, 2023
1 parent 73f3d70 commit c8f3f40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/nydus-snapshotter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: nydus-snapshotter
description: Nydus snapshotter is an external plugin of containerd for Nydus image service which implements a chunk-based content-addressable filesystem on top of a called RAFS.
icon: https://github.com/dragonflyoss/image-service/raw/master/misc/logo.svg
type: application
version: 0.0.7
version: 0.0.8
appVersion: 0.9.0
keywords:
- nydus
Expand Down
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 c8f3f40

Please sign in to comment.