mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Had HasExperimental()
to cluster backend
It's already defined on the daemon. This allows us to not call
`SystemInfo` which is failry heavy and potentially can even error.
Takes care of todo item from Derek's containerd integration PR.
51c412f26e/daemon/cluster/services.go (L148-L149)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
9c83848fc9
commit
fa9df85c6a
3 changed files with 3 additions and 4 deletions
|
@ -61,6 +61,7 @@ type Backend interface {
|
|||
PluginManager() *plugin.Manager
|
||||
PluginGetter() *plugin.Store
|
||||
GetAttachmentStore() *networkSettings.AttachmentStore
|
||||
HasExperimental() bool
|
||||
}
|
||||
|
||||
// VolumeBackend is used by an executor to perform volume operations
|
||||
|
|
|
@ -229,8 +229,7 @@ func (e *executor) Controller(t *api.Task) (exec.Controller, error) {
|
|||
}
|
||||
switch runtimeKind {
|
||||
case string(swarmtypes.RuntimePlugin):
|
||||
info, _ := e.backend.SystemInfo()
|
||||
if !info.ExperimentalBuild {
|
||||
if !e.backend.HasExperimental() {
|
||||
return ctlr, fmt.Errorf("runtime type %q only supported in experimental", swarmtypes.RuntimePlugin)
|
||||
}
|
||||
c, err := plugin.NewController(e.pluginBackend, t)
|
||||
|
|
|
@ -144,8 +144,7 @@ func (c *Cluster) CreateService(s types.ServiceSpec, encodedAuth string, queryRe
|
|||
case *swarmapi.TaskSpec_Generic:
|
||||
switch serviceSpec.Task.GetGeneric().Kind {
|
||||
case string(types.RuntimePlugin):
|
||||
info, _ := c.config.Backend.SystemInfo()
|
||||
if !info.ExperimentalBuild {
|
||||
if !c.config.Backend.HasExperimental() {
|
||||
return fmt.Errorf("runtime type %q only supported in experimental", types.RuntimePlugin)
|
||||
}
|
||||
if s.TaskTemplate.PluginSpec == nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue