mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[PR #57] [MERGED] Use docker’s stdcopy to ensure we don’t emit garbage bytes to stdout #1342
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1342
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/57
Author: @aidansteele
Created: 4/9/2019
Status: ✅ Merged
Merged: 5/23/2019
Merged by: @cplee
Base:
master← Head:fix-nontty📝 Commits (1)
1d64fefUse docker’s stdcopy to ensure we don’t emit garbage bytes to stdout📊 Changes
2 files changed (+60 additions, -6 deletions)
View changed files
📝
container/docker_common.go(+5 -6)➕
container/docker_run_test.go(+55 -0)📄 Description
As per the
ContainerAttach()docs, a container not using a TTY has stderr and stdout multiplexed into a single stream in a Docker-specific format.When running
actand its stdout is not a terminal (e.g. when it's redirected to a file),DockerExecutorInput.logDockerOutput()is invoked -- I've changed this to usegithub.com/docker/docker/pkg/stdcopy.StdCopyas per Docker's suggestion.Right now the issue is the tests pass when output is redirected to a file and fail when run directly in a terminal! ❗️ This is because of the following two conflicting pieces:
github.com/nektos/act@f2cb9e391e/container/docker_run.go (L89-L97)github.com/nektos/act@f2cb9e391e/container/docker_run.go (L170-L171)Honestly, I'm not sure what the purpose of the
NORAWenv var is. IfNORAWis passed in, the tests will fail in even more spectacular ways. I would like to do the following, but wanted to run it by you first before submitting this PR:terminal.IsTerminal()inattachContainer(), we use the Docker API client to introspect the container and see if it is in TTY mode or not.Tty *booltoNewDockerRunExecutorInputand only fall back toterminal.IsTerminal()if it is nil.What are your thoughts?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.