Skip to content

Conversation

aDisplayName
Copy link

Add following property in CachedImage CRD

  • spec.progress.available
  • spec.progress.total

Update the status.progress.available in CachedImage CRD every 5 seconds during the image pulling in cachedimage controller

The CRD / API version is not changed here, still left as v1alpha1.
Ref: #401

@aDisplayName
Copy link
Author

This is to replace the following PR which were outdated:
#400 #402

@aDisplayName aDisplayName marked this pull request as ready for review August 4, 2025 18:30
@aDisplayName
Copy link
Author

aDisplayName commented Aug 4, 2025

@plaffitt , This is a continuation of the PR #402 I've submitted last year.

During the conversation with you, we have seen in some cases that reported image size was extremely small (#402 (review)) .

Without going into deep into "github.com/google/go-containerregistry/pkg/v1/remote" package, it normally happens with duplicated blob layer were found at remote and the remote decided there was no need to re-write the existing target anymore.

To handle that situation, we now have to manually calculate the total size of the images we are decided to copy. So the new change here is to add that logic, at the end of the CacheImage function call.

We will still report the progress, as that is still useful to estimate the caching speed. But when the writing completes, we will then report the calculated total size and have it updated to the CRD status.

As for size calculation, it is hard to get all the manifest size (those json files) included, and I'm not yet to figure out how to include every bit of manifests. So the total size right now only include all the size of compressed layer reported by the manifest. The actual layer file size will be slightly bigger, but I believe the tradeoff is the efficiency here as the difference is less than a few KB.

Let me know what do you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant