When pulling image or bundle inform the caller if the content is cacheable or not #390
Labels
carvel accepted
This issue should be considered for future work and that the triage process has been completed
enhancement
This issue is a feature request
Describe the problem/challenge you have
When another tool like vendir tries to pull a bundle or image using imgpkg, it should be informed if the contents are cacheable or not. This solution will allow tools to not rely as much on the registry and can store some of the image information on the disk.
Describe the solution you'd like
I am proposing 2 possible UX implementations for this feature.
Option 1: Create a machine-readable output for the pull command
In this option add
--output-type
that can have the valueyaml
and would look something like the following example:or for recursive pulls
Pros:
Cons:
Option 2: Dedicated API to provide this information
In this option, the tools can include imgpkg as a library and that would allow them to have more control over processing the outputs.
One possible API could be:
Pros:
Cons:
Note: Adding some text to the current output was also considered. Parsing text is a process that can be error-prone and changing versions of the text can cause other tools that expect a particular text to fail. Due to this we advise against this implementation and didn't provide it as an option.
Looking at the pros and cons I believe the best solution would be to create an API that can be used by other tools. This will solve compatibility issues between these tools and imgpkg and would allow these tools to have better control over the errors that might surface from the pull.
Anything else you would like to add:
From the following scenarios, let's check which ones imgpkg knows are not going to change and can be cacheable
In this scenario, the contents are not cacheable because the tags can be moved to a different image
In this scenario, the contents are cacheable
In this scenario, the contents are not cacheable because the tags can be moved to a different bundle
In this scenario, the contents are cacheable because nothing will change on the contents of the bundle
In this scenario, the contents are not cacheable because is in the future the bundle becomes fully copied the ImagesLock file can be updated with the new location of the images
In this scenario, the contents are not cacheable because is in the future the remaining images might be copied and that will update the ImagesLock file
TLDR; currently imgpkg cannot partially copy a bundle.
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help work on this issue.
The text was updated successfully, but these errors were encountered: