saltstack-formulas / docker-formula

Install and set up Docker
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
136 stars 330 forks source link

[BUG] Network specification should be a dict not list #326

Open olipinski opened 1 year ago

olipinski commented 1 year ago

Your setup

Formula commit hash / release tag

latest

Versions reports (master & minion)

3005.1

Pillar / config used

pillar a:

docker:
  networks:
    - a

pillar b:

docker:
  networks:
    - b

Bug details

Describe the bug

Currently, due to the ways that pillars are merged (https://github.com/saltstack/salt/issues/28394, https://github.com/saltstack-formulas/zabbix-formula/issues/60), one of the networks will get overwritten, resulting in the config passed to the formula as

docker:
  networks:
    - a

Instead of

docker:
  networks:
    - a
    - b

Steps to reproduce the bug

Attempt to apply the formula with pillars as above.

Expected behaviour

Passed config is:

docker:
  networks:
    - a
    - b

Attempts to fix the bug

Bug can be fixed easily by using dicts instead. Defining the pillars as:

pillar a:

docker:
  networks:
    a:

pillar b:

docker:
  networks:
    b:

gives the correct config passed with

docker:
  networks:
    a:
    b: