summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLantao Liu <lantaol@google.com>2019-05-14 18:43:22 -0700
committerIan Lewis <ianlewis@google.com>2019-05-15 10:43:22 +0900
commitc66bc73ecbf5ab2046607364993ba1e5eefc84bb (patch)
tree12973dfa7f8c865849f7f375ead2f8cd9c148c56
parent97875daf63d03cda6ff3c4f393a004a8295a748e (diff)
Use context.Background for runtime.Wait. (#28)
Signed-off-by: Lantao Liu <lantaol@google.com>
-rw-r--r--pkg/v1/proc/init.go12
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
}