From 8a2492d2415fa13798919ebd57fdd2ed10ce7700 Mon Sep 17 00:00:00 2001 From: dlorenc Date: Wed, 1 Aug 2018 16:47:32 -0700 Subject: [PATCH] Fix process group handling. (#271) Also add a makefile target to build the debug image. --- Makefile | 1 + integration-test.sh | 2 +- pkg/commands/run.go | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fcd8a2b382..8d20c2b031 100644 --- a/Makefile +++ b/Makefile @@ -51,3 +51,4 @@ integration-test: .PHONY: images images: docker build -t $(REGISTRY)/executor:latest -f deploy/Dockerfile . + docker build -t $(REGISTRY)/executor:debug -f deploy/Dockerfile_debug . diff --git a/integration-test.sh b/integration-test.sh index 2cbb68efd0..51fcb6e20b 100755 --- a/integration-test.sh +++ b/integration-test.sh @@ -35,4 +35,4 @@ fi echo "Running integration tests..." make out/executor pushd integration -go test -v --bucket "${GCS_BUCKET}" --repo "${IMAGE_REPO}" +go test -v --bucket "${GCS_BUCKET}" --repo "${IMAGE_REPO}" --timeout 30m diff --git a/pkg/commands/run.go b/pkg/commands/run.go index bd3fb5ba98..3b8ca29cce 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -89,9 +89,9 @@ func (r *RunCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bui } gid = uint32(gid64) } - cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uid, Gid: gid} } + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} if err := cmd.Start(); err != nil { return errors.Wrap(err, "starting command") @@ -101,7 +101,6 @@ func (r *RunCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.Bui if err != nil { return errors.Wrap(err, "getting group id for process") } - if err := cmd.Wait(); err != nil { return errors.Wrap(err, "waiting for process to exit") }