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

Clarify that NetworkAttachment target is an ID #1602

Merged
merged 1 commit into from
Oct 12, 2016

Conversation

aaronlehmann
Copy link
Collaborator

PR #1600 added a FindNetwork function to the store package to resolve a
NetworkAttachment's target by ID, name, or name prefix. I think this is
based on a misleading comment in the NetworkAttachment definition saying
that the target can be a name or an ID. In fact, it's always an ID, and
existing code passes it directly to GetNetwork.

Clarify the comment and remove FindNetwork.

cc @aboch @mrjana @aluzzardi

PR moby#1600 added a FindNetwork function to the store package to resolve a
NetworkAttachment's target by ID, name, or name prefix. I think this is
based on a misleading comment in the NetworkAttachment definition saying
that the target can be a name or an ID. In fact, it's always an ID, and
existing code passes it directly to GetNetwork.

Clarify the comment and remove FindNetwork.

Signed-off-by: Aaron Lehmann <[email protected]>
@codecov-io
Copy link

Current coverage is 54.13% (diff: 100%)

Merging #1602 into master will increase coverage by 0.39%

@@             master      #1602   diff @@
==========================================
  Files            84         84          
  Lines         13952      13944     -8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7497       7548    +51   
+ Misses         5443       5401    -42   
+ Partials       1012        995    -17   

Sunburst

Powered by Codecov. Last update 6cb6e54...00963e6

@aboch
Copy link

aboch commented Oct 6, 2016

@aaronlehmann When testing the fix #1600 I recalled that if I specify --network <ingress nw ID> or the prefix (don't recalll now) at the create service UI, the backend would not find the corresponding ingress network in store. That's why I added that function.

Let me test again. If it is not needed I am happy this gets removed.

@aboch
Copy link

aboch commented Oct 6, 2016

@aaronlehmann
Confirmed GetNetwork() is all what is needed on 1.12.x and current master.
Thanks for the clarification.

looks good to me

@aluzzardi
Copy link
Member

LGTM

@aluzzardi aluzzardi merged commit 8b52fc6 into moby:master Oct 12, 2016
// Target specifies the target network for attachment. This value may be a
// network name or identifier. Only identifiers are supported at this time.
// Target specifies the target network for attachment. This value must be a
// network ID.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is correct. The reason why this was called Target is for a possible move over in the future to use names or both name or ID. So I believe the previous comment should still be retained. But I am fine with removing FindNetwork since we don't expect a name with the current implementation.

@aaronlehmann aaronlehmann deleted the attachment-target-is-id branch October 12, 2016 00:37
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.

6 participants