feat: [AH-932]: fix issue with pulling upstream artifacts when added after docker hub proxy (#3507)

* feat: [AH-932]: fix issue with pulling upstream artifacts when added after docker hub proxy
* feat: [AH-932]: fix issue with pulling upstream artifacts when added after docker hub proxy
* feat: [AH-932]: fix issue with pulling upstream artifacts when added after docker hub proxy
try-new-ui
Shivanand Sonnad 2025-03-05 13:52:43 +00:00 committed by Harness
parent 285cb1b9ba
commit 4ff47b0c41
1 changed files with 8 additions and 3 deletions

View File

@ -171,9 +171,11 @@ func (c *Controller) HeadManifest(
}
}
f := func(registry registrytypes.Registry, _ string, a pkg.Artifact) Response {
f := func(registry registrytypes.Registry, imageName string, a pkg.Artifact) Response {
art.SetRepoKey(registry.Name)
art.ParentID = registry.ParentID
// Need to reassign original imageName to art because we are updating image name based on upstream proxy source inside
art.Image = imageName
headers, desc, man, e := a.(Registry).ManifestExist(ctx, art, acceptHeaders, ifNoneMatchHeader)
response := &GetManifestResponse{e, headers, desc, man}
return response
@ -198,9 +200,11 @@ func (c *Controller) PullManifest(
Errors: []error{errcode.ErrCodeDenied},
}
}
f := func(registry registrytypes.Registry, _ string, a pkg.Artifact) Response {
f := func(registry registrytypes.Registry, imageName string, a pkg.Artifact) Response {
art.SetRepoKey(registry.Name)
art.ParentID = registry.ParentID
// Need to reassign original imageName to art because we are updating image name based on upstream proxy source inside
art.Image = imageName
headers, desc, man, e := a.(Registry).PullManifest(ctx, art, acceptHeaders, ifNoneMatchHeader)
response := &GetManifestResponse{e, headers, desc, man}
return response
@ -268,9 +272,10 @@ func (c *Controller) GetBlob(ctx context.Context, info pkg.RegistryInfo) Respons
Errors: []error{errcode.ErrCodeDenied},
}
}
f := func(registry registrytypes.Registry, _ string, a pkg.Artifact) Response {
f := func(registry registrytypes.Registry, imageName string, a pkg.Artifact) Response {
info.SetRepoKey(registry.Name)
info.ParentID = registry.ParentID
info.Image = imageName
headers, body, size, readCloser, redirectURL, errs := a.(Registry).GetBlob(ctx, info)
return &GetBlobResponse{errs, headers, body, size, readCloser, redirectURL}
}