Remove tasks map from service
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -34,7 +34,6 @@ func init() {
|
||||
}
|
||||
|
||||
func New(ic *plugin.InitContext) (interface{}, error) {
|
||||
|
||||
rootDir := filepath.Join(ic.Root, runtimeName)
|
||||
if err := os.MkdirAll(rootDir, 0755); err != nil {
|
||||
return nil, errors.Wrapf(err, "could not create state directory at %s", rootDir)
|
||||
@@ -152,10 +151,19 @@ func (r *Runtime) Tasks(ctx context.Context) ([]plugin.Task, error) {
|
||||
list = append(list, c)
|
||||
}
|
||||
}
|
||||
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func (r *Runtime) Get(ctx context.Context, id string) (plugin.Task, error) {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
c, ok := r.containers[id]
|
||||
if !ok {
|
||||
return fmt.Errorf("container %s does not exit", id)
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (r *Runtime) Events(ctx context.Context) <-chan *plugin.Event {
|
||||
return r.events
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user