Skip to content

(cherry-pick): fix proxy cache serve local on remote not found - #23049

Merged
stonezdj merged 8 commits into
goharbor:release-2.15.0from
stonezdj:backport-pr-22153-to-2.15.0
Apr 8, 2026
Merged

(cherry-pick): fix proxy cache serve local on remote not found#23049
stonezdj merged 8 commits into
goharbor:release-2.15.0from
stonezdj:backport-pr-22153-to-2.15.0

Conversation

@stonezdj

@stonezdj stonezdj commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Backport of #22153 to release-2.15.0.
This PR cherry-picks all commits from #22153 onto release-2.15.0 for inclusion in 2.15.1.

@codecov

codecov Bot commented Mar 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-2.15.0@47762e5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...rojects/create-project/create-project.component.ts 0.00% 1 Missing and 1 partial ⚠️
.../portal/src/app/shared/services/project.service.ts 0.00% 1 Missing ⚠️
src/server/middleware/repoproxy/proxy.go 0.00% 1 Missing ⚠️
src/server/v2.0/handler/project_metadata.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-2.15.0   #23049   +/-   ##
=================================================
  Coverage                  ?   66.01%           
=================================================
  Files                     ?     1073           
  Lines                     ?   116488           
  Branches                  ?     2939           
=================================================
  Hits                      ?    76901           
  Misses                    ?    35332           
  Partials                  ?     4255           
Flag Coverage Δ
unittests 66.01% <72.22%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/controller/proxy/controller.go 15.65% <100.00%> (ø)
src/pkg/project/models/project.go 39.62% <100.00%> (ø)
...t-policy-config/project-policy-config.component.ts 53.05% <100.00%> (ø)
src/portal/src/app/base/project/project.ts 100.00% <ø> (ø)
.../portal/src/app/shared/services/project.service.ts 4.08% <0.00%> (ø)
src/server/middleware/repoproxy/proxy.go 3.71% <0.00%> (ø)
src/server/v2.0/handler/project_metadata.go 14.28% <0.00%> (ø)
...rojects/create-project/create-project.component.ts 47.40% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stonezdj stonezdj changed the title [2.15.0] Backport #22153: fix proxy cache serve local on remote not found (cherry-pick): fix proxy cache serve local on remote not found Mar 30, 2026

@chlins chlins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wy65701436 wy65701436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

AYDEV-FR and others added 8 commits April 8, 2026 11:07
Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
(cherry picked from commit 6208828)
Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
(cherry picked from commit 64ea3ca)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Vadim Bauer <Bauer.vadim@gmail.com>
(cherry picked from commit ec97f2a)
Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
(cherry picked from commit 2135287)
Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
(cherry picked from commit d6b04bf)
Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
(cherry picked from commit 77c3ddd)
Signed-off-by: stonezdj <stonezdj@gmail.com>
(cherry picked from commit e4d45dc)
Signed-off-by: stonezdj <stonezdj@gmail.com>
(cherry picked from commit 9c9f1bc)
@stonezdj
stonezdj force-pushed the backport-pr-22153-to-2.15.0 branch from da43fe5 to a4252d2 Compare April 8, 2026 03:07
@stonezdj
stonezdj merged commit 3e57cea into goharbor:release-2.15.0 Apr 8, 2026
12 checks passed
bupd added a commit to container-registry/harbor-next that referenced this pull request Apr 10, 2026
…oxy cache

Return locally cached artifacts when the remote registry returns not found, instead of propagating the error and failing the pull.

Upstream: goharbor/harbor#23049

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
Signed-off-by: stonezdj <stonezdj@gmail.com>
Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
bupd added a commit to container-registry/harbor-next that referenced this pull request Apr 10, 2026
…oxy cache

Return locally cached artifacts when the remote registry returns not found, instead of propagating the error and failing the pull.

Upstream: goharbor/harbor#23049

Signed-off-by: AYDEV-FR <aymeric.deliencourt@aydev.fr>
Signed-off-by: stonezdj <stonezdj@gmail.com>
Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
flbla pushed a commit to goharbor/terraform-provider-harbor that referenced this pull request Jun 4, 2026
…ects (#604)

## What changed

- Added `proxy_cache_local_on_not_found` boolean attribute to the
`harbor_project` resource
- When enabled, Harbor serves images from the local cache if they have
been removed from the upstream registry
- Validation ensures the option can only be set on proxy cache projects
(i.e. when `registry_id` is set)

## Why it changed

Harbor v2.15.1 introduced this capability via
[goharbor/harbor#23049](goharbor/harbor@3e57cea).
This adds Terraform support for the new project metadata field
`proxy_cache_local_on_not_found`.

## How to test it

1. Configure a proxy cache project with a registry:
   ```hcl
   resource "harbor_project" "proxy" {
     name        = "proxy-test"
     registry_id = harbor_registry.main.registry_id

     proxy_cache_local_on_not_found = true
   }
   ```
2. Apply and verify the project metadata in Harbor UI or via the API
(`GET /projects/{id}`) — `proxy_cache_local_on_not_found` should be
`"true"`.
3. Verify that setting `proxy_cache_local_on_not_found = true` without
`registry_id` produces a plan-time error.

> **Requires Harbor v2.15.1 or above.**

---
<sub>The changes and/or the PR description has been generated with the
help of OpenCode.</sub>

Signed-off-by: Kai Timmer <kai@staffbase.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants