Skip to content
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

Add API-version anotation for --data-path-addr #1240

Merged
merged 1 commit into from
Jul 30, 2018

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 30, 2018

This flag was added in Docker 17.06, API version 1.31 through moby/moby@8dc8cd4 8(moby/moby#32717), but didn't add API-version annotations.

This patch adds the missing annotations to hide this flag if the CLI is connected to an older version of the daemon that doesn't support that API.

Before this patch:

DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
      --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
      --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

With this patch applied:

DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
# (no result)

DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
      --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

- How to verify it

See above

- Description for the changelog

+ Hide `--data-path-addr` flags when connected to a daemon that doesn't support this option [docker/cli#1240](https://github.com/docker/cli/pull/1240)

This flag was added in Docker 17.06, API version 1.31 through
moby@8dc8cd4719f165c01c98e7d3ce1d6cea6a8f60b8, but didn't add
API-version annotations.

This patch adds the missing annotations to hide this flag if
the CLI is connected to an older version of the daemon that
doesn't support that API.

Before this patch:

    DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

    DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

With this patch applied:

    DOCKER_API_VERSION=1.30 docker swarm init --help | grep data-path-addr
    # (no result)

    DOCKER_API_VERSION=1.31 docker swarm init --help | grep data-path-addr
          --data-path-addr string           Address or interface to use for data path traffic (format: <ip|interface>)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

ping @fcrisciani @selansen

@codecov-io
Copy link

codecov-io commented Jul 30, 2018

Codecov Report

Merging #1240 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1240      +/-   ##
==========================================
+ Coverage   54.23%   54.23%   +<.01%     
==========================================
  Files         268      268              
  Lines       17805    17807       +2     
==========================================
+ Hits         9656     9658       +2     
  Misses       7542     7542              
  Partials      607      607

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@fcrisciani fcrisciani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester merged commit 19653e7 into docker:master Jul 30, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.09.0 milestone Jul 30, 2018
@thaJeztah thaJeztah deleted the datapath_addr_api_annotation branch July 30, 2018 15:50
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.

None yet

6 participants