diff options
author | Christian Breunig <christian@breunig.cc> | 2023-07-25 22:21:11 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-07-25 22:21:11 +0200 |
commit | c473f6475f90d17529cc9e4da939560c04b60bda (patch) | |
tree | c1242fda5548a87cb8d094bbe0868f460ec6dc10 /src/migration-scripts/container | |
parent | 8966841cdfe753437f45bf8a3d6d462392320f5e (diff) | |
download | vyos-1x-c473f6475f90d17529cc9e4da939560c04b60bda.tar.gz vyos-1x-c473f6475f90d17529cc9e4da939560c04b60bda.zip |
container: T5365: ensure container mogration systemd steps are run with sudo
Diffstat (limited to 'src/migration-scripts/container')
-rwxr-xr-x | src/migration-scripts/container/0-to-1 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/migration-scripts/container/0-to-1 b/src/migration-scripts/container/0-to-1 index 9fcf295e8..86f89ee04 100755 --- a/src/migration-scripts/container/0-to-1 +++ b/src/migration-scripts/container/0-to-1 @@ -39,12 +39,12 @@ config = ConfigTree(config_file) if config.exists(base): for container in config.list_nodes(base): # Stop any given container first - call(f'systemctl stop vyos-container-{container}.service') + call(f'sudo systemctl stop vyos-container-{container}.service') # Export container image for later re-import to new filesystem. We store # the backup on a real disk as a tmpfs (like /tmp) could probably lack # memory if a host has too many containers stored. image_name = config.return_value(base + [container, 'image']) - call(f'podman image save --quiet --output /root/{container}.tar --format oci-archive {image_name}') + call(f'sudo podman image save --quiet --output /root/{container}.tar --format oci-archive {image_name}') # No need to adjust the strage driver online (this is only used for testing and # debugging on a live system) - it is already overlay2 when the migration script @@ -66,10 +66,10 @@ if config.exists(base): # Export container image for later re-import to new filesystem image_name = config.return_value(base + [container, 'image']) image_path = f'/root/{container}.tar' - call(f'podman image load --quiet --input {image_path}') + call(f'sudo podman image load --quiet --input {image_path}') # Start any given container first - call(f'systemctl start vyos-container-{container}.service') + call(f'sudo systemctl start vyos-container-{container}.service') # Delete temporary container image if os.path.exists(image_path): |