-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service create --group param #27800
Service create --group param #27800
Conversation
@@ -36,6 +36,7 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command { | |||
flags.StringSliceVar(&opts.constraints, flagConstraint, []string{}, "Placement constraints") | |||
flags.StringSliceVar(&opts.networks, flagNetwork, []string{}, "Network attachments") | |||
flags.VarP(&opts.endpoint.ports, flagPublish, "p", "Publish a port as a node port") | |||
flags.StringSliceVar(&opts.groups, flagGroup, []string{}, "Set additional user groups to the container") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Set supplementary user groups", per https://en.wikipedia.org/wiki/Group_identifier#Supplementary_groups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make it clear that this is a repeated flag:
Set one or more supplementary user groups for the container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for update the doc doesn't specify "supplementary", it just says "user groups", should I update that?
LGTM after minor nit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lilybguo can you also
- update the completion scripts (which were updated for this in Add bash completion for
service {create,update} --group-{add,rm}
#26301, and Add zsh completion for 'service {create,update} --group-{add,rm}' #26478) - squash your commits
Let us know if you need help on the completion scripts, otherwise it can be handled in a follow up
@@ -25,7 +25,7 @@ Options: | |||
--container-label value Service container labels (default []) | |||
--endpoint-mode string Endpoint mode (vip or dnsrr) | |||
-e, --env value Set environment variables (default []) | |||
--group-add value Add additional user groups to the container (default []) | |||
--group value Set additional user groups to the container (default []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the documentation doesn't match the actual flag description?
@@ -41,7 +41,7 @@ func newUpdateCommand(dockerCli *command.DockerCli) *cobra.Command { | |||
addServiceFlags(cmd, opts) | |||
|
|||
flags.Var(newListOptsVar(), flagEnvRemove, "Remove an environment variable") | |||
flags.Var(newListOptsVar(), flagGroupRemove, "Remove previously added user groups from the container") | |||
flags.Var(newListOptsVar(), flagGroupRemove, "Remove previously added supplementary user groups from the container") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the documentation to match the new flag descriptions?
49f9391
to
ea8dbff
Compare
@lilybguo can you rebase this and then I'll review today. Thanks. |
--group-add was used for specifying groups for both service create and service update. For create it was confusing since we don't have an existing set of groups. Instead I added --group to create, and moved --group-add to service update only, like --group-rm This deals with issue 27646 Signed-off-by: Lily Guo <lily.guo@docker.com> Update flag documentation Specify that --group, --group-add and --groupd-rm refers to supplementary user groups Signed-off-by: Lily Guo <lily.guo@docker.com> Fix docs for groups and update completion scripts Signed-off-by: Lily Guo <lily.guo@docker.com>
ea8dbff
to
2f58494
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for contributing @lilybguo
Pull request moby#27745 added support for the client to talk to older versions of the daemon. Various flags were added to docker 1.13 that are not compatible with older daemons. This PR adds annotations to those flags, so that they are automatically hidden if the daemon is older than docker 1.13 (API 1.25). Not all new flags affect the API (some are client-side only). The following PR's added new flags to docker 1.13 that affect the API; - moby#23430 added `--cpu-rt-period`and `--cpu-rt-runtime` - moby#27800 / moby#25317 added `--group` / `--group-add` / `--group-rm` - moby#27702 added `--network` to `docker build` - moby#25962 added `--attachable` to `docker network create` - moby#27998 added `--compose-file` to `docker stack deploy` - moby#22566 added `--stop-timeout` to `docker run` and `docker create` - moby#26061 added `--init` to `docker run` and `docker create` - moby#26941 added `--init-path` to `docker run` and `docker create` - moby#27958 added `--cpus` on `docker run` / `docker create` - moby#27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create` - moby#27596 added `--force` to `docker service update` - moby#27857 added `--hostname` to `docker service create` - moby#28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update` - moby#28076 added `--tty` on `docker service create` / `docker service update` - moby#26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update` - moby#27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Pull request moby/moby#27745 added support for the client to talk to older versions of the daemon. Various flags were added to docker 1.13 that are not compatible with older daemons. This PR adds annotations to those flags, so that they are automatically hidden if the daemon is older than docker 1.13 (API 1.25). Not all new flags affect the API (some are client-side only). The following PR's added new flags to docker 1.13 that affect the API; - moby/moby#23430 added `--cpu-rt-period`and `--cpu-rt-runtime` - moby/moby#27800 / moby/moby#25317 added `--group` / `--group-add` / `--group-rm` - moby/moby#27702 added `--network` to `docker build` - moby/moby#25962 added `--attachable` to `docker network create` - moby/moby#27998 added `--compose-file` to `docker stack deploy` - moby/moby#22566 added `--stop-timeout` to `docker run` and `docker create` - moby/moby#26061 added `--init` to `docker run` and `docker create` - moby/moby#26941 added `--init-path` to `docker run` and `docker create` - moby/moby#27958 added `--cpus` on `docker run` / `docker create` - moby/moby#27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create` - moby/moby#27596 added `--force` to `docker service update` - moby/moby#27857 added `--hostname` to `docker service create` - moby/moby#28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update` - moby/moby#28076 added `--tty` on `docker service create` / `docker service update` - moby/moby#26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update` - moby/moby#27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update` Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 5d2722f83db9e301c6dcbe1c562c2051a52905db Component: cli
--group-add was used for specifying groups for both service create
and service update. For create it was confusing since we don't have
an existing set of groups. Instead I added --group to create, and
moved --group-add to service update only, like --group-rm
This deals with issue #27646
Signed-off-by: Lily Guo lily.guo@docker.com