fix(create): hande non existing secret files
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Moritz 2023-10-20 00:17:44 +02:00
parent 2bb27aadc4
commit 354f964e7d
1 changed files with 3 additions and 0 deletions

View File

@ -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)