diff options
author | selansen <elango.siva@docker.com> | 2018-11-20 16:44:40 -0500 |
---|---|---|
committer | selansen <elango.siva@docker.com> | 2018-11-22 17:35:02 -0500 |
commit | 32180ac0c77760d9023c34c73ea9f0c41a41c7cd (patch) | |
tree | 9eba366f2b90961d1c69628a94dc5be9ebc74c18 /internal | |
parent | a7ce3140f55715439646da1f08ef2c64dbe7a8ec (diff) | |
download | docker-32180ac0c77760d9023c34c73ea9f0c41a41c7cd.tar.gz |
VXLAN UDP Port configuration support
This commit contains changes to configure DataPathPort
option. By default we use 4789 port number. But this commit
will allow user to configure port number during swarm init.
DataPathPort can't be modified after swarm init.
Signed-off-by: selansen <elango.siva@docker.com>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/test/daemon/daemon.go | 1 | ||||
-rw-r--r-- | internal/test/daemon/ops.go | 7 | ||||
-rw-r--r-- | internal/test/daemon/swarm.go | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/internal/test/daemon/daemon.go b/internal/test/daemon/daemon.go index 7471d1093b..fb970e095c 100644 --- a/internal/test/daemon/daemon.go +++ b/internal/test/daemon/daemon.go @@ -76,6 +76,7 @@ type Daemon struct { SwarmPort int // FIXME(vdemeester) should probably not be exported DefaultAddrPool []string SubnetSize uint32 + DataPathPort uint32 // cached information CachedInfo types.Info } diff --git a/internal/test/daemon/ops.go b/internal/test/daemon/ops.go index 4154a77977..ff8cd88946 100644 --- a/internal/test/daemon/ops.go +++ b/internal/test/daemon/ops.go @@ -48,6 +48,13 @@ func WithSwarmDefaultAddrPoolSubnetSize(subnetSize uint32) func(*Daemon) { } } +// WithSwarmDataPathPort sets the swarm datapath port to use for swarm mode +func WithSwarmDataPathPort(datapathPort uint32) func(*Daemon) { + return func(d *Daemon) { + d.DataPathPort = datapathPort + } +} + // WithEnvironment sets options from internal/test/environment.Execution struct func WithEnvironment(e environment.Execution) func(*Daemon) { return func(d *Daemon) { diff --git a/internal/test/daemon/swarm.go b/internal/test/daemon/swarm.go index 92ef856640..e500fe0fdc 100644 --- a/internal/test/daemon/swarm.go +++ b/internal/test/daemon/swarm.go @@ -85,6 +85,9 @@ func (d *Daemon) SwarmInit(t assert.TestingT, req swarm.InitRequest) { req.DefaultAddrPool = d.DefaultAddrPool req.SubnetSize = d.SubnetSize } + if d.DataPathPort > 0 { + req.DataPathPort = d.DataPathPort + } cli := d.NewClientT(t) defer cli.Close() _, err := cli.SwarmInit(context.Background(), req) |