docker / docker/cli

Kubernetes specific option is always shown in help message of `docker version`

Open
#1,265 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/kubernetes
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

The --kubeconfig option of docker version is annotated as kubernetes.
Therefore it should be hidden in the help message unless the orchestrator is kubernetes.
However, it is displayed regardless of the configured orchestrator:

$ DOCKER_STACK_ORCHESTRATOR=swarm docker version --help | grep kubeconfig
      --kubeconfig string   Kubernetes config file
$ DOCKER_STACK_ORCHESTRATOR=kubernetes docker version --help | grep kubeconfig
      --kubeconfig string   Kubernetes config file
$ docker --version
Docker version 18.09.0-dev, build 21cce52b

Related: #1251
Moved here from https://github.com/docker/cli/pull/1251#issuecomment-409483312

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Go definition of the docker version --kubeconfig option and the help-generation logic that handles its kubernetes annotation. Reproduce the issue with the two DOCKER_STACK_ORCHESTRATOR values and verify that the option is hidden for Swarm and shown for Kubernetes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.