From 72e612b6d91334156701de9ca3cc962807fa6654 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 16 Oct 2018 19:09:38 +0200 Subject: [PATCH] [swarm-mode] Remove --live-restore from Docker daemon options Ensure the --live-restore is not in the Docker daemon OPTIONS. Some images has this option by default which will cause the node not being able to perform it swarm init process. Change-Id: I287a5274143903fad5d4476e9d1640b26bdb46d4 Story: 2004095 Task: 27497 (cherry picked from commit 095b49e6f532f961854d8e0363e0f4aae01d189f) --- .../templates/swarm/fragments/add-docker-daemon-options.sh | 5 +++++ releasenotes/notes/swarm-live-restore-b03ad192367abced.yaml | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 releasenotes/notes/swarm-live-restore-b03ad192367abced.yaml diff --git a/magnum/drivers/common/templates/swarm/fragments/add-docker-daemon-options.sh b/magnum/drivers/common/templates/swarm/fragments/add-docker-daemon-options.sh index b08eb3132d..b5f7393b75 100644 --- a/magnum/drivers/common/templates/swarm/fragments/add-docker-daemon-options.sh +++ b/magnum/drivers/common/templates/swarm/fragments/add-docker-daemon-options.sh @@ -11,3 +11,8 @@ if [ "$TLS_DISABLED" = 'False' ]; then fi sed -i '/^OPTIONS=/ s#\(OPTIONS='"'"'\)#\1'"$opts"'#' /etc/sysconfig/docker + +# NOTE(tobias-urdin): The live restore option is only for standalone daemons. +# If its specified the swarm init will fail so we remove it here. +# See: https://docs.docker.com/config/containers/live-restore +sed -i 's/\ --live-restore//g' /etc/sysconfig/docker diff --git a/releasenotes/notes/swarm-live-restore-b03ad192367abced.yaml b/releasenotes/notes/swarm-live-restore-b03ad192367abced.yaml new file mode 100644 index 0000000000..05fbd32cbb --- /dev/null +++ b/releasenotes/notes/swarm-live-restore-b03ad192367abced.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed a bug where --live-restore was passed to Docker daemon causing the + swarm init to fail. Magnum now ensures the --live-restore is not passed + to the Docker daemon if it's default in an image.