mirror of
https://github.com/harness/drone.git
synced 2025-05-19 02:20:03 +08:00
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
This commit is contained in:
parent
285cb1b9ba
commit
4ff47b0c41
@ -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.SetRepoKey(registry.Name)
|
||||||
art.ParentID = registry.ParentID
|
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)
|
headers, desc, man, e := a.(Registry).ManifestExist(ctx, art, acceptHeaders, ifNoneMatchHeader)
|
||||||
response := &GetManifestResponse{e, headers, desc, man}
|
response := &GetManifestResponse{e, headers, desc, man}
|
||||||
return response
|
return response
|
||||||
@ -198,9 +200,11 @@ func (c *Controller) PullManifest(
|
|||||||
Errors: []error{errcode.ErrCodeDenied},
|
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.SetRepoKey(registry.Name)
|
||||||
art.ParentID = registry.ParentID
|
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)
|
headers, desc, man, e := a.(Registry).PullManifest(ctx, art, acceptHeaders, ifNoneMatchHeader)
|
||||||
response := &GetManifestResponse{e, headers, desc, man}
|
response := &GetManifestResponse{e, headers, desc, man}
|
||||||
return response
|
return response
|
||||||
@ -268,9 +272,10 @@ func (c *Controller) GetBlob(ctx context.Context, info pkg.RegistryInfo) Respons
|
|||||||
Errors: []error{errcode.ErrCodeDenied},
|
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.SetRepoKey(registry.Name)
|
||||||
info.ParentID = registry.ParentID
|
info.ParentID = registry.ParentID
|
||||||
|
info.Image = imageName
|
||||||
headers, body, size, readCloser, redirectURL, errs := a.(Registry).GetBlob(ctx, info)
|
headers, body, size, readCloser, redirectURL, errs := a.(Registry).GetBlob(ctx, info)
|
||||||
return &GetBlobResponse{errs, headers, body, size, readCloser, redirectURL}
|
return &GetBlobResponse{errs, headers, body, size, readCloser, redirectURL}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user