diff --git a/api/types/swarm/task.go b/api/types/swarm/task.go index 8d5792d3df..99e9a6d58b 100644 --- a/api/types/swarm/task.go +++ b/api/types/swarm/task.go @@ -66,8 +66,10 @@ type TaskSpec struct { // parameters have been changed. ForceUpdate uint64 - Runtime RuntimeType `json:",omitempty"` - RuntimeData []byte `json:",omitempty"` + Runtime RuntimeType `json:",omitempty"` + // TODO (ehazlett): this should be removed and instead + // use struct tags (proto) for the runtimes + RuntimeData []byte `json:",omitempty"` } // Resources represents resources (CPU/Memory). diff --git a/daemon/cluster/convert/service.go b/daemon/cluster/convert/service.go index e6d0ed6aad..6ea4393cbe 100644 --- a/daemon/cluster/convert/service.go +++ b/daemon/cluster/convert/service.go @@ -79,7 +79,7 @@ func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error) taskTemplate := taskSpecFromGRPC(spec.Task) - switch t := spec.Task.Runtime.(type) { + switch t := spec.Task.GetRuntime().(type) { case *swarmapi.TaskSpec_Container: containerConfig := t.Container taskTemplate.ContainerSpec = containerSpecFromGRPC(containerConfig) diff --git a/daemon/cluster/executor/container/executor.go b/daemon/cluster/executor/container/executor.go index b18f3dd590..4407ef86f2 100644 --- a/daemon/cluster/executor/container/executor.go +++ b/daemon/cluster/executor/container/executor.go @@ -185,11 +185,11 @@ func (e *executor) Controller(t *api.Task) (exec.Controller, error) { case *api.TaskSpec_Container: c, err := newController(e.backend, t, secrets.Restrict(e.secrets, t)) if err != nil { - return nil, err + return ctlr, err } ctlr = c default: - return nil, fmt.Errorf("unsupported runtime: %q", r) + return ctlr, fmt.Errorf("unsupported runtime: %q", r) } return ctlr, nil