mirror of https://github.com/docker/cli.git
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 <github@gone.nl>
This commit is contained in:
parent
3b4084cb50
commit
6c80d2bb83
|
@ -27,6 +27,8 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
}
|
}
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
flags.StringVar(&opts.mode, flagMode, "replicated", "Service mode (replicated or global)")
|
flags.StringVar(&opts.mode, flagMode, "replicated", "Service mode (replicated or global)")
|
||||||
|
flags.StringVar(&opts.name, flagName, "", "Service name")
|
||||||
|
|
||||||
addServiceFlags(cmd, opts)
|
addServiceFlags(cmd, opts)
|
||||||
|
|
||||||
flags.VarP(&opts.labels, flagLabel, "l", "Service labels")
|
flags.VarP(&opts.labels, flagLabel, "l", "Service labels")
|
||||||
|
|
|
@ -490,7 +490,6 @@ func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) {
|
||||||
// Any flags that are not common are added separately in the individual command
|
// Any flags that are not common are added separately in the individual command
|
||||||
func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
|
func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
flags.StringVar(&opts.name, flagName, "", "Service name")
|
|
||||||
|
|
||||||
flags.StringVarP(&opts.workdir, flagWorkdir, "w", "", "Working directory inside the container")
|
flags.StringVarP(&opts.workdir, flagWorkdir, "w", "", "Working directory inside the container")
|
||||||
flags.StringVarP(&opts.user, flagUser, "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
|
flags.StringVarP(&opts.user, flagUser, "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
|
||||||
|
|
|
@ -172,7 +172,6 @@ func updateService(flags *pflag.FlagSet, spec *swarm.ServiceSpec) error {
|
||||||
return task.Resources
|
return task.Resources
|
||||||
}
|
}
|
||||||
|
|
||||||
updateString(flagName, &spec.Name)
|
|
||||||
updateLabels(flags, &spec.Labels)
|
updateLabels(flags, &spec.Labels)
|
||||||
updateContainerLabels(flags, &cspec.Labels)
|
updateContainerLabels(flags, &cspec.Labels)
|
||||||
updateString("image", &cspec.Image)
|
updateString("image", &cspec.Image)
|
||||||
|
|
Loading…
Reference in New Issue