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

add --layer-selector to flux pull artifact #4243

Open
errordeveloper opened this issue Sep 15, 2023 · 3 comments
Open

add --layer-selector to flux pull artifact #4243

errordeveloper opened this issue Sep 15, 2023 · 3 comments
Assignees
Labels
area/oci OCI related issues and pull requests enhancement New feature or request

Comments

@errordeveloper
Copy link
Contributor

errordeveloper commented Sep 15, 2023

It would be really nice if flux pull artifact supported layer selection in the same way OCIRepository does.

More generally, I do wonder if there is a way to improve make CLI feature parity for some cases like this. It would seem useful to be able to run flux pull with any source object definition and extract it to a dir, respecting all object fields. It might be tricky to handle credentials, but surely not unsolvable, perhaps any secret refs would just have to be passed as flags or env vars, if reading from a cluster is not an option.
Of course, when it comes to git, most people are familiar with git clone, however, OCI poses a very specific challenge, one has to understand OCI to make good use of crane (as the first example that comes to mind), I don't know if oras might be a bit easier...

@stefanprodan
Copy link
Member

Currently the Flux CLI can't pull artifacts not created by it. We could remove this restriction by not using the default here

ociClient := oci.NewClient(oci.DefaultOptions())

Then we can add --layer-selector and the CLI could download and unpack any layer from any OCI artifact.

@stefanprodan stefanprodan added enhancement New feature or request area/oci OCI related issues and pull requests labels Sep 18, 2023
@ptfpinho23
Copy link

If at all possible I'd like to take this one, as I've worked with something similar in the past.

@stefanprodan
Copy link
Member

@ptfpinho23 layer selection was implemented in our oci package, you would need to map the option to a CLI flag: https://github.com/fluxcd/pkg/blob/235bfbb67d45b96942f03402b0c33dd5a74b2047/oci/client/pull.go#L50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci OCI related issues and pull requests enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants