Skip to content

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Jan 26, 2024

Introduce !override so one can replace any entry in compose.override.yaml, while !reset would remove but not allow to re-define
i.e:

  • foo: !reset null removes foo attribute from merged yaml (value is ignored)
  • foo: !override hello overrides any previous foo attribute value with new value "hello"

TODO: document this on the compose spec

fixes docker/compose#11408

Copy link
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof changed the title !reset can be used to replace value !override can be used to replace value Jan 26, 2024
@laurazard
Copy link
Member

This makes it read a bit weird, no? If !reset only removes and does not allow to redefine, having to write:

foo: !reset null

is a bit weird, I would expect to just write

foo: !reset

Can we assume null when there is no value for !reset? (ignore this if that's already something we can do)

@ndeloof
Copy link
Collaborator Author

ndeloof commented Jan 26, 2024

@laurazard I we one can, but !reset is just a yaml tag, yaml syntax requires a value. Can also use:

foo: !reset {}

@laurazard
Copy link
Member

RIght, I had a vague idea from when I was looking into the tags there was some reason why it was required. Regardless, that's unrelated to this change, !override sounds good to me.

@ndeloof ndeloof merged commit 38547bf into compose-spec:main Jan 29, 2024
@ndeloof ndeloof deleted the issue_11408 branch January 29, 2024 10:50
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 this pull request may close these issues.

[BUG] Regression when overriding networks
3 participants