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

Fix advanced options for backward compatibility #1963

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 21, 2019

For backward compatibility: if no custom options are provided for the network,
and only a single network is specified, omit the endpoint-configuration
on the client (the daemon will still create it when creating the container)

This fixes an issue on older versions of legacy Swarm, which did not support
NetworkingConfig.EndpointConfig.

This was introduced in 5bc0963 (#1767)

fixes #1854
relates to docker-archive/classicswarm#2941

@thaJeztah
Copy link
Member Author

ping @wsong @andrewhsu @silvin-lubecki PTAL

Copy link
Contributor

@wsong wsong left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@codecov-io
Copy link

Codecov Report

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

@@            Coverage Diff             @@
##           master    #1963      +/-   ##
==========================================
+ Coverage   56.72%   56.73%   +<.01%     
==========================================
  Files         310      310              
  Lines       21800    21803       +3     
==========================================
+ Hits        12367    12370       +3     
  Misses       8518     8518              
  Partials      915      915

@thaJeztah
Copy link
Member Author

ping @tiborvass @andrewhsu @silvin-lubecki PTAL

// and only a single network is specified, omit the endpoint-configuration
// on the client (the daemon will still create it when creating the container)
if i == 0 && len(copts.netMode.Value()) == 1 {
if ep == nil || reflect.DeepEqual(ep, &networktypes.EndpointSettings{}) {
Copy link
Collaborator

@tiborvass tiborvass Jun 24, 2019

Choose a reason for hiding this comment

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

Suggested change
if ep == nil || reflect.DeepEqual(ep, &networktypes.EndpointSettings{}) {
if ep == nil || reflect.DeepEqual(*ep, networktypes.EndpointSettings{}) {

For backward compatibility: if no custom options are provided for the network,
and only a single network is specified, omit the endpoint-configuration
on the client (the daemon will still create it when creating the container)

This fixes an issue on older versions of legacy Swarm, which did not support
`NetworkingConfig.EndpointConfig`.

This was introduced in 5bc0963 (docker#1767)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the fix_advanced_options_for_backward_compat branch from 393c4f3 to 4d7e6bf Compare June 24, 2019 21:17
@thaJeztah
Copy link
Member Author

@tiborvass thanks! updated; ptal

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 👍

@silvin-lubecki silvin-lubecki merged commit 7c4eddc into docker:master Jun 25, 2019
@GordonTheTurtle GordonTheTurtle added this to the 19.09.0 milestone Jun 25, 2019
@thaJeztah thaJeztah deleted the fix_advanced_options_for_backward_compat branch June 25, 2019 17:16
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.

19.03 CLI always sets NetworkingConfig.EndpointsConfig on any container with a network
6 participants