From 6c80d2bb83ed05d98b65591b5eb64c46934a86f4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 28 Sep 2016 12:34:31 +0200 Subject: [PATCH] Remove --name flag from service update The --name flag was inadvertently added to docker service update, but is not supported, as it has various side-effects (e.g., existing tasks are not renamed). This removes the flag from the service update command. Signed-off-by: Sebastiaan van Stijn --- command/service/create.go | 2 ++ command/service/opts.go | 1 - command/service/update.go | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command/service/create.go b/command/service/create.go index bc5576b1ad..bb7af41f94 100644 --- a/command/service/create.go +++ b/command/service/create.go @@ -27,6 +27,8 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command { } flags := cmd.Flags() flags.StringVar(&opts.mode, flagMode, "replicated", "Service mode (replicated or global)") + flags.StringVar(&opts.name, flagName, "", "Service name") + addServiceFlags(cmd, opts) flags.VarP(&opts.labels, flagLabel, "l", "Service labels") diff --git a/command/service/opts.go b/command/service/opts.go index cf25b78273..d0d383a7a1 100644 --- a/command/service/opts.go +++ b/command/service/opts.go @@ -490,7 +490,6 @@ func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) { // Any flags that are not common are added separately in the individual command func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) { flags := cmd.Flags() - flags.StringVar(&opts.name, flagName, "", "Service name") flags.StringVarP(&opts.workdir, flagWorkdir, "w", "", "Working directory inside the container") flags.StringVarP(&opts.user, flagUser, "u", "", "Username or UID (format: [:])") diff --git a/command/service/update.go b/command/service/update.go index 6034979a66..e1f7cad66b 100644 --- a/command/service/update.go +++ b/command/service/update.go @@ -172,7 +172,6 @@ func updateService(flags *pflag.FlagSet, spec *swarm.ServiceSpec) error { return task.Resources } - updateString(flagName, &spec.Name) updateLabels(flags, &spec.Labels) updateContainerLabels(flags, &cspec.Labels) updateString("image", &cspec.Image)