-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Conversation
Base: p.String(), | ||
Size: subnetSize, | ||
Base: p, | ||
Size: int(netConfig.SubnetSize), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 Report
@@ 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 |
@thaJeztah , PTAL. swarmkit refactor code got merged. |
Experimental failure is not related to this PR. 21:24:16 FAIL: docker_api_swarm_test.go:296: DockerSwarmSuite.TestAPISwarmLeaderElection |
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>
There was a problem hiding this 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) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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;
- Add sysctls support swarmkit#2729 Add sysctls support (relates to Add support for sysctl options in services #37701)
- Default Address Pool Code Refactor swarmkit#2732 Default Address Pool Code Refactor (relates to this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crosbymichael , @tonistiigi PTAL
@vdemeester PTAL |
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
experimental failure is a flaky test
|
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)