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

vendor: bump libnetwork bf2bd42abc0a3734f12b5ec724e571434e42c669 #40596

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 28, 2020

full diff: moby/libnetwork@264bffc...bf2bd42

relevant changes:

this should be the last one listed in #39392 (comment) to be vendored, so

fixes #39392 on master

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

Looks like CI is broken @StefanScherer

4296F8E3-AFDA-4B99-BAF2-5D738050DC02

@cpuguy83
Copy link
Member

Lots of macvlan/ipvlan failures.

@thaJeztah
Copy link
Member Author

Yes, noticed them; looks like it's related to that change. Not familiar enough with them to tell if the tests are incorrect, or if it's breaking things.

@arkodg @lemrouch PTAL

@thaJeztah thaJeztah added the status/failing-ci Indicates that the PR in its current state fails the test suite label Feb 28, 2020
@arkodg
Copy link
Contributor

arkodg commented Feb 28, 2020

@lemrouch couple of things I've realized after looking at

func testMacvlanInternalMode(client client.APIClient) func(*testing.T) {
and
func testMacvlanNilParent(client client.APIClient) func(*testing.T) {

We might still want to keep the dummyParent in case config.ConfigFrom is empty which will be needed so moby/libnetwork@43a5e91 will be needed to reworked to take care of that case

@arkodg
Copy link
Contributor

arkodg commented Feb 28, 2020

@lemrouch Looking at

func testMacvlanMultiSubnet(client client.APIClient) func(*testing.T) {
and
func testMacvlanAddressing(client client.APIClient) func(*testing.T) {

moby/libnetwork@8d1f97e
will be needed to be reworked to make sure we skip creating a gateway for an internal macvlan/ipvlan network only if an existing non-internal network exists

@lemrouch
Copy link
Contributor

lemrouch commented Mar 2, 2020

func testMacvlanInternalMode(client client.APIClient) func(*testing.T) {

and

func testMacvlanNilParent(client client.APIClient) func(*testing.T) {

Those tests are broken by design. They are basically saying: make sure isolated network is not isolated at all and can reach public ip address.

@lemrouch
Copy link
Contributor

lemrouch commented Mar 2, 2020

@lemrouch Looking at

func testMacvlanMultiSubnet(client client.APIClient) func(*testing.T) {

and

func testMacvlanAddressing(client client.APIClient) func(*testing.T) {

docker/libnetwork@8d1f97e
will be needed to be reworked to make sure we skip creating a gateway for an internal macvlan/ipvlan network only if an existing non-internal network exists

Again, internal networks should not mess with default gateways as this will break routing via regular network. The test is wrong.

@arkodg
Copy link
Contributor

arkodg commented Mar 2, 2020

@lemrouch Looking at

func testMacvlanMultiSubnet(client client.APIClient) func(*testing.T) {

and

func testMacvlanAddressing(client client.APIClient) func(*testing.T) {

docker/libnetwork@8d1f97e
will be needed to be reworked to make sure we skip creating a gateway for an internal macvlan/ipvlan network only if an existing non-internal network exists

Again, internal networks should not mess with default gateways as this will break routing via regular network. The test is wrong.

but @lemrouch these are not internal networks, just a macvlan network with an empty parent

@arkodg
Copy link
Contributor

arkodg commented Mar 2, 2020

also this err should not be nil, the test code looks fine to me

	_, err := container.Exec(timeoutCtx, client, id1, []string{"ping", "-c", "1", "-w", "1", "8.8.8.8"})
		// FIXME(vdemeester) check the time of error ?
		assert.Check(t, err != nil)

but the err is nil

macvlan_test.go:171: assertion failed: err is nil

@arkodg
Copy link
Contributor

arkodg commented Mar 3, 2020

+++ b/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go
@@ -61,8 +61,6 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, nInfo
        // if parent interface not specified, create a dummy type link to use named dummy+net_id
        if config.Parent == "" {
                config.Parent = getDummyName(stringid.TruncateID(config.ID))
-               // empty parent and --internal are handled the same. Set here to update k/v
-               config.Internal = true
        }
        foundExisting, err := d.createNetwork(config)
        if err != nil {
@@ -100,18 +98,16 @@ func (d *driver) createNetwork(config *configuration) (bool, error) {
                }
        }
        if !parentExists(config.Parent) {
-               // if the --internal flag is set, create a dummy link
-               if config.Internal {
+               // Create a dummy link
+               if config.Parent == getDummyName(stringid.TruncateID(config.ID)) {
                        err := createDummyLink(config.Parent, getDummyName(stringid.TruncateID(config.ID)))
                        if err != nil {
                                return false, err
                        }
                        config.CreatedSlaveLink = true
                        // notify the user in logs they have limited communications
-                       if config.Parent == getDummyName(stringid.TruncateID(config.ID)) {
-                               logrus.Debugf("Empty -o parent= and --internal flags limit communications to other containers inside of network: %s",
-                                       config.Parent)
-                       }
+                       logrus.Debugf("Empty -o parent= limit communications to other containers inside of network: %s",
+                               config.Parent)

fixes
--- PASS: TestDockerNetworkMacvlan/MultiSubnet (24.72s)
--- PASS: TestDockerNetworkMacvlan/Addressing (6.99s)

The above code tries to further separate the difference in meaning between empty Parent and internal network which can or cannot be the same

unclear why the below test is failing

=== FAIL: amd64.integration.network.macvlan TestDockerNetworkMacvlan/InternalMode (13.45s)
    --- FAIL: TestDockerNetworkMacvlan/InternalMode (13.45s)
        macvlan_test.go:171: assertion failed: err is nil
        macvlan_test.go:172: assertion failed: expression is false: timeoutCtx.Err() == context.DeadlineExceeded

@lemrouch
Copy link
Contributor

lemrouch commented Mar 3, 2020

unclear why the below test is failing

=== FAIL: amd64.integration.network.macvlan TestDockerNetworkMacvlan/InternalMode (13.45s)
    --- FAIL: TestDockerNetworkMacvlan/InternalMode (13.45s)
        macvlan_test.go:171: assertion failed: err is nil
        macvlan_test.go:172: assertion failed: expression is false: timeoutCtx.Err() == context.DeadlineExceeded

It's test for internal network. That means there is no default gateway anymore.
My guess is:

  • the ping used to try to pass ICMP packet to nonexistent gw (internal MACLAN network imagined one, remeber?) and timed out
  • now it has no default route so the ping gets ping: connect: Network is unreachable immediately

@arkodg
Copy link
Contributor

arkodg commented Mar 3, 2020

@lemrouch you're right, it still does give a nil error so the code can be changed to

-               timeoutCtx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
-               defer cancel()
-               _, err := container.Exec(timeoutCtx, client, id1, []string{"ping", "-c", "1", "-w", "1", "8.8.8.8"})
-               // FIXME(vdemeester) check the time of error ?
-               assert.Check(t, err != nil)
-               assert.Check(t, timeoutCtx.Err() == context.DeadlineExceeded)
+               result, _ := container.Exec(ctx, client, id1, []string{"ping", "-c", "1", "8.8.8.8"})
+               assert.Check(t, strings.Contains(result.Combined(), "Network is unreachable"))

which fixes the issue, will raise a PR for these soon

arkodg pushed a commit to arkodg/libnetwork that referenced this pull request Mar 3, 2020
moby#2419 and
moby#2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
moby/moby#40596 and exposed some
more plumbing that needed to be done to make sure
we seperate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
arkodg pushed a commit to arkodg/libnetwork that referenced this pull request Mar 4, 2020
moby#2419 and
moby#2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
moby/moby#40596 and exposed some
more plumbing that needed to be done to make sure
we seperate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
arkodg pushed a commit to arkodg/libnetwork that referenced this pull request Mar 4, 2020
moby#2419 and
moby#2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
moby/moby#40596 and exposed some
more plumbing that needed to be done to make sure
we separate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
@thaJeztah thaJeztah requested a review from tianon as a code owner March 5, 2020 23:04
@thaJeztah thaJeztah changed the title vendor: bump libnetwork d8334ccdb9be7f471e0ac15ff30f9d74da758ea3 vendor: bump libnetwork bf2bd42abc0a3734f12b5ec724e571434e42c669 Mar 5, 2020
@thaJeztah thaJeztah added impact/changelog and removed status/failing-ci Indicates that the PR in its current state fails the test suite labels Mar 5, 2020
@thaJeztah
Copy link
Member Author

Updated to current master, to include moby/libnetwork#2523, which should fix the CI failures

@AkihiroSuda
Copy link
Member

still failing

@thaJeztah
Copy link
Member Author

😢 @arkodg PTAL 🤗

Copy link
Contributor

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

LGTM

I encountered a similar problem and fixed by this PR moby/libnetwork#2519
(included in this vendor)

@arkodg
Copy link
Contributor

arkodg commented Mar 6, 2020

@thaJeztah TestDockerNetworkMacvlan/InternalMode and TestDockerNetworkIpvlan/L3InternalMode need to be rewritten to incorporate #40596 (comment)

@thaJeztah
Copy link
Member Author

@arkodg ah, sorry, overlooked that one, thought it was being handled by the changes in libnetwork 👍

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM , thanks for incorporating the test changes

@arkodg
Copy link
Contributor

arkodg commented Mar 6, 2020

@thaJeztah similar changes needed in TestDockerNetworkIpvlan/L2InternalMode as well, my bad

full diff: moby/libnetwork@264bffc...bf2bd42

relevant changes:

- moby/libnetwork#2407 Macvlan internal network should not change default gateway
    - fixes moby/libnetwork#2406 Internal macvlan network overrides default gateway
- vendor godbus/dbus v5
- Fix InhibitIPv4 nil panic
- Cleanup VFP during overlay network removal
    - fixes VFP leak in windows overlay network deletion

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

d'oh! I saw that test and wanted to check it, but was in a hurry and forgot. Thanks!

@trapier
Copy link
Contributor

trapier commented Mar 9, 2020

@thaJeztah: would like to see this in CE 19.03.8. Looks like the pattern for 19.03 is to backport from master. Would like to confirm intent to backport this for 19.03.8, as well as offer any assistance from Mirantis to help make it so.

@thaJeztah
Copy link
Member Author

Looks like the pattern for 19.03 is to backport from master. Would like to confirm intent to backport this for 19.03.8, as well as offer any assistance from Mirantis to help make it so.

For libnetwork, the 19.03 branch vendors from the corresponding bump_v19.03 branch in libnetwork (and 18.09 from the bump_v18.09 libnetwork branch).

I can open a bump PR for the 19.03 branch, or perhaps @SamWhited can update #40617 to get the latest changes from libnetwork

@thaJeztah
Copy link
Member Author

@cpuguy83 @AkihiroSuda @arkodg this is green now, PTAL 👍

@SamWhited
Copy link
Member

I can open a bump PR for the 19.03 branch, or perhaps @SamWhited can update #40617 to get the latest changes from libnetwork

Wilco.

@arkodg
Copy link
Contributor

arkodg commented Mar 9, 2020

@thaJeztah lets merge this PR
@SamWhited the failures in your PR for #40617 are unrelated to the failures encountered in this PR (and changes made here)

@SamWhited
Copy link
Member

Updated. Will take a look at any failures when CI finishes running.

@thaJeztah thaJeztah merged commit d5595a5 into moby:master Mar 9, 2020
@thaJeztah thaJeztah deleted the bump_libnetwork branch March 9, 2020 16:23
tle211212 pushed a commit to tle211212/libnetwork that referenced this pull request Apr 6, 2020
moby#2419 and
moby#2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
moby/moby#40596 and exposed some
more plumbing that needed to be done to make sure
we separate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
cpuguy83 pushed a commit to cpuguy83/docker that referenced this pull request May 25, 2021
moby/libnetwork#2419 and
moby/libnetwork#2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
moby#40596 and exposed some
more plumbing that needed to be done to make sure
we separate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants