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

Add IPAM Config Options to match libnetwork #17316

Merged
merged 1 commit into from Jan 14, 2016

Conversation

rmb938
Copy link
Contributor

@rmb938 rmb938 commented Oct 23, 2015

This should allow docker to pass through ipam config driver options to libnetwork.

I can't get my docker development environment working so I can't test this but it seems like it should work without breaking anything. Fully tested and works with the API. Still needs discussion on how to implement on the cli.

Signed-off-by: Ryan Belgrave rmb1993@gmail.com

@rmb938
Copy link
Contributor Author

rmb938 commented Oct 23, 2015

Can someone run the userns build again. It timed out.

Thanks

@thaJeztah
Copy link
Member

@rmb938 done!

@rmb938
Copy link
Contributor Author

rmb938 commented Oct 23, 2015

Thanks :)

@thaJeztah
Copy link
Member

ping @mrjana @mavenugo

@rmb938
Copy link
Contributor Author

rmb938 commented Oct 24, 2015

Just got my dev environment working properly and the change works with the API but more discussion is needed on how to implement in the cli.

@rmb938
Copy link
Contributor Author

rmb938 commented Oct 28, 2015

Anyone care to look at this and possibly getting it merged?

@thaJeztah
Copy link
Member

@rmb938 it's currently quite busy with preparations for the coming 1.9 release, so reviews will take longer than usual. Apologies for that, but hope you'll understand ❤️

@LK4D4
Copy link
Contributor

LK4D4 commented Nov 13, 2015

Dunno what's going on, but ping @mavenugo @mrjana @aboch

@mavenugo
Copy link
Contributor

@rmb938 the -d option was meant for the network drivers. am not too sure if we should conflate that to ipam drivers as well. Or maybe, we should namespace the key to include the driver identifier to indicate which driver is the option is meant for. WDYT ?

@rmb938
Copy link
Contributor Author

rmb938 commented Nov 15, 2015

I think implementing a --ipam-options or something would be better so it is more obvious to the user.

@rmb938
Copy link
Contributor Author

rmb938 commented Dec 4, 2015

@mavenugo Would --ipam-options be reasonable to add?

@mavenugo
Copy link
Contributor

mavenugo commented Dec 4, 2015

@rmb938 I think so.

@rmb938
Copy link
Contributor Author

rmb938 commented Dec 4, 2015

@mavenugo any idea why two of the tests failed? It doesn't seem like it is directly related to my changes.

@thaJeztah
Copy link
Member

@mavenugo is this ready to move forward? I'm ok with adding an option to specify IPAM-options if the network team thinks these options should be available from the docker side

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Dec 12, 2015
@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Dec 12, 2015
@rmb938
Copy link
Contributor Author

rmb938 commented Dec 12, 2015

Fixed the merge conflicts

@thaJeztah
Copy link
Member

Thanks @rmb938!

c.Assert(opts["opt1"], checker.Equals, "drv1")
c.Assert(opts["opt2"], checker.Equals, "drv2")

// remove network
Copy link
Member

Choose a reason for hiding this comment

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

No need for this cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't fully understand what you mean. Do you want to get rid of the test?

Copy link
Member

Choose a reason for hiding this comment

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

No, just this removal bit, the test suite will take care of removing the network.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh ok will do.

@cpuguy83
Copy link
Member

One nit, LGTM if janky is happy.

@cpuguy83
Copy link
Member

ping @thaJeztah @vdemeester for docs


cmd.Var(&flIpamSubnet, []string{"-subnet"}, "subnet in CIDR format that represents a network segment")
cmd.Var(&flIpamIPRange, []string{"-ip-range"}, "allocate container ip from a sub-range")
cmd.Var(&flIpamGateway, []string{"-gateway"}, "ipv4 or ipv6 Gateway for the master subnet")
cmd.Var(flIpamAux, []string{"-aux-address"}, "auxiliary ipv4 or ipv6 addresses used by Network driver")
cmd.Var(flOpts, []string{"o", "-opt"}, "set driver specific options")
cmd.Var(flIpamOpt, []string{"-ipam-opt"}, "set ipam driver specific options")
Copy link
Member

Choose a reason for hiding this comment

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

s/ipam/IPAM/

@vdemeester
Copy link
Member

docs LGTM 🐰

@thaJeztah
Copy link
Member

Oh, sorry, got called away for a bit; @rmb938 can you also update the example response/request in;

https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.22.md#inspect-network

and https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.22.md#create-a-network ?

Looks like this needs a rebase as well now

@rmb938
Copy link
Contributor Author

rmb938 commented Jan 14, 2016

@thaJeztah No problem. Since there are no default options what would you like me to put in there? Or just leave it empty?

@thaJeztah
Copy link
Member

@rmb938 I think leaving it empty for now should be okay then; just to make people aware of its existence. Alternatively, you can add some "fake" options to illustrate what it looks like (e.g. foo=bar)

@rmb938
Copy link
Contributor Author

rmb938 commented Jan 14, 2016

@thaJeztah Sounds good. How does that look.

@thaJeztah
Copy link
Member

Awesome! LGTM

@@ -14,6 +14,7 @@ docker-network-create - create a new network
[**--ip-range**=*[]*]
[**--ipam-driver**=*default*]
[**-o**|**--opt**=*map[]*]
[**--ipam-opt**=*map[]*]
Copy link
Contributor

Choose a reason for hiding this comment

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

this list should be ordered alphabetically. So this option needs to go after ipam-driver.

Signed-off-by: Ryan Belgrave <rmb1993@gmail.com>
@calavera
Copy link
Contributor

docs LGTM

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.

None yet