mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #26988 from thaJeztah/remove-service-update-name-flag
Remove service update name flag
This commit is contained in:
commit
3a3a87bff8
8 changed files with 6 additions and 7 deletions
|
@ -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")
|
||||||
|
|
|
@ -511,7 +511,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)
|
||||||
|
|
|
@ -2576,7 +2576,6 @@ _docker_service_update() {
|
||||||
--log-driver
|
--log-driver
|
||||||
--log-opt
|
--log-opt
|
||||||
--mount
|
--mount
|
||||||
--name
|
|
||||||
--network
|
--network
|
||||||
--publish -p
|
--publish -p
|
||||||
--replicas
|
--replicas
|
||||||
|
@ -2608,6 +2607,7 @@ _docker_service_update() {
|
||||||
options_with_args="$options_with_args
|
options_with_args="$options_with_args
|
||||||
--container-label
|
--container-label
|
||||||
--mode
|
--mode
|
||||||
|
--name
|
||||||
"
|
"
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
|
|
|
@ -1095,7 +1095,6 @@ __docker_service_subcommand() {
|
||||||
"($help)--log-driver=[Logging driver for service]:logging driver:__docker_log_drivers"
|
"($help)--log-driver=[Logging driver for service]:logging driver:__docker_log_drivers"
|
||||||
"($help)*--log-opt=[Logging driver options]:log driver options:__docker_log_options"
|
"($help)*--log-opt=[Logging driver options]:log driver options:__docker_log_options"
|
||||||
"($help)*--mount=[Attach a mount to the service]:mount: "
|
"($help)*--mount=[Attach a mount to the service]:mount: "
|
||||||
"($help)--name=[Service name]:name: "
|
|
||||||
"($help)*--network=[Network attachments]:network: "
|
"($help)*--network=[Network attachments]:network: "
|
||||||
"($help)*"{-p=,--publish=}"[Publish a port as a node port]:port: "
|
"($help)*"{-p=,--publish=}"[Publish a port as a node port]:port: "
|
||||||
"($help)--replicas=[Number of tasks]:replicas: "
|
"($help)--replicas=[Number of tasks]:replicas: "
|
||||||
|
@ -1123,6 +1122,7 @@ __docker_service_subcommand() {
|
||||||
$opts_create_update \
|
$opts_create_update \
|
||||||
"($help)*--container-label=[Container labels]:label: " \
|
"($help)*--container-label=[Container labels]:label: " \
|
||||||
"($help)--mode=[Service Mode]:mode:(global replicated)" \
|
"($help)--mode=[Service Mode]:mode:(global replicated)" \
|
||||||
|
"($help)--name=[Service name]:name: " \
|
||||||
"($help -): :__docker_images" \
|
"($help -): :__docker_images" \
|
||||||
"($help -):command: _command_names -e" \
|
"($help -):command: _command_names -e" \
|
||||||
"($help -)*::arguments: _normal" && ret=0
|
"($help -)*::arguments: _normal" && ret=0
|
||||||
|
|
|
@ -4846,7 +4846,7 @@ image](#create-an-image) section for more details.
|
||||||
|
|
||||||
**JSON Parameters**:
|
**JSON Parameters**:
|
||||||
|
|
||||||
- **Name** – User-defined name for the service.
|
- **Name** – User-defined name for the service. Note that renaming services is not supported.
|
||||||
- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
|
- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
|
||||||
- **TaskTemplate** – Specification of the tasks to start as part of the new service.
|
- **TaskTemplate** – Specification of the tasks to start as part of the new service.
|
||||||
- **ContainerSpec** - Container settings for containers started as part of this task.
|
- **ContainerSpec** - Container settings for containers started as part of this task.
|
||||||
|
|
|
@ -5375,7 +5375,7 @@ image](#create-an-image) section for more details.
|
||||||
|
|
||||||
**JSON Parameters**:
|
**JSON Parameters**:
|
||||||
|
|
||||||
- **Name** – User-defined name for the service.
|
- **Name** – User-defined name for the service. Note that renaming services is not supported.
|
||||||
- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
|
- **Labels** – A map of labels to associate with the service (e.g., `{"key":"value", "key2":"value2"}`).
|
||||||
- **TaskTemplate** – Specification of the tasks to start as part of the new service.
|
- **TaskTemplate** – Specification of the tasks to start as part of the new service.
|
||||||
- **ContainerSpec** - Container settings for containers started as part of this task.
|
- **ContainerSpec** - Container settings for containers started as part of this task.
|
||||||
|
|
|
@ -42,7 +42,6 @@ Options:
|
||||||
--log-opt value Logging driver options (default [])
|
--log-opt value Logging driver options (default [])
|
||||||
--mount-add value Add or update a mount on a service
|
--mount-add value Add or update a mount on a service
|
||||||
--mount-rm value Remove a mount by its target path (default [])
|
--mount-rm value Remove a mount by its target path (default [])
|
||||||
--name string Service name
|
|
||||||
--publish-add value Add or update a published port (default [])
|
--publish-add value Add or update a published port (default [])
|
||||||
--publish-rm value Remove a published port by its target port (default [])
|
--publish-rm value Remove a published port by its target port (default [])
|
||||||
--replicas value Number of tasks (default none)
|
--replicas value Number of tasks (default none)
|
||||||
|
|
Loading…
Add table
Reference in a new issue