Skip to content

Commit

Permalink
module docker_compose_v2_run: fix env argument (#992)
Browse files Browse the repository at this point in the history
* module docker_compose_v2_run: fix env argument

* fix missing "--env" in docker_compose_v2_exec, and added changelog fragment

* Update changelogs/fragments/992-module-docker_compose_v2_run-fix-env-argument.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit e3b36e5)
  • Loading branch information
SantaBalazsLevente authored and patchback[bot] committed Nov 22, 2024
1 parent 9987b73 commit 87b72c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "docker_compose_v2_exec, docker_compose_v2_run - fix missing ``--env`` flag while assembling env arguments (https://github.com/ansible-collections/community.docker/pull/992)."
1 change: 1 addition & 0 deletions plugins/modules/docker_compose_v2_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def get_exec_cmd(self, dry_run, no_start=False):
args.append('--no-TTY')
if self.env:
for name, value in list(self.env.items()):
args.append('--env')
args.append('{0}={1}'.format(name, value))
args.append('--')
args.append(self.service)
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/docker_compose_v2_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def get_run_cmd(self, dry_run, no_start=False):
args.append('--no-TTY')
if self.env:
for name, value in list(self.env.items()):
args.append('--env')
args.append('{0}={1}'.format(name, value))
args.append('--')
args.append(self.service)
Expand Down

0 comments on commit 87b72c2

Please sign in to comment.