Skip to content

Conversation

@vieux
Copy link
Contributor

@vieux vieux commented Nov 3, 2016

Let's assume local daemon is stable and remote daemon is experimental:

# help on local daemon shouldn't display experimental commands
$ docker --help
[...]
Management Commands:
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  service     Manage services
[...]
# OK

# help on remote daemon should display experimental commands
$ DOCKER_HOST=<remote_addr> docker --help
[...]
Management Commands:
  checkpoint  Manage checkpoints
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  service     Manage services
  stack       Manage Docker stacks
[...]
# OK

# help on remote daemon should display experimental commands
$ docker -H <remote_addr> --help
[...]
Management Commands:
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  service     Manage services
[...]
# KO

It doesn't work with -H because we detect if the daemon is experimental before parsing the flags, and I don't see any way around it.


Here what I propose (inspired by @dnephin comments) :

  • Remove the ping
  • Always display experimental commands and flags.
  • Prepended with [experimental] to the usage unless DOCKER_EXPERIMENTAL=1

Example:

$ docker --help
[...]
Management Commands:
  checkpoint  [experimental] Manage checkpoints
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      [experimental] Manage plugins
  service     Manage services
  stack       [experimental] Manage Docker stacks
[...]

$ docker -H <remote_addr> --help
[...]
Management Commands:
  checkpoint  [experimental] Manage checkpoints
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      [experimental] Manage plugins
  service     Manage services
  stack       [experimental] Manage Docker stacks
[...]

$ DOCKER_EXPERIMENTAL=1 docker -H <remote_addr> --help
[...]
Management Commands:
  checkpoint  Manage checkpoints
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  service     Manage services
  stack       Manage Docker stacks
[...]

And it works the same way with flags.

ping @mlaventure @dnephin @icecrime

Signed-off-by: Victor Vieux <vieux@docker.com>
@vieux
Copy link
Contributor Author

vieux commented Nov 3, 2016

see #28010 for another idea around this problem

@icecrime
Copy link
Contributor

icecrime commented Nov 3, 2016

Can we create another command group rather than prepending with [experimental]?

@dnephin
Copy link
Member

dnephin commented Nov 3, 2016

We could add anExperimental field to cobra (since we run my fork that is easy todo), and with that change we could then add a group for experimental commands, yes.

@vieux
Copy link
Contributor Author

vieux commented Nov 3, 2016

after talking with few maintainers, we are going to close this one in favor on #28010 it's more inlined with the current design.

@vieux vieux closed this Nov 3, 2016
@thaJeztah thaJeztah removed this from the 1.13.0 milestone Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants