Use typeurl package for spec types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -139,7 +139,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bundle, err := newBundle(filepath.Join(r.root, namespace), namespace, id, opts.Spec)
|
||||
bundle, err := newBundle(filepath.Join(r.root, namespace), namespace, id, opts.Spec.Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -183,7 +183,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
|
||||
if _, err = s.Create(ctx, sopts); err != nil {
|
||||
return nil, errors.New(grpc.ErrorDesc(err))
|
||||
}
|
||||
t := newTask(id, namespace, opts.Spec, s)
|
||||
t := newTask(id, namespace, s)
|
||||
if err := r.tasks.add(ctx, t); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -323,14 +323,9 @@ func (r *Runtime) loadTasks(ctx context.Context, ns string) ([]*Task, error) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
spec, err := bundle.Spec()
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("load task spec")
|
||||
}
|
||||
o = append(o, &Task{
|
||||
containerID: id,
|
||||
shim: s,
|
||||
spec: spec,
|
||||
namespace: ns,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user