Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't panic at an unexpected log type #360

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ func (c *DockerContainer) StartLogProducer(ctx context.Context) error {
}
logType := h[0]
if logType > 2 {
panic(fmt.Sprintf("received invalid log type: %d", logType))
fmt.Fprintf(os.Stderr, fmt.Sprintf("received invalid log type: %d", logType))
// sometimes docker returns logType = 3 which is an undocumented log type, so treat it as stdout
logType = 1
}

// a map of the log type --> int representation in the header, notice the first is blank, this is stdin, but the go docker client doesn't allow following that in logs
Expand Down