Skip to content

Commit 07efe6a

Browse files
committed
Bump swarmkit to 24fb4cf
Bumps the vendoring of github.com/docker/swarmkit to the above commit, which is the current master at commit time. Most notably, this includes a change making the ingress network respect the default address pool. Because of this change, a change to network integration tests was needed. Signed-off-by: Drew Erny <drew.erny@docker.com>
1 parent a9507c6 commit 07efe6a

File tree

19 files changed

+14647
-4517
lines changed

19 files changed

+14647
-4517
lines changed

integration/network/service_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ func TestServiceWithDefaultAddressPoolInit(t *testing.T) {
417417
assert.NilError(t, err)
418418
t.Logf("%s: NetworkInspect: %+v", t.Name(), out)
419419
assert.Assert(t, len(out.IPAM.Config) > 0)
420+
// As of docker/swarmkit#2890, the ingress network uses the default address
421+
// pool (whereas before, the subnet for the ingress network was hard-coded.
422+
// This means that the ingress network gets the subnet 20.20.0.0/24, and
423+
// the network we just created gets subnet 20.20.1.0/24.
424+
assert.Equal(t, out.IPAM.Config[0].Subnet, "20.20.1.0/24")
425+
426+
// Also inspect ingress network and make sure its in the same subnet
427+
out, err = cli.NetworkInspect(ctx, "ingress", types.NetworkInspectOptions{Verbose: true})
428+
assert.NilError(t, err)
429+
assert.Assert(t, len(out.IPAM.Config) > 0)
420430
assert.Equal(t, out.IPAM.Config[0].Subnet, "20.20.0.0/24")
421431

422432
err = cli.ServiceRemove(ctx, serviceID)

integration/service/create_test.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"io/ioutil"
7+
"strings"
78
"testing"
89
"time"
910

@@ -115,9 +116,33 @@ func TestCreateServiceMultipleTimes(t *testing.T) {
115116
err = client.ServiceRemove(context.Background(), serviceID2)
116117
assert.NilError(t, err)
117118

119+
// we can't just wait on no tasks for the service, counter-intuitively.
120+
// Tasks may briefly exist but not show up, if they are are in the process
121+
// of being deallocated. To avoid this case, we should retry network remove
122+
// a few times, to give tasks time to be deallcoated
118123
poll.WaitOn(t, swarm.NoTasksForService(ctx, client, serviceID2), swarm.ServicePoll)
119124

120-
err = client.NetworkRemove(context.Background(), overlayID)
125+
for retry := 0; retry < 5; retry++ {
126+
err = client.NetworkRemove(context.Background(), overlayID)
127+
// TODO(dperny): using strings.Contains for error checking is awful,
128+
// but so is the fact that swarm functions don't return errdefs errors.
129+
// I don't have time at this moment to fix the latter, so I guess I'll
130+
// go with the former.
131+
//
132+
// The full error we're looking for is something like this:
133+
//
134+
// Error response from daemon: rpc error: code = FailedPrecondition desc = network %v is in use by task %v
135+
//
136+
// The safest way to catch this, I think, will be to match on "is in
137+
// use by", as this is an uninterrupted string that best identifies
138+
// this error.
139+
if err == nil || !strings.Contains(err.Error(), "is in use by") {
140+
// if there is no error, or the error isn't this kind of error,
141+
// then we'll break the loop body, and either fail the test or
142+
// continue.
143+
break
144+
}
145+
}
121146
assert.NilError(t, err)
122147

123148
poll.WaitOn(t, network.IsRemoved(context.Background(), client, overlayID), poll.WithTimeout(1*time.Minute), poll.WithDelay(10*time.Second))

vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ github.com/containerd/ttrpc 92c8520ef9f86600c650dd540266
128128
github.com/gogo/googleapis d31c731455cb061f42baff3bda55bad0118b126b # v1.2.0
129129

130130
# cluster
131-
github.com/docker/swarmkit 7dded76ec532741c1ad9736cd2bb6d6661f0a386
131+
github.com/docker/swarmkit 24fb4cfe8af56803640180c5592bf32da732ced2
132132
github.com/gogo/protobuf ba06b47c162d49f2af050fb4c75bcbc86a159d5c # v1.2.1
133133
github.com/golang/protobuf aa810b61a9c79d51363740d207bb46cf8e620ed5 # v1.2.0
134134
github.com/cloudflare/cfssl 5d63dbd981b5c408effbb58c442d54761ff94fbd # 1.3.2

0 commit comments

Comments
 (0)