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

Global Default AddressPool - Update #37736

Merged
merged 1 commit into from
Sep 14, 2018
Merged

Global Default AddressPool - Update #37736

merged 1 commit into from
Sep 14, 2018

Conversation

selansen
Copy link
Contributor

Addressing few review comments as part of code refactoring.
Also moved validation logic from CLI to Moby.

Signed-off-by: selansen elango.siva@docker.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

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

Base: p.String(),
Size: subnetSize,
Base: p,
Size: int(netConfig.SubnetSize),
Copy link
Member

Choose a reason for hiding this comment

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

Pity that we still need the conversion from uint32 to int here; I assume changing ipamutils.NetworkToSplit will be problematic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This old feature code spread across moby and libnetwork. I will have to go back and change everywhere.

@@ -67,8 +67,26 @@ type networkContext struct {
somethingWasDeallocated bool
}

// NetworkConfig is used to store network related cluster config in the Manager.
type NetworkConfig struct {
Copy link
Member

Choose a reason for hiding this comment

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

Can we define this type somewhere else? I see we now define it in two separate locations; once here, and once in manager/allocator/cnmallocator/networkallocator.go

Copy link
Contributor Author

@selansen selansen Aug 30, 2018

Choose a reason for hiding this comment

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

Initially Anshul suggested to keep it in manager/controlapi/network.go. I had an issue with "cyclic import" and discussed with him again to make sure I don't break if there is any existing swarmkit design rules. We decided to implement in allocator code. But again we had cnmallocator package where we got into "cyclic import" issue. Hence I decided to add one more place to avoid this issue. I will reach out to Anshul again for his comments and update accordingly. Is that ok ?

@codecov
Copy link

codecov bot commented Aug 30, 2018

Codecov Report

Merging #37736 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master   #37736      +/-   ##
==========================================
- Coverage   36.15%   36.11%   -0.04%     
==========================================
  Files         610      610              
  Lines       45054    45072      +18     
==========================================
- Hits        16288    16279       -9     
- Misses      26527    26554      +27     
  Partials     2239     2239

@selansen
Copy link
Contributor Author

@thaJeztah , PTAL. swarmkit refactor code got merged.

@selansen
Copy link
Contributor Author

Experimental failure is not related to this PR.


21:24:16 FAIL: docker_api_swarm_test.go:296: DockerSwarmSuite.TestAPISwarmLeaderElection
21:24:16
21:24:16 [d136471e69082] waiting for daemon to start
21:24:16 [d136471e69082] daemon started
21:24:16
21:24:16 [d465128c2bae8] waiting for daemon to start
21:24:16 [d465128c2bae8] daemon started
21:24:16
21:24:16 [d989d6d0ff770] waiting for daemon to start
21:24:16 [d989d6d0ff770] daemon started
21:24:16
21:24:16 [d136471e69082] exiting daemon
21:24:16 assertion failed: error is not nil: Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded
21:24:16 [d465128c2bae8] exiting daemon
21:24:16 [d989d6d0ff770] exiting daemon

daemon/cluster/listen_addr.go Outdated Show resolved Hide resolved
Addressing few review comments as part of code refactoring.
Also moved validation logic from CLI to Moby.

Signed-off-by: selansen <elango.siva@docker.com>
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

defaultAddrPool[i] = strings.TrimSpace(defaultAddrPool[i])
_, b, err := net.ParseCIDR(defaultAddrPool[i])
if err != nil {
return fmt.Errorf("invalid base pool %s: %v", defaultAddrPool[i], err)
Copy link
Member

Choose a reason for hiding this comment

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

nit: this could've used errors.Wrapf(err, "invalid base pool %s", defaultAddrPool[i]) to preserve the original err (not a blocker)

@@ -14,6 +13,7 @@ import (
"github.com/docker/docker/daemon/cluster/executor/container"
lncluster "github.com/docker/libnetwork/cluster"
swarmapi "github.com/docker/swarmkit/api"
swarmallocator "github.com/docker/swarmkit/manager/allocator/cnmallocator"
Copy link
Member

Choose a reason for hiding this comment

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

nit: was the alias needed here? (did it conflict, or was this just for readability?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for readability I added that like

@@ -125,7 +125,7 @@ github.com/containerd/ttrpc 94dde388801693c54f88a6596f713b51a8b30b2d
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef

# cluster
github.com/docker/swarmkit cfa742c8abe6f8e922f6e4e920153c408e7d9c3b
github.com/docker/swarmkit d7d23d763a2d47ad6e540f81ab3609f6c323e9be
Copy link
Member

Choose a reason for hiding this comment

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

Full diff: moby/swarmkit@cfa742c...d7d23d7

relevant changes;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@selansen
Copy link
Contributor Author

@vdemeester PTAL

Copy link
Contributor

@ctelfer ctelfer left a comment

Choose a reason for hiding this comment

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

LGTM

One comment. It looks like the swarmkit vendoring also carries with it at least one other update (in this case, sysctl settings for services). It would probably be good to mention that and any other PRs that get rolled in in the description here.

Copy link
Contributor

@tiborvass tiborvass 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
Copy link
Member

experimental failure is a flaky test

docker_cli_swarm_test.go:1143: DockerSwarmSuite.TestSwarmLockUnlockCluster

@thaJeztah thaJeztah merged commit 9299561 into moby:master Sep 14, 2018
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.

6 participants