From 354f964e7d33ffd0b1110a113f5721d81f4a8c39 Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 20 Oct 2023 00:17:44 +0200 Subject: [PATCH] fix(create): hande non existing secret files --- backupbot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backupbot.py b/backupbot.py index 7efae8f..ac7beb8 100755 --- a/backupbot.py +++ b/backupbot.py @@ -121,6 +121,9 @@ def copy_secrets(apps): container_id = container_by_service[s.name].id for sec in app_secs: src = f'/var/lib/docker/containers/{container_id}/mounts/secrets/{sec["SecretID"]}' + if not Path(src).exists(): + logging.error(f"For the secret {sec['SecretName']} the file {src} does not exist for {s.name}") + continue dst = SECRET_PATH + sec['SecretName'] copyfile(src, dst)