mirror of https://github.com/docker/cli.git
Merge pull request #27596 from aaronlehmann/rolling-restart
Add force option to service update
This commit is contained in:
commit
6ec439e875
|
@ -37,6 +37,7 @@ func newUpdateCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
flags.String("image", "", "Service image tag")
|
flags.String("image", "", "Service image tag")
|
||||||
flags.String("args", "", "Service command args")
|
flags.String("args", "", "Service command args")
|
||||||
flags.Bool("rollback", false, "Rollback to previous specification")
|
flags.Bool("rollback", false, "Rollback to previous specification")
|
||||||
|
flags.Bool("force", false, "Force update even if no changes require it")
|
||||||
addServiceFlags(cmd, opts)
|
addServiceFlags(cmd, opts)
|
||||||
|
|
||||||
flags.Var(newListOptsVar(), flagEnvRemove, "Remove an environment variable")
|
flags.Var(newListOptsVar(), flagEnvRemove, "Remove an environment variable")
|
||||||
|
@ -257,6 +258,15 @@ func updateService(flags *pflag.FlagSet, spec *swarm.ServiceSpec) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
force, err := flags.GetBool("force")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if force {
|
||||||
|
spec.TaskTemplate.ForceUpdate++
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue