Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

feat: support stdin#95

Open
knqyf263 wants to merge 1 commit intomainfrom
support_stdin
Open

feat: support stdin#95
knqyf263 wants to merge 1 commit intomainfrom
support_stdin

Conversation

@knqyf263
Copy link
Copy Markdown
Collaborator

@knqyf263 knqyf263 commented Mar 16, 2020

fanal supported - to take an image content from stdin before, but the feature was dropped when moving to containers/image. But some users want this feature, so this PR makes it possible to do it again.
Related to aquasecurity/trivy#418

For example,

$ docker save centos:7 | fanal -f -

@knqyf263 knqyf263 self-assigned this Mar 16, 2020
@knqyf263 knqyf263 requested a review from simar7 March 16, 2020 19:37

// Receive an image content from stdin
var tmpImageFileName string
if image.IsFile && image.Name == "-" && !terminal.IsTerminal(0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to set something up so that !terminal.IsTerminal(0) can evaluate to true in a test? If so we should add a test for it.

@knqyf263 knqyf263 changed the base branch from master to main December 17, 2020 13:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants