Skip to content

introduce OmitEmpty in yaml processing pipeline#700

Merged
glours merged 1 commit intocompose-spec:mainfrom
ndeloof:omitempty
Oct 24, 2024
Merged

introduce OmitEmpty in yaml processing pipeline#700
glours merged 1 commit intocompose-spec:mainfrom
ndeloof:omitempty

Conversation

@ndeloof
Copy link
Copy Markdown
Collaborator

@ndeloof ndeloof commented Oct 17, 2024

Introduce a generic mechanism to drop attributes with an empty value. A typical scenario is: attribute is set by an interpolation variable, which resolves to empty string (maybe variable is unset? Then other already got a warning). Some attribute are just irrelevant with an empty value, so need to be ignored. Better just remove those from model

This first iteration drops empty dns as requested on docker/compose#11690
This relies on the path pattern syntax used in other yaml processing stages, so we can easily add more "omit" rules.

closes docker/compose#11690

@ndeloof ndeloof requested review from glours and jhrotko October 17, 2024 08:10
Copy link
Copy Markdown
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>
@glours glours enabled auto-merge (rebase) October 24, 2024 10:25
@glours glours merged commit 156e22d into compose-spec:main Oct 24, 2024
@ndeloof ndeloof deleted the omitempty branch October 24, 2024 12:13
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.

Filter out empty DNS entries

2 participants