Let swarmkit handle cluster defaults in swarm init if not specified

This fix tries to address the issue raised in 24958 where previously
`docker swarm init` will automatically fill in all the default value
(instead of letting swarmkit to handle the default).

This fix update the `swarm init` so that initial value are passed only
when a flag change has been detected.

This fix fixes 24958.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2016-08-25 21:08:53 -07:00
parent 53c51901d7
commit e0f229d2ca
4 changed files with 22 additions and 8 deletions

View File

@ -59,7 +59,7 @@ func runInit(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts initOption
ListenAddr: opts.listenAddr.String(),
AdvertiseAddr: opts.advertiseAddr,
ForceNewCluster: opts.forceNewCluster,
Spec: opts.swarmOptions.ToSpec(),
Spec: opts.swarmOptions.ToSpec(flags),
}
nodeID, err := client.SwarmInit(ctx, req)