Add --layer-index flag to pull artifact#5886
Open
stratch1989 wants to merge 1 commit into
Open
Conversation
The flux pull artifact command currently extracts only the first layer of the OCI manifest, which prevents pulling arbitrary layers from OCI artifacts not created by flux. The underlying oci.Client.Pull already accepts a WithPullLayerIndex option but it was not exposed to the CLI. Add a --layer-index int flag (default -1, meaning unset) wired through to oci.WithPullLayerIndex when set. The default flow is unchanged. Signed-off-by: Ruslan Shaydullin <shaydullin.r.d@outlook.com> Assisted-by: claude-code/claude-opus-4-7
Member
|
This PR is adding |
Author
I picked If you'd prefer the issue wording: rename to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4243
What
Adds
--layer-index <int>toflux pull artifact. When set, theunderlying
oci.Client.Pullis called withWithPullLayerIndex(n)sothe chosen layer is extracted instead of the default first layer. Lets
users pull arbitrary layers from OCI artifacts that were not produced
by flux.
Compatibility
Default flow is unchanged — without
--layer-indexthe command behavesexactly as before (extracts the first layer with
layerIndex: 0inoci.Client.Pull).Precedent
This continues the work from PR #4790 (closed without merge after
21 months of inactivity — no review feedback on the thread, likely
stale-bot closure). That PR no longer applies cleanly because of
unrelated refactors in
pull_artifact.go, so this is rewritten fromscratch using the same flag name.
Tests
No existing
pull_artifact_test.goin the repo; the change is astraightforward CLI flag wiring with no extractable helper. Followed
the existing pull_artifact precedent of no test file. Happy to add
coverage if maintainers prefer.
Local testing notes
On Apple Silicon the Makefile's
setup-envtest use latest --arch=amd64step fails (
bad CPU type in executable). Ran envtest manually with--arch=arm64andKUBEBUILDER_ASSETSpointed at the arm64 dir; thefull
cmd/flux/...test suite passes. CI on linux/amd64 should beunaffected.