Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: bug with boolean docker options when substituting #968

Open
bertbesser opened this issue Feb 21, 2021 · 1 comment
Open

CLI: bug with boolean docker options when substituting #968

bertbesser opened this issue Feb 21, 2021 · 1 comment

Comments

@bertbesser
Copy link

bertbesser commented Feb 21, 2021

This workflow uses a boolean docker option

steps:
- id: hello
  uses: "docker://alpine"
  runs: ['sh', '-c']
  args: ['echo hello ${WHO}']
  env:
    WHO: $_WHO
  options:
    auto_remove: true

When running it via ./popper run --substitution _WHO=bert -f wf.yml the following error arises:

[...]
  File "/usr/local/lib/python3.7/site-packages/popper/commands/cmd_run.py", line 179, in cli
    allow_loose=allow_loose,
  File "/usr/local/lib/python3.7/site-packages/popper/parser.py", line 113, in parse
    _wf_data, substitutions=substitutions, allow_loose=allow_loose
  File "/usr/local/lib/python3.7/site-packages/popper/parser.py", line 198, in __apply_substitutions
    step[attr], k, v, used
  File "/usr/local/lib/python3.7/site-packages/popper/parser.py", line 144, in __apply_substitution
    if k in wf_element[ek]:
TypeError: argument of type 'bool' is not iterable

Trying to solve the issue making the bool a string (auto_remove: "true") gives the following error:

[...]
ERROR: 500 Server Error: Internal Server Error ("json: cannot unmarshal string into Go struct field HostConfig.AutoRemove of type bool")

I.e., the docker daemon will not handle a string but demands a bool.

Side note: The problem does not arise when no substitutions are given.

Expected behavior: Bc the docker daemon demands a boolean value, the bug should be fixed by making the substitutions code handle boolean values gracefully.

@bertbesser
Copy link
Author

Opened PR in #969 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant