diff options
author | Lorenz Brun <lorenz@brun.one> | 2020-05-14 03:16:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 10:16:48 +0900 |
commit | 104a0ad08c8346a17d56287beb9756b8d52f684f (patch) | |
tree | 0b6d4058dcfdc9caf05c393a1397faa6cb2dae7f | |
parent | 1b60afc38a5e2ed544dc3661c63b108ec29d770c (diff) |
Fix externally-configured non-standard root paths (#60)
-rw-r--r-- | pkg/v2/service.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/v2/service.go b/pkg/v2/service.go index afbe3ee7f..f99456f63 100644 --- a/pkg/v2/service.go +++ b/pkg/v2/service.go @@ -109,6 +109,7 @@ type service struct { processes map[string]rproc.Process events chan interface{} platform rproc.Platform + opts options.Options ec chan proc.Exit oomPoller *epoller @@ -201,7 +202,7 @@ func (s *service) Cleanup(ctx context.Context) (*taskAPI.DeleteResponse, error) if err != nil { return nil, err } - r := proc.NewRunsc(proc.RunscRoot, path, ns, runtime, nil) + r := proc.NewRunsc(s.opts.Root, path, ns, runtime, nil) if err := r.Delete(ctx, s.id, &runsc.DeleteOpts{ Force: true, }); err != nil { @@ -364,6 +365,7 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ * } } s.task = process + s.opts = opts return &taskAPI.CreateTaskResponse{ Pid: uint32(process.Pid()), }, nil @@ -599,7 +601,7 @@ func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI. if err != nil { return nil, err } - rs := proc.NewRunsc(proc.RunscRoot, path, ns, runtime, nil) + rs := proc.NewRunsc(s.opts.Root, path, ns, runtime, nil) stats, err := rs.Stats(ctx, s.id) if err != nil { return nil, err |