Skip to content

Vendor in Libnetwork changes#41604

Merged
thaJeztah merged 2 commits into
moby:masterfrom
arkodg:bump-libnetwork-ipv6nat
Nov 5, 2020
Merged

Vendor in Libnetwork changes#41604
thaJeztah merged 2 commits into
moby:masterfrom
arkodg:bump-libnetwork-ipv6nat

Conversation

@arkodg

@arkodg arkodg commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

Bring in changes from moby/libnetwork#2572 to moby

Signed-off-by: Arko Dasgupta [email protected]

@arkodg
arkodg requested a review from tianon as a code owner October 29, 2020 21:20
Bring in changes from moby/libnetwork#2572 to moby

Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg
arkodg force-pushed the bump-libnetwork-ipv6nat branch from 4f9e1f6 to 1623e6b Compare October 29, 2020 21:32
@arkodg

arkodg commented Oct 29, 2020

Copy link
Copy Markdown
Contributor Author

cc @bboehmke

@thaJeztah

thaJeztah commented Nov 2, 2020

Copy link
Copy Markdown
Member

Seeing a failure that may be relevant;

 WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [
/go/src/github.com/docker/docker/integration-cli/docker_cli_daemon_test.go:948:15: Exists not declared by package iptables
/go/src/github.com/docker/docker/integration-cli/docker_cli_daemon_test.go:948:70: Exists not declared by package iptables
/go/src/github.com/docker/docker/integration-cli/docker_cli_daemon_test.go:953:14: Exists not declared by package iptables
/go/src/github.com/docker/docker/integration-cli/docker_cli_daemon_test.go:953:68: Exists not declared by package iptables
] 

Comment on lines -398 to +445
func Exists(table Table, chain string, rule ...string) bool {
return exists(false, table, chain, rule...)
func (iptable IPTable) Exists(table Table, chain string, rule ...string) bool {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like this is causing the failure

@bboehmke bboehmke Nov 2, 2020

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.

To reduce code duplication the code of the iptables was reused for ip6tables.

A simple change in the integration-cli/docker_cli_daemon_test.go should fix this:

diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go
index d5fa41c29e..4b578def25 100644
--- a/integration-cli/docker_cli_daemon_test.go
+++ b/integration-cli/docker_cli_daemon_test.go
@@ -945,12 +945,14 @@ func (s *DockerDaemonSuite) TestDaemonLinksIpTablesRulesWhenLinkAndUnlink(c *tes
 
        sourceRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", childIP, "--sport", "80", "-d", parentIP, "-j", "ACCEPT"}
        destinationRule := []string{"-i", bridgeName, "-o", bridgeName, "-p", "tcp", "-s", parentIP, "--dport", "80", "-d", childIP, "-j", "ACCEPT"}
-       if !iptables.Exists("filter", "DOCKER", sourceRule...) || !iptables.Exists("filter", "DOCKER", destinationRule...) {
+
+       iptable := iptables.GetIptable(iptables.IPv4)
+       if !iptable.Exists("filter", "DOCKER", sourceRule...) || !iptable.Exists("filter", "DOCKER", destinationRule...) {
                c.Fatal("Iptables rules not found")
        }
 
        s.d.Cmd("rm", "--link", "parent/http")
-       if iptables.Exists("filter", "DOCKER", sourceRule...) || iptables.Exists("filter", "DOCKER", destinationRule...) {
+       if iptable.Exists("filter", "DOCKER", sourceRule...) || iptable.Exists("filter", "DOCKER", destinationRule...) {
                c.Fatal("Iptables rules should be removed when unlink")
        }

Edit: fixed diff

@arkodg
arkodg force-pushed the bump-libnetwork-ipv6nat branch from d2775ce to dfc2d77 Compare November 3, 2020 23:04
@arkodg
arkodg requested a review from thaJeztah November 4, 2020 01:50

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
thaJeztah merged commit c90671b into moby:master Nov 5, 2020
@thaJeztah thaJeztah added this to the 20.10.0 milestone Nov 19, 2020
@arkodg
arkodg deleted the bump-libnetwork-ipv6nat branch November 20, 2020 01:03
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.

4 participants