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

Strip empty DNS entries to avoid Moby parse errors when creating sandbox DNS #11691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IvanRibakov
Copy link

@IvanRibakov IvanRibakov commented Apr 5, 2024

What I did

Ensured that each service's DNS settings are stripped from empty entries that could result from using ENV variables that defaulted to blank strings.

For example:

  service:
    # ANOTHER_SERVICE_IP is not set and defaults to blank string
    dns: ${ANOTHER_SERVICE_IP}
    ...

Related issue
#11690

@IvanRibakov IvanRibakov force-pushed the 11690-filter-empty-dns-entries branch from dc1eef6 to b6980b7 Compare April 8, 2024 06:23
@IvanRibakov IvanRibakov closed this Apr 8, 2024
@IvanRibakov IvanRibakov reopened this Apr 8, 2024
@IvanRibakov IvanRibakov force-pushed the 11690-filter-empty-dns-entries branch from b6980b7 to 0729508 Compare April 8, 2024 14:24
@IvanRibakov
Copy link
Author

Is there anything I could do to help move this PR forward?

@glours glours force-pushed the 11690-filter-empty-dns-entries branch from 0729508 to 9ac993f Compare May 22, 2024 09:24
@glours glours requested review from a team, ndeloof, glours, milas and jhrotko and removed request for a team May 22, 2024 09:24
glours
glours previously approved these changes May 22, 2024
Copy link
Contributor

@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

@glours glours dismissed their stale review May 22, 2024 10:08

I changed my mind, if we start doing this for dns property then we'll have to do this everywhere else, I think this should be manage upstream

@ndeloof
Copy link
Contributor

ndeloof commented May 22, 2024

Implementation is correct but IMHO this issue will apply to way more places, not just dns. We miss a way to mark an entry in compose.yaml as "to be ignored if value is empty". I wonder it would be better we introduce a global mechanism for this purpose, maybe comparable to !override:

 service:
    # ANOTHER_SERVICE_IP is not set and defaults to blank string
    dns: !omitempty ${ANOTHER_SERVICE_IP} 
    ...

…NS in Moby

Signed-off-by: Ivan Ribakov <i.ribakov@zaleos.net>
@IvanRibakov IvanRibakov force-pushed the 11690-filter-empty-dns-entries branch from 9ac993f to 80b1ebf Compare May 22, 2024 11:18
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.

None yet

3 participants