diff options
author | Lantao Liu <lantaol@google.com> | 2019-05-14 18:43:22 -0700 |
---|---|---|
committer | Ian Lewis <ianlewis@google.com> | 2019-05-15 10:43:22 +0900 |
commit | c66bc73ecbf5ab2046607364993ba1e5eefc84bb (patch) | |
tree | 12973dfa7f8c865849f7f375ead2f8cd9c148c56 | |
parent | 97875daf63d03cda6ff3c4f393a004a8295a748e (diff) |
Use context.Background for runtime.Wait. (#28)
Signed-off-by: Lantao Liu <lantaol@google.com>
-rw-r--r-- | pkg/v1/proc/init.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/v1/proc/init.go b/pkg/v1/proc/init.go index 1c0c88c4f..5dbb1daab 100644 --- a/pkg/v1/proc/init.go +++ b/pkg/v1/proc/init.go @@ -225,21 +225,21 @@ func (p *Init) Start(ctx context.Context) error { return p.initState.Start(ctx) } -func (p *Init) start(context context.Context) error { +func (p *Init) start(ctx context.Context) error { var cio runc.IO if !p.Sandbox { cio = p.io } - if err := p.runtime.Start(context, p.id, cio); err != nil { + if err := p.runtime.Start(ctx, p.id, cio); err != nil { return p.runtimeError(err, "OCI runtime start failed") } go func() { - status, err := p.runtime.Wait(context, p.id) + status, err := p.runtime.Wait(context.Background(), p.id) if err != nil { - log.G(context).WithError(err).Errorf("Failed to wait for container %q", p.id) + log.G(ctx).WithError(err).Errorf("Failed to wait for container %q", p.id) // TODO(random-liu): Handle runsc kill error. - if err := p.killAll(context); err != nil { - log.G(context).WithError(err).Errorf("Failed to kill container %q", p.id) + if err := p.killAll(ctx); err != nil { + log.G(ctx).WithError(err).Errorf("Failed to kill container %q", p.id) } status = internalErrorCode } |