Simplify secrets assignment

Signed-off-by: legobt <6wbvkn0j@anonaddy.me>
This commit is contained in:
legobt 2024-07-31 07:18:26 +00:00
parent 9fdee76858
commit ea239c4b77
No known key found for this signature in database
GPG Key ID: C5F28D4B2B8927AB

View File

@ -579,11 +579,17 @@ def get_secret_args(compose, cnt, secret, podman_is_building=False):
dest_file = ""
secret_opts = ""
secret_target = None if isinstance(secret, str) else secret.get("target", None)
secret_uid = None if isinstance(secret, str) else secret.get("uid", None)
secret_gid = None if isinstance(secret, str) else secret.get("gid", None)
secret_mode = None if isinstance(secret, str) else secret.get("mode", None)
secret_type = None if isinstance(secret, str) else secret.get("type", None)
secret_target = None
secret_uid = None
secret_gid = None
secret_mode = None
secret_type = None
if isinstance(secret, dict):
secret_target = secret.get("target", None)
secret_uid = secret.get("uid", None)
secret_gid = secret.get("gid", None)
secret_mode = secret.get("mode", None)
secret_type = secret.get("type", None)
if source_file:
# assemble path for source file first, because we need it for all cases