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

fix: prevent network name ambiguity #9520

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

milas
Copy link
Contributor

@milas milas commented Jun 1, 2022

What I did
NetworkInspect will match a network ID by prefix. While rare,
it's possible that users might use a network name that is also
a valid network ID prefix for a pre-existing Docker network.
(In the reported case, the network was named db, for example.)

Changed this to use NetworkList with a filter by name, so that
only the exact network will be found (if it exists).

Related issue
Fixes #9496

(not mandatory) A picture of a cute animal, if possible in relation with what you did
dog swimming with many otters

`NetworkInspect` will match a network ID by prefix. While rare,
it's possible that users might use a network name that is also
a valid network ID prefix for a pre-existing Docker network.
(In the reported case, the network was named `db`, for example.)

Fixes docker#9496.

Signed-off-by: Milas Bowman <milas@tilt.dev>
@milas milas self-assigned this Jun 1, 2022
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 merged commit d5528f3 into docker:v2 Jun 2, 2022
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.

[docker compose] Container custom network name can't be the beginning of the none network id
2 participants