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

Network allocator does not respect the IPAM contract for nw gw #2078

Merged
merged 1 commit into from
Mar 30, 2017
Merged

Conversation

aboch
Copy link

@aboch aboch commented Mar 30, 2017

  • Needs to label the request for network gateway address
    appropriately and needs to honor the case where the
    driver has autonomously selected the gateway address.

This was reported in moby/libnetwork/issues/1702

- Needs to label the request for network gateway address
  appropriately and needs to honor the case where the
  driver has autonomously selected the gateway address.

Signed-off-by: Alessandro Boch <[email protected]>
@codecov
Copy link

codecov bot commented Mar 30, 2017

Codecov Report

Merging #2078 into master will decrease coverage by 0.34%.
The diff coverage is 71.42%.

@@            Coverage Diff            @@
##           master   #2078      +/-   ##
=========================================
- Coverage   54.64%   54.3%   -0.35%     
=========================================
  Files         114     111       -3     
  Lines       19679   19360     -319     
=========================================
- Hits        10754   10513     -241     
+ Misses       7646    7580      -66     
+ Partials     1279    1267      -12

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a733b6f...fc59d0d. Read the comment docs.

gwIP.IP = ip
}
if ic.Gateway != "" || gwIP == nil {
gwIP, _, err = ipam.RequestAddress(poolID, net.ParseIP(ic.Gateway), map[string]string{ipamapi.RequestAddressType: netlabel.Gateway})
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're using ic.Gateway here when according to the logic in the if statement above, it could be empty. Is that correct?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. If user specified a network gateway, (parsed(ic.Gateway)= some ip) we tell IPAM driver to reserve it. If the user did not pass one (parsed(ic.Gateway)=nil), like to tell IPAM driver to chose one by himself.

@aaronlehmann
Copy link
Collaborator

LGTM

1 similar comment
@dongluochen
Copy link
Contributor

LGTM

@dongluochen dongluochen merged commit 63b52fe into moby:master Mar 30, 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.

3 participants