Skip to content

image ID consistency test#2004

Merged
saschagrunert merged 1 commit into
kubernetes-sigs:masterfrom
SergeyKanzhelev:imageidconsistency
Mar 12, 2026
Merged

image ID consistency test#2004
saschagrunert merged 1 commit into
kubernetes-sigs:masterfrom
SergeyKanzhelev:imageidconsistency

Conversation

@SergeyKanzhelev

Copy link
Copy Markdown
Member

What type of PR is this?

/kind cleanup
/kind feature

What this PR does / why we need it:

Confirming what is imlpemented out of kubernetes/kubernetes#137574

Special notes for your reviewer:

On containerd locally:

------------------------------
[k8s.io] Image Identifier Consistency
sigs.k8s.io/cri-tools/pkg/framework/framework.go:72
  should return the same image identifier across all APIs [Conformance] [Serial]
  sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:48
  > Enter [BeforeEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/framework/framework.go:49 @ 03/09/26 17:32:05.873
  < Exit [BeforeEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/framework/framework.go:49 @ 03/09/26 17:32:05.877 (4ms)
  > Enter [BeforeEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:36 @ 03/09/26 17:32:05.877
  < Exit [BeforeEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:36 @ 03/09/26 17:32:05.877 (0s)
  > Enter [It] should return the same image identifier across all APIs [Conformance] - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:48 @ 03/09/26 17:32:05.877
  STEP: Pulling image: gcr.io/k8s-staging-cri-tools/test-image-tag:test - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:51 @ 03/09/26 17:32:05.877
  STEP: Pull image : gcr.io/k8s-staging-cri-tools/test-image-tag:test - sigs.k8s.io/cri-tools/pkg/framework/util.go:385 @ 03/09/26 17:32:05.877
  Mar  9 17:32:06.614: INFO: PullImageResponse.image_ref: "sha256:00a99e91400bb2195e38a1459084a882f228ab1e0929c7bc80c64c0496dd4c69"
  STEP: Checking ImageStatus - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:58 @ 03/09/26 17:32:06.614
  STEP: Get image status for image: gcr.io/k8s-staging-cri-tools/test-image-tag:test - sigs.k8s.io/cri-tools/pkg/framework/util.go:333 @ 03/09/26 17:32:06.614
  Mar  9 17:32:06.617: INFO: Image.id: "sha256:00a99e91400bb2195e38a1459084a882f228ab1e0929c7bc80c64c0496dd4c69"
  Mar  9 17:32:06.617: INFO: Image.repo_tags: [gcr.io/k8s-staging-cri-tools/test-image-tag:test]
  Mar  9 17:32:06.617: INFO: Image.repo_digests: [gcr.io/k8s-staging-cri-tools/test-image-tag@sha256:c415397c3b25f6750ba4869945222cb3f6602330fbc9c907185f03418671ad92]
  STEP: Creating a pod sandbox - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:65 @ 03/09/26 17:32:06.617
  STEP: Creating and starting a container - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:72 @ 03/09/26 17:32:06.9
  STEP: Collecting identifiers from all APIs - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:91 @ 03/09/26 17:32:07.073
  Mar  9 17:32:07.074: INFO: ContainerStatus.image_id: ""
  Mar  9 17:32:07.074: INFO: ContainerStatus.image_ref (legacy): "gcr.io/k8s-staging-cri-tools/test-image-tag@sha256:c415397c3b25f6750ba4869945222cb3f6602330fbc9c907185f03418671ad92"
  Mar  9 17:32:07.075: INFO: Container.image_id: ""
  STEP: Verifying consistency - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:106 @ 03/09/26 17:32:07.075
  STEP: Remove image : gcr.io/k8s-staging-cri-tools/test-image-tag:test - sigs.k8s.io/cri-tools/pkg/validate/image.go:352 @ 03/09/26 17:32:07.36
  STEP: Remove image by ID : sha256:00a99e91400bb2195e38a1459084a882f228ab1e0929c7bc80c64c0496dd4c69 - sigs.k8s.io/cri-tools/pkg/validate/image.go:357 @ 03/09/26 17:32:07.361
  < Exit [It] should return the same image identifier across all APIs [Conformance] - sigs.k8s.io/cri-tools/pkg/validate/image_id_consistency.go:48 @ 03/09/26 17:32:07.405 (1.528s)
  > Enter [AfterEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/framework/framework.go:50 @ 03/09/26 17:32:07.405
  < Exit [AfterEach] [k8s.io] Image Identifier Consistency - sigs.k8s.io/cri-tools/pkg/framework/framework.go:50 @ 03/09/26 17:32:07.405 (0s)
• [1.533 seconds]

Does this PR introduce a user-facing change?

CRI API image id and image ref consistency tests are added to critest

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. labels Mar 9, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 9, 2026
Comment thread pkg/validate/image_id_consistency.go
@SergeyKanzhelev

Copy link
Copy Markdown
Member Author

this is OK to merge, we will need to follow up with more later once containerd is updated

@stlaz stlaz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think we realized how flexible the CRI API was and that we can enforce what we intended for the PullImageResponse.image_id way, and so these changes LGTM.

imageName := testImageWithTag

By("Pulling image: " + imageName)
imageRef := framework.PullPublicImage(ic, imageName, testImagePodSandbox)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: while the underlying implementation will only hardly change, it would make sense to show that the results come directly from the ic methods rather than from the framework wrappers.

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.

hm, I can add a comment. But I don't want to change how we write tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2026
@stlaz

stlaz commented Mar 10, 2026

Copy link
Copy Markdown

We will have to document in k8s docs which versions of container runtimes are compatible with the feature, and how to onboard from an incompatible version to a compatible one.

What is the plan with this new test - is it aiming for k8s 1.36.0 or will it be tagged for 1.35.x version, too?

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Mar 10, 2026
@haircommander

Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, SergeyKanzhelev, stlaz

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2026
@saschagrunert
saschagrunert merged commit 4dcca56 into kubernetes-sigs:master Mar 12, 2026
34 of 37 checks passed
@SergeyKanzhelev
SergeyKanzhelev deleted the imageidconsistency branch March 12, 2026 17:51
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants