mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
f7ad95cab9
This feature allows user to specify list of subnets for global default address pool. User can configure subnet list using 'swarm init' command. Daemon passes the information to swarmkit. We validate the information in swarmkit, then store it in cluster object. when IPAM init is called, we pass subnet list to IPAM driver. Signed-off-by: selansen <elango.siva@docker.com>
58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package daemon
|
|
|
|
import "github.com/docker/docker/internal/test/environment"
|
|
|
|
// WithExperimental sets the daemon in experimental mode
|
|
func WithExperimental(d *Daemon) {
|
|
d.experimental = true
|
|
d.init = true
|
|
}
|
|
|
|
// WithInit sets the daemon init
|
|
func WithInit(d *Daemon) {
|
|
d.init = true
|
|
}
|
|
|
|
// WithDockerdBinary sets the dockerd binary to the specified one
|
|
func WithDockerdBinary(dockerdBinary string) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
d.dockerdBinary = dockerdBinary
|
|
}
|
|
}
|
|
|
|
// WithSwarmPort sets the swarm port to use for swarm mode
|
|
func WithSwarmPort(port int) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
d.SwarmPort = port
|
|
}
|
|
}
|
|
|
|
// WithSwarmListenAddr sets the swarm listen addr to use for swarm mode
|
|
func WithSwarmListenAddr(listenAddr string) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
d.swarmListenAddr = listenAddr
|
|
}
|
|
}
|
|
|
|
// WithSwarmDefaultAddrPool sets the swarm default address pool to use for swarm mode
|
|
func WithSwarmDefaultAddrPool(defaultAddrPool []string) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
d.DefaultAddrPool = defaultAddrPool
|
|
}
|
|
}
|
|
|
|
// WithSwarmDefaultAddrPoolSubnetSize sets the subnet length mask of swarm default address pool to use for swarm mode
|
|
func WithSwarmDefaultAddrPoolSubnetSize(subnetSize uint32) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
d.SubnetSize = subnetSize
|
|
}
|
|
}
|
|
|
|
// WithEnvironment sets options from internal/test/environment.Execution struct
|
|
func WithEnvironment(e environment.Execution) func(*Daemon) {
|
|
return func(d *Daemon) {
|
|
if e.DaemonInfo.ExperimentalBuild {
|
|
d.experimental = true
|
|
}
|
|
}
|
|
}
|