Skip to content

Commit 8aca18d

Browse files
authored
Merge pull request #38813 from cpuguy83/add_experimental_interface
Had `HasExperimental()` to cluster backend
2 parents 9c83848 + fa9df85 commit 8aca18d

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

daemon/cluster/executor/backend.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type Backend interface {
6161
PluginManager() *plugin.Manager
6262
PluginGetter() *plugin.Store
6363
GetAttachmentStore() *networkSettings.AttachmentStore
64+
HasExperimental() bool
6465
}
6566

6667
// VolumeBackend is used by an executor to perform volume operations

daemon/cluster/executor/container/executor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ func (e *executor) Controller(t *api.Task) (exec.Controller, error) {
229229
}
230230
switch runtimeKind {
231231
case string(swarmtypes.RuntimePlugin):
232-
info, _ := e.backend.SystemInfo()
233-
if !info.ExperimentalBuild {
232+
if !e.backend.HasExperimental() {
234233
return ctlr, fmt.Errorf("runtime type %q only supported in experimental", swarmtypes.RuntimePlugin)
235234
}
236235
c, err := plugin.NewController(e.pluginBackend, t)

daemon/cluster/services.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ func (c *Cluster) CreateService(s types.ServiceSpec, encodedAuth string, queryRe
144144
case *swarmapi.TaskSpec_Generic:
145145
switch serviceSpec.Task.GetGeneric().Kind {
146146
case string(types.RuntimePlugin):
147-
info, _ := c.config.Backend.SystemInfo()
148-
if !info.ExperimentalBuild {
147+
if !c.config.Backend.HasExperimental() {
149148
return fmt.Errorf("runtime type %q only supported in experimental", types.RuntimePlugin)
150149
}
151150
if s.TaskTemplate.PluginSpec == nil {

0 commit comments

Comments
 (0)