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

daemon: windows: set DNS config on all adapters #46844

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

akerouanton
Copy link
Member

@akerouanton akerouanton commented Nov 23, 2023

Related to:

- What I did

DNS config is a property of each adapter on Windows, thus we've a dedicated EndpointOption for that.

The list of EndpointOption that should be applied to a given endpoint is built by buildCreateEndpointOptions. This function contains a seemingly flawed condition that adds the DNS config iff:

  1. the network isn't internal ;
  2. no ports are published / exposed through another sandbox endpoint ;

While 1. does make sense, there's actually no justification for 2., hence this commit remove this part of the condition.

This logic flaw has been made obvious by 0fd0e82, but it was originally introduced by d1e0a78. Commit and PR comments don't mention why this is done like so. Most probably, this was overlooked both by the original author and the PR reviewers.

@akerouanton akerouanton self-assigned this Nov 23, 2023
@akerouanton akerouanton changed the title Fix/windows adapter dns param daemon: windows: set DNS config on all adapters Nov 23, 2023
DNS config is a property of each adapter on Windows, thus we've a
dedicated `EndpointOption` for that.

The list of `EndpointOption` that should be applied to a given endpoint
is built by `buildCreateEndpointOptions`. This function contains a
seemingly flawed condition that adds the DNS config _iff_:

1. the network isn't internal ;
2. no ports are published / exposed through another sandbox endpoint ;

While 1. does make sense, there's actually no justification for 2.,
hence this commit remove this part of the condition.

This logic flaw has been made obvious by 0fd0e82, but it was originally
introduced by d1e0a78. Commit and PR comments don't mention why this is
done like so. Most probably, this was overlooked both by the original
author and the PR reviewers.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
@akerouanton akerouanton marked this pull request as ready for review November 23, 2023 17:41
Copy link
Contributor

@robmry robmry left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah added this to the 25.0.0 milestone Nov 23, 2023
@thaJeztah thaJeztah merged commit cfdca8d into moby:master Nov 23, 2023
105 checks passed
@akerouanton akerouanton deleted the fix/windows-adapter-dns-param branch November 24, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants