Skip to content

Conversation

rycus86
Copy link
Contributor

@rycus86 rycus86 commented Nov 16, 2017

This change would fix #1775 plus adds some missing documentation and input arguments around networks.

Per the comment on #1775 (comment) this change enables adding a greedy=True parameter on the model's and the API client's network list function that will inspect each network on the initial list.

Signed-off-by: Viktor Adam <rycus86@gmail.com>
Signed-off-by: Viktor Adam <rycus86@gmail.com>
@rycus86 rycus86 force-pushed the greedy_network_list branch from 15be737 to 2878900 Compare November 19, 2017 21:03
Copy link
Contributor

@shin- shin- left a comment

Choose a reason for hiding this comment

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

Thanks, that's definitely a useful feature to have.

My only issue with it as it stands is that I don't think the greedy flag belongs in the APIClient. Advanced, usability-minded functionality belongs in DockerClient instead. APIClient should be as lean and resource-efficient as possible.

@shin- shin- added this to the 2.7.0 milestone Nov 21, 2017
@thaJeztah
Copy link
Member

Note that using API 1.25 will still return the container details; see https://github.com/moby/moby/pulls/30673

The list of containers was removed from the network list because it can be a heavy operation in larger setups (many containers, many networks), (inspecting a single network still returns attached containers)

Signed-off-by: Viktor Adam <rycus86@gmail.com>
@rycus86 rycus86 force-pushed the greedy_network_list branch from a17dfdb to 36ed843 Compare November 21, 2017 21:59
@rycus86
Copy link
Contributor Author

rycus86 commented Nov 21, 2017

Thanks for having a look at this!

I've moved the new flag to the model only and left the API client unchanged. I only added it there because of #1775 (comment) but it makes sense to leave the API client as it was.

@thaJeztah thanks for letting me know!
It looks like the behavior has changed in API 1.28, added a check for it and won't inspect the services if the client is on a lower version.

@rycus86
Copy link
Contributor Author

rycus86 commented Nov 29, 2017

Hi @shin- ,

Sorry I haven't done reviews on GitHub yet, is there a link/button somewhere to update that I've made the changes that were requested?

Thank you!

@shin-
Copy link
Contributor

shin- commented Nov 29, 2017

@rycus86 I saw your changes, just didn't have time to take a closer look yet with Thanksgiving break and other priorities. Thank you for your patience. 👍

@rycus86
Copy link
Contributor Author

rycus86 commented Nov 29, 2017

Right, sorry, forgot about Thanksgiving! :)
Enjoy your break!

Copy link
Contributor

@shin- shin- left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@shin- shin- merged commit aad0c76 into docker:master Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client.networks.containers() is always empty

3 participants