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

secrets & config mount merge violates compose spec #662

Open
edwardpeek-crown opened this issue Jul 11, 2024 · 0 comments
Open

secrets & config mount merge violates compose spec #662

edwardpeek-crown opened this issue Jul 11, 2024 · 0 comments

Comments

@edwardpeek-crown
Copy link

Per https://github.com/compose-spec/compose-spec/blob/master/13-merge.md#unique-resources

Applies to the ports, volumes, secrets and configs services attributes. While these types are modeled in a Compose file as a sequence, they have special uniqueness requirements:

Attribute Unique key
volumes target
secrets source
configs source
ports {ip, target, published, protocol}

But current behaviour is to merge based on target instead, as demonstrated by https://github.com/compose-spec/compose-go/blob/main/override/merge_mounts_test.go :

services:
  test:
    image: foo
    secrets:
      - foo
      - bar
      - zot

merged with

services:
  test:
    image: foo
    secrets:
      - source: zot
        target: /run/secrets/foo

results in

services:
  test:
    image: foo
    secrets:
      - source: zot
        target: /run/secrets/foo
      - bar
      - zot

Per compose spec the output should be

services:
  test:
    image: foo
    secrets:
      - foo
      - bar
      - source: zot
        target: /run/secrets/foo
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