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

Allow source type input via CLI flag (not scheme) #1783

Closed
wagoodman opened this issue May 4, 2023 · 2 comments · Fixed by #2610
Closed

Allow source type input via CLI flag (not scheme) #1783

wagoodman opened this issue May 4, 2023 · 2 comments · Fixed by #2610
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@wagoodman
Copy link
Contributor

What would you like to be added:

Today we allow for input like this:

syft registry:my/image:latest

Which forces syft to reach out to grab my/image:latest directly from the registry, not through the docker daemon.

It would be great to add an optional --from flag that takes what we allow today as a scheme but instead as a CLI flag.

Note: we could allow for a hold over period that, if --from is empty, we fall back to todays scheme parsing approach. If someone attempts to use a scheme and specify --from an error is returned.

Why is this needed:

There are known error cases in specific images that have always caused issues and complexities when parsing the scheme (more recently #1695 ). This moves syft forward to act more like anchorectl while removing these odd cases and code complexity (over time).

@willmurphyscode
Copy link
Contributor

At this point, I assume it's not possible to accept the breaking change of making the source want a proper URI scheme like file://some-directory or docker://docker.io/library/alpine:latest or whatever? Would that remove enough ambiguity to solve all the use cases that --from is meant to solve? In other words, am I right in thinking that --from is a way to work around the fact that URI's with schemes were not used initially?

@kzantow
Copy link
Contributor

kzantow commented Sep 18, 2023

Just an observation about the URI idea: something like git://https://github.com/anchore/syft is a valid URI, but looks a little weird.

In another tool, have a keyword like --from to make the source very explicit and it seems to work pretty well. I think it fits a bit with --platform and other flags we already have that affect fetching from the source. I'm 👍 with the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants