Allow --detach and --quiet flags when using --rollback

Commit 78c204ef79 added
(f9bd8ec8b268581f93095c5a80679f0a8ff498bf in the moby repo)
a validation to prevent `--rollback` from being used
in combination with other flags that update the
service spec.

This validation was not taking into account that
some flags only affect the CLI behavior, and
are okay to be used when rolling back.

This patch updates the validation, and adds
`--quiet` and `--detach` to the list of allowed
flags.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2017-06-01 16:25:17 +02:00
parent efaadcf465
commit f10f29df8d
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ func runUpdate(dockerCli *command.DockerCli, flags *pflag.FlagSet, options *serv
// Rollback can't be combined with other flags. // Rollback can't be combined with other flags.
otherFlagsPassed := false otherFlagsPassed := false
flags.VisitAll(func(f *pflag.Flag) { flags.VisitAll(func(f *pflag.Flag) {
if f.Name == "rollback" { if f.Name == "rollback" || f.Name == "detach" || f.Name == "quiet" {
return return
} }
if flags.Changed(f.Name) { if flags.Changed(f.Name) {