Merge pull request #27596 from aaronlehmann/rolling-restart

Add force option to service update
This commit is contained in:
Vincent Demeester 2016-10-22 13:37:12 +02:00 committed by GitHub
commit 6ec439e875
1 changed files with 10 additions and 0 deletions

View File

@ -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
} }