Add task manager

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-08-26 11:56:46 -07:00
parent 2d5d3541e6
commit 7c4ead285d
4 changed files with 58 additions and 6 deletions

View File

@@ -81,7 +81,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
return nil, err
}
v2r, err := ic.Get(plugin.RuntimePluginV2)
v2r, err := ic.GetByID(plugin.RuntimePluginV2, "task")
if err != nil {
return nil, err
}
@@ -111,7 +111,7 @@ func initFunc(ic *plugin.InitContext) (interface{}, error) {
store: db.ContentStore(),
publisher: ep.(events.Publisher),
monitor: monitor.(runtime.TaskMonitor),
v2Runtime: v2r.(*v2.ShimManager),
v2Runtime: v2r.(*v2.TaskManager),
}
for _, r := range runtimes {
tasks, err := r.Tasks(ic.Context, true)
@@ -139,7 +139,7 @@ type local struct {
publisher events.Publisher
monitor runtime.TaskMonitor
v2Runtime *v2.ShimManager
v2Runtime *v2.TaskManager
}
func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.CallOption) (*api.CreateTaskResponse, error) {