Pulling a nested bundle should allow filtering #116
Labels
carvel accepted
This issue should be considered for future work and that the triage process has been completed
priority/unprioritized-backlog
Higher priority than priority/awaiting-more-evidence but not planned. Contributions are welcome.
Use Case
As an Application consumer
When consuming a Bundle that contains lots of Nested Bundles
I want control over which Nested Bundles are pulled
So that less compute and storage resources are consumed
And to reduce the time it takes to pull Nested Bundles
Description
Introduce a new flag
--recursive-filter
to thepull
command, accepting multiple filters to apply when pulling a Bundle.A Filter is a key-value that matches against an Images annotation contained in a Bundle's
ImageLock
file. If the image's annotation matches the provided filter/s then the image (which will always be a bundle) is fetched. Otherwise it is skipped.Acceptance Criteria
Given the following Bundle with Nested Bundle relationship:
And
The following bundles are structured:
my.registry.io/bundle-1@sha256:123
The
.imgpkg/images.yml
looks like the followingmy.registry.io/bundle-2@sha256:456
The
.imgpkg/images.yml
looks like the followingThe following scenarios should be fulfilled:
🟢 Scenario 0: Every image referenced by the 'root' Bundle is fetched
Results in every bundle being fetched.
Expected Standard Output:
🟢 Scenario 1: Only first level Nested Bundle is fetched
Results in only bundle-2 image being fetched.
Expected standard output
🟢 Scenario 2: Every Nested Bundle is fetched
Results in every bundle being fetched.
Expected Standard Output:
🟢 Scenario 3: Every Nested Bundle is skipped
Results in every nested bundle skipped. This is because the intermediate Bundle (Bundle-2) was not fetched. And thus, the
ImagesLock
file contained in Bundle-2 was not read / processed.🟢 Scenario 4: Filter flag is used, but the recursive flag is not provided
Results in only the root bundle 'bundle-1' being fetched.
Expected standard output
🔴 Scenario 5: Filter flag is incorrectly used
or
Results in imgpkg
pull
command error-ing out.Example of a possible standard Error message given to the user
Notes:
Out of scope:
--recursive-filter annotation_key=
--recursive-filter
and not providing--recursive
flag. See: [UX] Pulling a nested bundle should allow filtering #118The text was updated successfully, but these errors were encountered: