Conversation
|
ping @mrjana |
|
@mavenugo: There is a unit test failure: |
|
@aaronlehmann the test fails due to privileged operation ( creating /etc/docker directory). But in order to test the plugin integration, we need that. I added the failing test in this PR. If we cannot do privileged operation in the tests, then I would have to remove the test. |
|
Would it be possible to rewrite this test as a Docker Engine integration test? It's important that unit tests can run without root privileges, or touching files in The other thing I can think of is parameterizing this path in libnetwork, so that it doesn't have to be |
|
its not a libnetwork requirement. Its the plugin infrastructure requirement. I could move this IT out of swarmkit and move it into docker engine. That will make it simpler. |
166fded to
f5cbf61
Compare
Current coverage is 54.89% (diff: 64.70%)@@ master #1607 diff @@
==========================================
Files 33 86 +53
Lines 4520 14195 +9675
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 2026 7793 +5767
- Misses 2208 5375 +3167
- Partials 286 1027 +741
|
|
@aaronlehmann okay. that did it. |
| "github.com/docker/libnetwork/drivers/remote" | ||
| ) | ||
|
|
||
| func getInitializers() []initializer { |
There was a problem hiding this comment.
We need a definition of this for other non-linux OSes
| remoteIpam "github.com/docker/libnetwork/ipams/remote" | ||
| ) | ||
|
|
||
| func initIPAMDrivers(r *drvregistry.DrvRegistry, lDs, gDs interface{}) error { |
There was a problem hiding this comment.
We will never have the datastores passed to IPAM from swarmkit so it is better to not even have these args. Just pass nil to ipam Init functions
| @@ -633,12 +626,26 @@ func (na *NetworkAllocator) resolveDriver(n *api.Network) (driverapi.Driver, str | |||
|
|
|||
| d, _ := na.drvRegistry.Driver(dName) | |||
There was a problem hiding this comment.
We need to ignore all local scope drivers here since a plugin may be local scope and a user might mistakenly ask for it. I know it won't even come here because of the logic in docker/docker but it is better not to assume that and just ignore local scope drivers here.
f5cbf61 to
e110509
Compare
|
@mrjana PR updated with your comments addressed. |
| @@ -633,12 +627,31 @@ func (na *NetworkAllocator) resolveDriver(n *api.Network) (driverapi.Driver, str | |||
|
|
|||
| d, _ := na.drvRegistry.Driver(dName) | |||
There was a problem hiding this comment.
We need to check even in the case where the driver is already in driver registry because the current logic will only check the first time when the plugin is not loaded. Subsequently when the same driver name is used it will not check for the scope since it is already there in driver registry. I'd suggest moving the scope checking logic out of the d == nil { clause below and do it afterward so that it applies for both first time plugin init and subsequent references.
There was a problem hiding this comment.
good catch. fixed it. PTAL
Signed-off-by: Madhu Venugopal <[email protected]>
Signed-off-by: Madhu Venugopal <[email protected]>
e110509 to
2176817
Compare
|
ping @anusha-ragunathan Can you please review this as well ? EDIT : BTW, Based on your comment in my docker/docker changes, I get we should not be using |
|
I checked with @anusha-ragunathan and she confirmed that plugin-v2 support is not included in swarmkit yet. So, I guess we can go with the current changes and we can update the import along with the plugin-v2 support. |
|
This is causing |
As of moby/swarmkit#1607, swarmkit honors global network plugins while allocating network resources. This IT covers the e2e integration between libnetwork, swarmkit and docker engine to support global network-plugins for swarm-mode Signed-off-by: Madhu Venugopal <[email protected]>
In Docker 1.12, swarmkit is hard-coded only to accept
overlaynetwork driver and builtin ipam driver. That practically eliminates all other global network and IPAM plugins.This PR enables the network and ipam plugins be used with swarmkit as well.