From a174f36fa28613267d6b22cb3b926f76d891ea8b Mon Sep 17 00:00:00 2001 From: Justin Alvarez Date: Tue, 31 Oct 2023 14:35:33 -0400 Subject: [PATCH] fix: soci being reset on vm stop/start Signed-off-by: Justin Alvarez --- pkg/config/lima_config_applier.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/config/lima_config_applier.go b/pkg/config/lima_config_applier.go index 68db18892..becd01bb0 100644 --- a/pkg/config/lima_config_applier.go +++ b/pkg/config/lima_config_applier.go @@ -23,17 +23,14 @@ const ( sociFileNameFormat = "soci-snapshotter-%s-linux-%s.tar.gz" sociDownloadURLFormat = "https://github.com/awslabs/soci-snapshotter/releases/download/v%s/%s" sociServiceDownloadURLFormat = "https://raw.githubusercontent.com/awslabs/soci-snapshotter/v%s/soci-snapshotter.service" - sociInstallationScriptFormat = `%s + //nolint:lll // command string + sociInstallationScriptFormat = `%s if [ ! -f /usr/local/bin/soci ]; then # download soci set -e curl --retry 2 --retry-max-time 120 -OL "%s" # move to usr/local/bin tar -C /usr/local/bin -xvf %s soci soci-snapshotter-grpc - # changing containerd config - echo " [proxy_plugins.soci] - type = \"snapshot\" - address = \"/run/soci-snapshotter-grpc/soci-snapshotter-grpc.sock\" " >> /etc/containerd/config.toml # install as a systemd service curl --retry 2 --retry-max-time 120 -OL "%s" @@ -45,6 +42,11 @@ if [ ! -f /usr/local/bin/soci ]; then systemctl enable --now soci-snapshotter fi +# changing containerd config, this seems to get reset on every VM stop/start +if ! grep -q soci /etc/containerd/config.toml; then + printf ' [proxy_plugins.soci]\n type = "snapshot"\n address = "/run/soci-snapshotter-grpc/soci-snapshotter-grpc.sock"\n' >> /etc/containerd/config.toml +fi + sudo systemctl restart containerd.service `