Skip to content

daemon/controller: check resolved content digest - #167

Merged
alicefr merged 1 commit into
bootc-dev:mainfrom
alicefr:fix-digest
Sep 15, 2026
Merged

alicefr merged 1 commit into
bootc-dev:mainfrom
alicefr:fix-digest

Conversation

@alicefr

@alicefr alicefr commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

When bootc pulls a multi-arch image, the pullspec carries the manifest-list digest while bootc resolves and reports a platform-specific content digest. These two digests differ because a manifest list is an index pointing to per-platform manifests.

Previously, the code only compared ImageDigest (the platform-specific digest) against the target. When the target was a manifest-list digest, they would never match, causing the controller to consider nodes not up-to-date even though they were running the correct image.

Introduce image.InfoMatchesDigest() which accepts either digest as a match: the resolved content digest in ImageDigest, or the manifest-list digest embedded in the Image pullspec.

For example, on EKS bootc status shows:

Image: ...@sha256:ff63b... (manifest-list digest)
Digest: sha256:db1b41... (platform-specific content digest)

Both must be accepted as a match.

@alicefr

alicefr commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

@HarshwardhanPatil07 PTAL

@Johan-Liebert1

Copy link
Copy Markdown
Member

When the target was a manifest-list digest, they would never match

when would this happen? I'm not aware of any path in bootc that would record the manifest list digest

@alicefr

alicefr commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

When the target was a manifest-list digest, they would never match

when would this happen? I'm not aware of any path in bootc that would record the manifest list digest

I have experienced this in EKS, bootc was reporting another digest then the remote one. With this patch, I have been able to test correctly the bootc-operator.

@Johan-Liebert1

Copy link
Copy Markdown
Member

For example, on EKS bootc status shows:
Image: ...@sha256:ff63b... (manifest-list digest)
Digest: sha256:db1b41... (platform-specific content digest)

iiuc seems like the digest is still the platform specific one, but the image shows manifest list digest and not the image name, which is okay right?

@alicefr

alicefr commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

The Digest field (ImageDigest in the API) is the platform-specific content digest that bootc resolved, and
the Image field carries the original pullspec which includes the manifest-list digest. Both are correct.

The problem was in the comparison logic: when the BootcPool target is specified as a manifest-list digest (e.g. from a
multi-arch registry tag), the old code only compared against ImageDigest (the platform-specific one). Since the
manifest-list digest and the platform-specific digest are inherently different, the comparison would never match, making the controller think the node wasn't up-to-date.

The fix (InfoMatchesDigest) accepts either digest as a valid match: first it checks ImageDigest, and if that doesn't match, it extracts the digest from the Image pullspec and checks that too.

When bootc pulls a multi-arch image, the pullspec carries the
manifest-list digest while bootc resolves and reports a
platform-specific content digest. These two digests differ because
a manifest list is an index pointing to per-platform manifests.

Previously, the code only compared ImageDigest (the platform-specific
digest) against the target. When the target was a manifest-list digest,
they would never match, causing the controller to consider nodes
not up-to-date even though they were running the correct image.

Introduce image.InfoMatchesDigest() which accepts either digest as
a match: the resolved content digest in ImageDigest, or the
manifest-list digest embedded in the Image pullspec.

For example, on EKS `bootc status` shows:

  Image: ...@sha256:ff63b... (manifest-list digest)
  Digest: sha256:db1b41... (platform-specific content digest)

Both must be accepted as a match.

Assisted-by: AI
Signed-off-by: Alice Frosi <afrosi@redhat.com>

@Johan-Liebert1 Johan-Liebert1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Still feels like there's something here that we're doing wrong. If the issue is "When operator fetches an image update/switch (gets the manifest list digest) and tries to match with bootc status and the match fails", then I think the operator should get the architecture specific digest to compare.

Since we run as a daemon, we should have access to the host architecture.

To unblock testing, this is fine for now, but I think we should give this a second thought

@alicefr

alicefr commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator Author

Still feels like there's something here that we're doing wrong. If the issue is "When operator fetches an image update/switch (gets the manifest list digest) and tries to match with bootc status and the match fails", then I think the operator should get the architecture specific digest to compare.

Since we run as a daemon, we should have access to the host architecture.

To unblock testing, this is fine for now, but I think we should give this a second thought

I agree, maybe we were checking the wrong digest from the beginning. We always assumed that the digest from the remote image was the one that should have been reported by bootc.

@alicefr
alicefr merged commit 371df68 into bootc-dev:main Sep 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants