EmilienM / devstack-action

Github actions for Devstack
Apache License 2.0
6 stars 3 forks source link

unescaped conf_overrides can cause it to fail #19

Closed mandre closed 8 months ago

mandre commented 8 months ago

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.