Skip to content

cri: Use the runtimeHandler parameter in PullImage#12710

Merged
mikebrow merged 1 commit intocontainerd:mainfrom
fidencio:fix-snapshotter-per-runtime-handler
Dec 22, 2025
Merged

cri: Use the runtimeHandler parameter in PullImage#12710
mikebrow merged 1 commit intocontainerd:mainfrom
fidencio:fix-snapshotter-per-runtime-handler

Conversation

@fidencio
Copy link
Copy Markdown
Contributor

@fidencio fidencio commented Dec 19, 2025

The runtimeHandler parameter was added to PullImage() but never used.
Instead, the code relied on an experimental annotation
(io.containerd.cri.runtime-handler) passed in the pod sandbox config.

This annotation was a workaround because CRI's PullImageRequest didn't
include the runtime handler. However, since cri-api v0.29.0, the runtime
handler is available in the API and passed as a parameter to PullImage().

For backward compatibility with CRI clients that don't yet pass the
runtime handler parameter, we fall back to the annotation if the
parameter is empty. The annotation-based fallback is deprecated and
will be removed in containerd 2.5.

cc @kiashok @mxpv @mikebrow @fuweid @zvonkok @danmihai1 @skaegi

@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Dec 19, 2025
@dosubot dosubot Bot added the area/cri Container Runtime Interface (CRI) label Dec 19, 2025
@aadhar-agarwal
Copy link
Copy Markdown
Contributor

Just curious, should annotations.RuntimeHandler be deprecated/removed now?

@fidencio
Copy link
Copy Markdown
Contributor Author

Just curious, should annotations.RuntimeHandler be deprecated/removed now?

I think it could, I'd be more than happy to do so in a different PR after I'm back from vacation. :-)

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

Thanks for taking this TODO on.. see comments

Comment thread internal/cri/server/images/image_pull.go
Comment thread internal/cri/server/images/image_pull.go
The runtimeHandler parameter was added to PullImage() but never used.
Instead, the code relied on an experimental annotation
(io.containerd.cri.runtime-handler) passed in the pod sandbox config.

This annotation was a workaround because CRI's PullImageRequest didn't
include the runtime handler. However, since cri-api v0.29.0, the runtime
handler is available in the API and passed as a parameter to PullImage().

For backward compatibility with CRI clients that don't yet pass the
runtime handler parameter, we fall back to the annotation if the
parameter is empty. The annotation-based fallback is deprecated and
will be removed in containerd 2.5.

Signed-off-by: Wedson Almeida Filho <[email protected]>
Signed-off-by: Fabiano Fidêncio <[email protected]>
@fidencio fidencio force-pushed the fix-snapshotter-per-runtime-handler branch from 10dd87d to b8ae041 Compare December 20, 2025 00:28
@fidencio
Copy link
Copy Markdown
Contributor Author

fidencio commented Dec 20, 2025

@mikebrow, just adjusted the PR and made a note about deprecating the annotation in 2.5 (so it gives enough time for other clients to adjust). Please, give it a second pass.

Also, as this does not break any backwards compat, it'd be nice to have it backported to 2.2 (which seems to be the new LTS?).

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Dec 20, 2025
@mikebrow mikebrow added the cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch label Dec 20, 2025
Copy link
Copy Markdown
Member

@ChengyuZhu6 ChengyuZhu6 left a comment

Choose a reason for hiding this comment

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

Good work! LGTM

@mikebrow mikebrow added this pull request to the merge queue Dec 22, 2025
Merged via the queue into containerd:main with commit cdc828f Dec 22, 2025
52 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Dec 22, 2025
@mikebrow
Copy link
Copy Markdown
Member

/cherrypick release/2.2

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mikebrow: new pull request created: #12721

Details

In response to this:

/cherrypick release/2.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mikebrow mikebrow added cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch and removed cherry-pick/2.2.x Change to be cherry picked to release/2.2 branch labels Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch size/M

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants