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

introduce OmitEmpty in yaml processing pipeline #700

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

ndeloof
Copy link
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
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
8 checks passed
@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