mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
return exec.Controller instead of nil
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
8c2c69d31e
commit
3a9be92927
3 changed files with 7 additions and 5 deletions
|
@ -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).
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue