Skip to content

Conversation

@mtrmac
Copy link
Contributor

@mtrmac mtrmac commented Nov 29, 2025

@lsm5 I’m thinking something vaguely like this will be necessary to support #375 (comment) , depending on users’ desires:

  • copy must write sha512
  • copy should write sha512 if at all possible
  • copy should write sha512 if it does not cost performance
  • vs. copy must not change existing image (because it is signed or --preserve-digests)

I don’t know whether we want to expose all of these options to users, but I do think we must make the algorithm choice based on source image+cannotModify…+user options, and this might be a possible way to structure that.

Warning: c/image/copy continues to make assumptions that would be broken by changing a digest algorithm during copy. This is unusable as is. I didn’t run the code at all.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This is:
- UNUSABLE
- INCOMPLETE (manifest digests, TryReusingBlob, ...)
- BROKEN (various code assumes that digest returned from upload matches input)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@github-actions github-actions bot added the image Related to "image" package label Nov 29, 2025
// Situation records the context in which a digest is being chosen.
type Situation struct {
Preexisting digest.Digest // If not "", a pre-existing digest value (frequently one which is cheaper to use than others)
CannotChangeAlgorithm bool // If true, (Preexisting != "") and that value must not be replaced.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably …Reason string for better error messages

podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Nov 29, 2025
@podmanbot
Copy link

✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

image Related to "image" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants