mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
distribution: pusher.push(): don't use APIEndpoint.Mirror field
Unlike the equivalent for pulling images, [Service.LookupPushEndpoints] never returns mirror endpoints, as it calls [Service.lookupV2Endpoints] with "includeMirrors=false", so we should not use this field, and unconditionally handle errors without the additional fallbacks that we consider for pulling images from a mirror. [Service.LookupPushEndpoints]:cea56c1d9c/registry/service.go (L134-L139)[Service.lookupV2Endpoints]:cea56c1d9c/registry/service_v2.go (L10-L40)Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -82,7 +82,8 @@ func (p *pusher) push(ctx context.Context) (err error) {
|
||||
}
|
||||
|
||||
if err = p.pushRepository(ctx); err != nil {
|
||||
if continueOnError(err, p.endpoint.Mirror) {
|
||||
// [Service.LookupPushEndpoints] never returns mirror endpoint.
|
||||
if continueOnError(err, false) {
|
||||
return fallbackError{
|
||||
err: err,
|
||||
transportOK: true,
|
||||
|
||||
Reference in New Issue
Block a user