Skip to content

Commit

Permalink
Fix process group handling. (#271)
Browse files Browse the repository at this point in the history
Also add a makefile target to build the debug image.
  • Loading branch information
dlorenc authored Aug 1, 2018
1 parent 63ef549 commit 8a2492d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
2 changes: 1 addition & 1 deletion integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}
Expand Down

0 comments on commit 8a2492d

Please sign in to comment.