Skip to content

fix: resolve manifest list digest instead of platform-specific digest#3611

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/multi-arch-digest-resolution
Jun 30, 2026
Merged

fix: resolve manifest list digest instead of platform-specific digest#3611
tekton-robot merged 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/multi-arch-digest-resolution

Conversation

@ab-ghosh

Copy link
Copy Markdown
Member

Changes

Fix get_image_sha() in hack/openshift/update-image-sha.sh to resolve the manifest list digest instead of a platform-specific digest.
The function was using .manifests[0].digest which picks the first platform entry (amd64), causing the operator CSV to pin task images (buildah, s2i, skopeo,ubi-minimal) to amd64-only digests. This breaks ARM64/multi-arch clusters with exec format error.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Jun 29, 2026
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 29, 2026
@pratap0007

Copy link
Copy Markdown
Contributor

/retest

3 similar comments
@pratap0007

Copy link
Copy Markdown
Contributor

/retest

@pratap0007

Copy link
Copy Markdown
Contributor

/retest

@jkhelil

jkhelil commented Jun 30, 2026

Copy link
Copy Markdown
Member

/retest

@ab-ghosh ab-ghosh force-pushed the fix/multi-arch-digest-resolution branch from 1c55e9d to 5936721 Compare June 30, 2026 08:00
@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2026
Comment thread hack/openshift/update-image-sha.sh Outdated
}

# Get SHA digest for an image:tag
# Get manifest list SHA digest for an image:tag (multi-arch)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll suggest to also change the function name. It's no longer obtaining an image SHA. Instead it's generating SHA from some text input.
Another thing is that the function can return different SHA even if the image hasn't changed (extra white spaces, order of json map etc.). So instead, you can pin on the top level manifest digest, e.g.: skopeo inspect docker://quay.io/enatan/jenkins2tekton:latest | jq -r '.Digest' . Here is also what AI tells me:
To support multi-arch clusters, your Operator CSV must pin to the top-level Manifest List Digest (sometimes called an index digest).
When you point Kubernetes to a multi-arch digest, the container runtime on each node (cri-o or containerd) automatically inspects the list, matches its own native CPU architecture (amd64 or arm64), and pulls the correct underlying layer.

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.

skopeo inspect does not return .Digest
I have comment a different solution for the same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. Updated and renamed to get_manifest_list_digest and using skopeo inspect | jq -r '.Digest'.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pramodbindal i tested it locally and it gives the manifest list digest not sure if i am missing anything

Comment thread hack/openshift/update-image-sha.sh Outdated
get_image_sha() {
local image_url=$1
skopeo inspect --raw docker://${image_url} | jq -r '.manifests[0].digest // .digest'
skopeo inspect --raw docker://${image_url} | sha256sum | awk '{print "sha256:"$1}'

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.

This method of calculating manifest digest is not guaranteed to match with registered digest.

Can you try something like this

docker buildx imagetools inspect \
  registry.redhat.io/rhel9/postgresql-15:latest \
  --format '{{json .Manifest}}'

This command gives output like this

sha256:0b2579cba0fd9f1754c2c9515d5f873f45de009cf044ce950284dbd1a4e6f10c

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.

docker buildx imagetools inspect registry.redhat.io/rhel9/postgresql-15:latest --format '{{json .Manifest}}' | jq -r .digest

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.

}bash-5.3$ docker buildx imagetools inspect registry.redhat.io/rhel9/postgresql-15:latest --format '{{json .Manifest.Digest}}'

This command also worked for me

  The get_image_sha() function was using .manifests[0].digest which
  returns the first platform entry (amd64) instead of the manifest list
  digest. This causes the operator CSV to pin task images (buildah, s2i,
  skopeo, ubi-minimal) to amd64-only digests, breaking ARM64 and
  multi-arch clusters with exec format error.

  Fix by computing sha256 of the raw manifest list content, which
  produces the manifest list digest that container runtimes use to
  resolve the correct platform at pull time.

Signed-off-by: ab-ghosh <abghosh@redhat.com>
@ab-ghosh ab-ghosh force-pushed the fix/multi-arch-digest-resolution branch from 5936721 to 98b7967 Compare June 30, 2026 11:08
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2026
get_manifest_list_digest() {
local image_url=$1
skopeo inspect --raw docker://${image_url} | jq -r '.manifests[0].digest // .digest'
skopeo inspect --no-tags docker://${image_url} | jq -r '.Digest'

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.

This will again return the platform specific digest only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pramodbindal I do not think that's correct. It returns the manifest digest, not specific image (arch one).

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.

skopeo inspect (without --raw) returns the digest matching with host system platform. thats the reason spoke inspect does not work on my machine as it expects darwin/arm64

@enarha

enarha commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2026
@enarha

enarha commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@ab-ghosh if you still prefer to use the raw data as stored in the registry, you can also use something like skopeo manifest-digest <(skopeo inspect --raw docker://quay.io/enatan/jenkins2tekton:latest). I'm OK with either option.

@pramodbindal

Copy link
Copy Markdown
Member

/approve

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pramodbindal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2026
@tekton-robot tekton-robot merged commit b85bd96 into tektoncd:main Jun 30, 2026
16 checks passed
@pramodbindal

Copy link
Copy Markdown
Member

/cherry-pick release-v0.78.x release-v0.79.x release-v0.80.x

@tekton-robot

Copy link
Copy Markdown
Contributor

Cherry-pick to release-v0.79.x successful!

A new pull request has been created to cherry-pick this change to release-v0.79.x.

PR: #3636

Please review and merge the cherry-pick PR.

@tekton-robot

Copy link
Copy Markdown
Contributor

Cherry-pick to release-v0.80.x successful!

A new pull request has been created to cherry-pick this change to release-v0.80.x.

PR: #3637

Please review and merge the cherry-pick PR.

@tekton-robot

Copy link
Copy Markdown
Contributor

Cherry-pick to release-v0.78.x successful!

A new pull request has been created to cherry-pick this change to release-v0.78.x.

PR: #3638

Please review and merge the cherry-pick PR.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants