Skip to content

Commit

Permalink
tink-worker: do not attach the action container stdout/stderr to the …
Browse files Browse the repository at this point in the history
…current process when --capture-action-logs=false (#549)

## Description

when tink-worker is configured with --capture-action-logs=false the action
container stdout/stderr must not be attached to the current process.

that configuration is used when there is an existing docker log-driver, which
will capture all the containers logs without tink-worker help.

## Why is this needed

this prevents the action container logs from being duplicated in the
tink-worker container logs and in the action container docker logs.

## How Has This Been Tested?

I've manually tested this locally.

## How are existing users impacted? What migration steps/scripts do we need?

No impact is expected.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] committed Nov 2, 2021
2 parents 948f687 + c6ce199 commit 8208713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/tink-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.11
FROM alpine:3.14
ENTRYPOINT [ "/usr/bin/tink-worker" ]

ARG TARGETARCH
Expand Down
4 changes: 2 additions & 2 deletions cmd/tink-worker/internal/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func (w *Worker) createContainer(ctx context.Context, cmd []string, wfID string,
Env: action.GetEnvironment(),
}
if !captureLogs {
config.AttachStdout = true
config.AttachStderr = true
config.AttachStdout = false
config.AttachStderr = false
config.Tty = false
}

Expand Down

0 comments on commit 8208713

Please sign in to comment.