You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
imagetools: avoid pushing to same repo in parallel
If multiple tags are specified for the same repo, it is
wasteful to use them as separate targets and better to
make them share the blob upload phase of the push.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 917d7f2)
sub.Log(1, fmt.Appendf(nil, "copying %s from %s to %s\n", desc.Digest.String(), desc.Source.Ref.String(), t.String()))
218
+
sub.Log(1, fmt.Appendf(nil, "copying %s from %s to %s\n", desc.Digest.String(), desc.Source.Ref.String(), repo))
212
219
returnr.Copy(ctx, &imagetools.Source{
213
220
Ref: desc.Source.Ref,
214
221
Desc: desc.Descriptor,
215
-
}, t)
222
+
}, seed)
216
223
})
217
224
}
218
225
iferr:=eg2.Wait(); err!=nil {
219
226
returnerr
220
227
}
221
228
ctx=withMediaTypeKeyPrefix(ctx) // because of containerd bug this needs to be called separately for each ctx/goroutine pair to avoid concurrent map write
222
-
sub.Log(1, fmt.Appendf(nil, "pushing %s to %s\n", desc.Digest.String(), t.String()))
223
-
returnr.Push(ctx, t, desc, dt)
229
+
for_, t:=rangerepoTags {
230
+
sub.Log(1, fmt.Appendf(nil, "pushing %s to %s\n", desc.Digest.String(), t.String()))
0 commit comments