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

Skip inspect of built-in networks on stack deploy #362

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

alexmavr
Copy link
Contributor

- What I did

The current flow of docker stack deploy -c performs a network inspect operation for every external network. However, built-in networks are always known to exist so these inspect calls are redundant. This PR removes them.

- How I did it
For every external network in a compose file, omit the network inspect operation if it's a built-in network ("none", "default", "container", "bridge" or "host")

- How to verify it

  • Use the provided unit test

or

  • Build a docker API server that returns a 404 for the "host" and "bridge" networks (such as https://github.com/docker/swarm) and run the following compose file:
version: '3.2'
services:
  api:
    image: nginx
    networks:
      host : null
networks:
  host:
    external: true

Then, verify the deployed task is attached to the "host" network on the target node.

- Description for the changelog

  • Stack deploy for compose files no longer inspects built-in networks

- A picture of a cute animal (not mandatory but encouraged)

important-stuff

Signed-off-by: Alex Mavrogiannis alex.mavrogiannis@docker.com

@alexmavr
Copy link
Contributor Author

cc @mavenugo

@mavenugo
Copy link
Contributor

LGTM

Not sure why the CI is failing though...

Signed-off-by: Alex Mavrogiannis <alex.mavrogiannis@docker.com>
@alexmavr alexmavr force-pushed the stack-host-bridge-nets branch from 1851a63 to 7f53c99 Compare July 20, 2017 02:40
@codecov-io
Copy link

codecov-io commented Jul 20, 2017

Codecov Report

Merging #362 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #362      +/-   ##
==========================================
+ Coverage   45.47%   45.49%   +0.01%     
==========================================
  Files         193      193              
  Lines       16061    16065       +4     
==========================================
+ Hits         7304     7308       +4     
  Misses       8379     8379              
  Partials      378      378

@alexmavr
Copy link
Contributor Author

Amended my commit with no code diff - looks like CI just needed a little nudge

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 79b6d37 into docker:master Jul 20, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.07.0 milestone Jul 20, 2017
@@ -56,7 +58,8 @@ func TestValidateExternalNetworks(t *testing.T) {
expectedMsg: "Unexpected",
},
{
network: "host",
noInspect: true,
network: "host",
Copy link
Contributor

@dnephin dnephin Jul 20, 2017

Choose a reason for hiding this comment

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

I'm not really a fan of this storing state in the testcase struct.

I think the same thing can be accomplished by setting inspectError, and asserting there was no error, right?

Fixed in #365

@thaJeztah
Copy link
Member

This didn't make the cut for 17.07, opened docker-archive/docker-ce#177 to back port it

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.

7 participants