Skip to content

Commit

Permalink
[WIP] Fix content not found with push=true,rewrite-timestamp=true
Browse files Browse the repository at this point in the history
Fix issue 4793

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jun 9, 2024
1 parent efcde2f commit 566162a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions exporter/containerimage/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source
}
}
if e.push {
if opts.RewriteTimestamp {
annotations := map[digest.Digest]map[string]string{}
addAnnotations(annotations, *desc)
// e.pushImage cannot be used because src ref does not point to the rewritten image
//
// TODO: change e.pushImage so that it takes Result[Remote] as parameter.
// https://github.com/moby/buildkit/pull/4057#discussion_r1324106088
err = push.Push(ctx, e.opt.SessionManager, sessionID, e.opt.ImageWriter.opt.ContentStore, e.opt.ImageWriter.ContentStore(),
desc.Digest, targetName, e.insecure, e.opt.RegistryHosts, e.pushByDigest, annotations)
} else {
err = e.pushImage(ctx, src, sessionID, targetName, desc.Digest)
}
err = e.pushImage(ctx, src, sessionID, targetName, desc.Digest)
if err != nil {
return nil, nil, errors.Wrapf(err, "failed to push %v", targetName)
}
Expand Down

0 comments on commit 566162a

Please sign in to comment.