Skip to content

Commit

Permalink
install: Allow re-executing of the setup
Browse files Browse the repository at this point in the history
the install pod can fail and be re-scheduled. Modify the containerd
setup to allow re-execution without breaking the setup.

Fixes: confidential-containers#481

Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Jan 15, 2025
1 parent 0a664d9 commit a76bc06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions install/pre-install-payload/scripts/reqs-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ function configure_nydus_snapshotter_for_containerd() {
address = "/run/containerd-nydus/containerd-nydus-grpc.sock"
EOF
if grep -q "^imports = " "$tmp_containerd_config"; then
sed -i -e "s|^imports = \[\(.*\)\]|imports = [\"${containerd_imports_path}/nydus-snapshotter.toml\", \1]|g" "${tmp_containerd_config}"
sed -i -e "s|, ]|]|g" "${tmp_containerd_config}"
# Avoid adding the import twice
if ! grep "^imports = " "$tmp_containerd_config" | grep -q "\"${containerd_imports_path}/nydus-snapshotter.toml\""; then
sed -i -e "s|^imports = \[\(.*\)\]|imports = [\"${containerd_imports_path}/nydus-snapshotter.toml\", \1]|g" "${tmp_containerd_config}"
sed -i -e "s|, ]|]|g" "${tmp_containerd_config}"
fi
else
sed -i -e "1s|^|imports = [\"${containerd_imports_path}/nydus-snapshotter.toml\"]\n|" "${tmp_containerd_config}"
fi
Expand Down

0 comments on commit a76bc06

Please sign in to comment.