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

unescaped conf_overrides can cause it to fail #19

Closed
mandre opened this issue Mar 11, 2024 · 0 comments · Fixed by #20
Closed

unescaped conf_overrides can cause it to fail #19

mandre opened this issue Mar 11, 2024 · 0 comments · Fixed by #20

Comments

@mandre
Copy link
Contributor

mandre commented Mar 11, 2024

The following conf_overrides causes devstack-action to fail in a non obvious way:

conf_overrides: |
    [[post-config|/etc/neutron/port_binding.yaml]]
    "create_port:binding:profile": "rule:admin_only or rule:service_api"
  # This must stay at the end to allow any overrides
  if [[ "[[post-config|/etc/neutron/port_binding.yaml]]
  "create_port:binding:profile": "rule:admin_only or rule:service_api"
  " != "" ]]; then
    echo "[[post-config|/etc/neutron/port_binding.yaml]]
  "create_port:binding:profile": "rule:admin_only or rule:service_api"
  " >> local.conf
  fi
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
/home/runner/work/_temp/8e8cc504-91e3-483d-ae82-3043be538428.sh: line 34: conditional binary operator expected

We should use heredoc to insert overrides rather than echo to remove the need to shell escape the string.

mandre added a commit to mandre/devstack-action that referenced this issue Mar 11, 2024
Use heredoc syntax to append the value of `conf_overrides` to the
`local.conf` file. Compared to the previous solution using `echo`, this
removes the need to shell escape your value.

Also remove the useless test, since the default value for
`inputs.conf_overrides` is an empty string which results in a noop.

Fixes EmilienM#19.
mandre added a commit to mandre/devstack-action that referenced this issue Mar 11, 2024
Use heredoc syntax to append the value of `conf_overrides` to the
`local.conf` file. Compared to the previous solution using `echo`, this
removes the need to shell escape your value.

Also remove the useless test, since the default value for
`inputs.conf_overrides` is an empty string which results in a noop.

Fixes EmilienM#19.
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

Successfully merging a pull request may close this issue.

1 participant