signalfx / maestro-ng

Orchestration of Docker-based, multi-host environments
https://signalfx.com
Apache License 2.0
685 stars 83 forks source link

mode: ro in volume mappings does not work #218

Closed petrkalina closed 3 years ago

petrkalina commented 3 years ago

as par docs, this should be valid:

volumes:
  # This will be a read-write binding
  /on/the/host: /inside/the/container

  # This will be a read-only binding
  /also/on/the/host/:
    target: /inside/the/container/too
    mode: ro

however

                volumes:
                    /etc/passwd:
                        target: /etc/passwd
                        mode: ro

causes

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/maestro/__main__.py", line 186, in execute
    c = maestro.Conductor(config)
  File "/usr/local/lib/python3.8/dist-packages/maestro/maestro.py", line 71, in __init__
    entities.Container(
  File "/usr/local/lib/python3.8/dist-packages/maestro/entities.py", line 401, in __init__
    self.volumes = self._parse_volumes(config.get('volumes', {}))
  File "/usr/local/lib/python3.8/dist-packages/maestro/entities.py", line 762, in _parse_volumes
    _parse_spec(src, spec)
  File "/usr/local/lib/python3.8/dist-packages/maestro/entities.py", line 748, in _parse_spec
    result[spec] = {'bind': src, 'ro': False}
TypeError: unhashable type: 'dict'
mpetazzoni commented 3 years ago

@petrkalina This way of specifying a volume binding (with a dictionary) is not possible with Maestro schemas version 1 (which has been deprecated for a while). Can you make sure you have this at the top of your environment file to specify you're using the v2 schema?

__maestro:
  schema: 2