goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.37k stars 4.69k forks source link

Configuring Harbor Proxy Cache Retention for Images Removed from Target Registry #20680

Open AssafKatz3 opened 1 month ago

AssafKatz3 commented 1 month ago

Hi, Per documentation: If the image is no longer in the target registry, no image is served.

Our staging environment uses Harbor to pull images from a target registry, which in this case is Amazon ECR. The ECR repository contains many temporary images that are created and then deleted as part of our development workflow.

We want Harbor to retain cached copies of these temporary images even after they are removed from the ECR registry. This would allow our staging environment to continue using these images even if they are no longer available in ECR.

Is it possible to configure Harbor's proxy cache to achieve this desired behavior?

Thanks

stonezdj commented 1 month ago

According to the PR: https://github.com/goharbor/harbor/pull/20597, current behavior is If the image is no longer in the target registry, the local image is served

Did you find any issue when the remote image is removed?

BTW, we will update the document to meet the current behavior.

AssafKatz3 commented 1 month ago

@stonezdj Per my understand this PR doesn't include in any release yet, so I cannot test it.

stonezdj commented 3 weeks ago

Because the previous behavior is If the image is no longer in the target registry, no image is served.. we need to add a configuration if we need to serve the previous image when the upstream image is removed.