mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-09 17:41:03 +02:00
Allow environment parameters without value
Signed-off-by: Sander Hoentjen <shoentjen@antagonist.nl>
This commit is contained in:
parent
456370bd46
commit
e84451f4ea
@ -2269,10 +2269,12 @@ def compose_exec(compose, args):
|
|||||||
podman_args += ["--tty"]
|
podman_args += ["--tty"]
|
||||||
env = dict(cnt.get("environment", {}))
|
env = dict(cnt.get("environment", {}))
|
||||||
if args.env:
|
if args.env:
|
||||||
additional_env_vars = dict(map(lambda each: each.split("="), args.env))
|
additional_env_vars = dict(
|
||||||
|
map(lambda each: each.split("=") if "=" in each else (each, None), args.env)
|
||||||
|
)
|
||||||
env.update(additional_env_vars)
|
env.update(additional_env_vars)
|
||||||
for name, value in env.items():
|
for name, value in env.items():
|
||||||
podman_args += ["--env", "%s=%s" % (name, value)]
|
podman_args += ["--env", f"{name}" if value is None else f"{name}={value}"]
|
||||||
podman_args += [container_name]
|
podman_args += [container_name]
|
||||||
if args.cnt_command is not None and len(args.cnt_command) > 0:
|
if args.cnt_command is not None and len(args.cnt_command) > 0:
|
||||||
podman_args += args.cnt_command
|
podman_args += args.cnt_command
|
||||||
|
Loading…
Reference in New Issue
Block a user