From 3f8107114379df8fdbbf5b3ac5333ffb0af32a38 Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Mon, 31 Oct 2022 15:19:50 +1100 Subject: [PATCH] enable copy.Image's optimisation for cases where the destination image already exists (#2501) --- pkg/mirror/mirror.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/mirror/mirror.go b/pkg/mirror/mirror.go index 3daa5890f..11e80ae80 100644 --- a/pkg/mirror/mirror.go +++ b/pkg/mirror/mirror.go @@ -45,6 +45,11 @@ func Copy(ctx context.Context, dstreference, srcreference string, dstauth, srcau DestinationCtx: &types.SystemContext{ DockerAuthConfig: dstauth, }, + // Images that we mirror shouldn't change, so we can use the + // optimisation that checks if the source and destination manifests are + // equal before attempting to push it (and sending no blobs because + // they're all already there) + OptimizeDestinationImageAlreadyExists: true, }) return err