Fix process group handling. (#271)

Also add a makefile target to build the debug image.
This commit is contained in:
dlorenc 2018-08-01 16:47:32 -07:00 committed by GitHub
parent 63ef549b2c
commit 8a2492d241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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 .

View File

@ -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

View File

@ -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")
}