Skip to content

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 [email protected]

- 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)

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.

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

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

Signed-off-by: selansen <[email protected]>
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)

"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


# 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

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