-
Notifications
You must be signed in to change notification settings - Fork 623
Explicitly disallow network pluginv1 creation in swarm mode. #1894
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
Explicitly disallow network pluginv1 creation in swarm mode. #1894
Conversation
@mavenugo PTAL |
LGTM @aaronlehmann can you PTAL and also re-trigger the CI ? |
@@ -87,5 +88,14 @@ func validateDriver(driver *api.Driver) error { | |||
return grpc.Errorf(codes.InvalidArgument, "driver name: if driver is specified name is required") | |||
} | |||
|
|||
p, err := pg.Get(driver.Name, pluginType, plugingetter.LOOKUP) | |||
if err != nil { | |||
return grpc.Errorf(codes.InvalidArgument, "error during plugin lookup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to provide driver.Name
for debugging.
} | ||
|
||
if p.IsV1() { | ||
return grpc.Errorf(codes.InvalidArgument, "legacy plugins of type %s are not supported in swarm mode", pluginType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide driver.Name
in error message.
Current coverage is 55.33% (diff: 40.00%)
@@ bump_v1.13.1 #1894 diff @@
==============================================
Files 58 102 +44
Lines 8927 17061 +8134
Methods 0 0
Messages 0 0
Branches 0 0
==============================================
+ Hits 5201 9441 +4240
- Misses 3160 6475 +3315
- Partials 566 1145 +579
|
Why aren't v1 plugins supported? Is it just because the scheduler's plugin filter won't work correctly for these, or is there another reason? Does it apply to volume plugins as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A node could have a v1 plugin running before it joins the Swarm, and it will also pass through the plugin filter IIUC. Is this not the case?
@aaronlehmann : Its specific to network plugins. moby/moby#29878 and moby/moby#30332 (comment) has some details. @mavenugo made the decision and I'll let him explain. |
@aaronlehmann there are a few technical reasons and a few maintenance reasons.
The combination of the above 3 causes the technical issue at hand. When From a maintenance standpoint, plugin-v1 had many daemon issues in the past and the major one was the fact that plugins can be loaded later than the actual container being used and it caused major headaches. Also, the plugins can be out of the box and can cause more issues. So, plugin-v2 is a welcome change. Since 1.13.1 is the first time we are planning on supporting plugins in swarmkit, we feel that there is no point carrying an implementation that must be deprecated asap. Also, plugin-v2 is the recommended approach. Since it doesnt break any backward compatibility (being the first release of plugin support), I vote to not support plugin-v1 with swarmkit. |
Thanks for the explanation. It makes technical sense to me now why v1 network plugins don't really work with swarmkit, but v1 volume plugins may work in some cases (if you happen to precreate the volumes on the nodes, or do something else to get the plugin to load). However, based on this:
...I wonder if it makes sense to disallow v1 volume plugins as well. It might be confusing that services that use v1 volume plugins only get scheduled to nodes that have the plugin loaded because of some external action, and it also might be confusing that v1 volume plugins are "supported" but v1 network plugins are not. Then again, v1 volume plugins technically work in 1.13.0 (if you work around the plugin filter issues), so maybe removing that support in a patch release is not reasonable. |
Yes, it is inconsistent (volume pluginv1 and network pluginv1 in swarm mode), but we should leave volume pluginv1 in swarm mode untouched in 1.13.x. |
In swarm mode, only network pluginv2 is supported; pluginv1 is not. When the plugin support was re-enabled in 1.13.x, it inadvertently allowed both pluginv1 and pluginv2. This commit fixes that. Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
5b73846
to
0b0e2a4
Compare
LGTM |
1 similar comment
LGTM |
This fix updates SwarmKit to 78ae345 (from 037b491) The following issues in docker are related - Can not update service in host publish mode (moby#30199) (fixed) - Add `ReadonlyRootfs` in ContainerSpec for `--read-only` (moby#29972) (needed) - Explicitly disallow network pluginv1 creation in swarm mode (See discussion in moby/swarmkit/pull/1899, moby/swarmkit/pull/1894, and moby/pull/30332#issuecomment-274277948) This fix fixes moby#30199 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
In swarm mode, only network pluginv2 is supported; pluginv1 is not. When
the plugin support was re-enabled in 1.13.x, it inadvertently allowed
both pluginv1 and pluginv2. This commit fixes that.
Signed-off-by: Anusha Ragunathan anusha.ragunathan@docker.com