Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Updating NetworkName to return proper name for user defined networks #88

Merged
calavera merged 1 commit intodocker-archive-public:masterfrom
msabansal:master
Feb 26, 2016
Merged

Updating NetworkName to return proper name for user defined networks #88
calavera merged 1 commit intodocker-archive-public:masterfrom
msabansal:master

Conversation

@msabansal
Copy link
Copy Markdown
Contributor

The network api doesn't return the proper network name for user defined networks and it causes issues with windows libnetwork integration. This fixes that and brings parity with Linux implementation.

@calavera
Copy link
Copy Markdown
Contributor

LGTM

@msabansal
Copy link
Copy Markdown
Contributor Author

Can we please get this merged? I need to start my review for docker daemon changes after this.

@thaJeztah
Copy link
Copy Markdown
Contributor

@msabansal to speed up the process; the vendor CI check is a separate check in the https://github.com/docker/docker repository; you can include these changes as part of your PR in docker/docker (which will make the vendor CI go red, but all other tests still run) but the PR can still be reviewed in parallel. Once the changes here are merged, you can update the vendor in the docker/docker PR to make the vendor CI go green

@msabansal
Copy link
Copy Markdown
Contributor Author

@thaJeztah Thanks. Done that.

@thaJeztah
Copy link
Copy Markdown
Contributor

Great, I saw you opened the PR, thanks!

@lowenna
Copy link
Copy Markdown
Contributor

lowenna commented Feb 25, 2016

ping @calavera @thaJeztah David/Sebastiaan - any chance we can get this merged so that we can proceed with the revendoring into docker/docker and the integration of HNS on Windows? Thanks 🐕

// IsBridge indicates whether container uses the bridge network stack
// in windows it is given the name NAT
func (n NetworkMode) IsBridge() bool {
return n == "NAT"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oooh - msabansal, should this be lowercase too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 yes, I think that should be changed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Doing this. This will however require a minor libnetwork change aswell. Making that aswell.

@thaJeztah
Copy link
Copy Markdown
Contributor

LGTM once that string is changed

…in windows and added missing APIs to the windows hostconfig file

Signed-off-by: msabansal <sabansal@microsoft.com>
calavera added a commit that referenced this pull request Feb 26, 2016
Updating NetworkName to return proper name for user defined networks
@calavera calavera merged commit 70d266e into docker-archive-public:master Feb 26, 2016
@calavera
Copy link
Copy Markdown
Contributor

merged! 🎉

@calavera
Copy link
Copy Markdown
Contributor

There have been some changes in engine-api that might make your life slightly more complicated than expected. You might want to wait until moby/moby#20565 is merged.

@lowenna
Copy link
Copy Markdown
Contributor

lowenna commented Feb 26, 2016

Thanks @calavera. @msabansal Over to you for the next one :)

return false
}

// IsBridge indicates whether container uses the bridge network stack
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From a networking perspective, this is one of the most confusing statements I have ever read. Why would bridge and nat be the same thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How so? The windows equivalent of the bridge mode is nat and is enabled through the WinNAT service.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A bridge is a very specific network device that "bridges" layer two packets over an interface, creating a single, layer 2 broadcast domain. A nat actually translates IP addresses between two separate networks, operating mostly at layer 3. There are protocols that work with one and not the other. For example, standard DHCP might run fine over a bridge but would require a relay or helper to work across a NAT boundary.

It sounds like windows doesn't really have the concept of a bridge. It would be better to leave out the concept of bridge than to have something claim it is a bridge but isn't.

I'm not privy to the implications of this behavior here, but it seems unwise to blur these concepts, as they are not at all the same. Even if they are two approaches to solve the same problem in docker, they have different trade offs and behavior.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants