Skip to content

Select the task API version from the shim bootstrap params - #8

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
chelnak:fix/honor-bootstrap-params-version
Jul 28, 2026
Merged

Select the task API version from the shim bootstrap params#8
dmcgowan merged 1 commit into
containerd:mainfrom
chelnak:fix/honor-bootstrap-params-version

Conversation

@chelnak

@chelnak chelnak commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The harness parses the version out of the shim start bootstrap params and then dials containerd.task.v3.Task unconditionally, so a version 2 shim that containerd itself would happily drive over the v2 task service fails every test with /containerd.task.v3.Task/Create does not exist.

This selects the client the way containerd does (core/runtime/v2.NewTaskClient): version 3 dials the v3 service, version 2 goes through the v2 bridge. A params payload without a version is treated as version 2 (containerd parity), and unsupported versions fail fast at startShim.

Also passes TTRPC_ADDRESS to the shim delete subcommand, matching containerd dead-shim cleanup (core/runtime/v2/binary.go): some shims read it during bootstrap and fail the delete without it.

Found while driving shimtest against a rust-extensions-based shim, which registers only the v2 task service and declares version 2 in its bootstrap params. With this change the full run suite passes against it (Windows host); the runc shim (v3) path is unchanged, verified by the client selection reducing to the previous behaviour for version 3.

The harness parsed the version out of the shim start bootstrap params
and then dialed containerd.task.v3.Task unconditionally, so a version 2
shim that containerd itself would happily drive over the v2 task
service failed every test with "/containerd.task.v3.Task/Create does
not exist".

Select the client the way containerd does (core/runtime/v2
NewTaskClient): version 3 dials the v3 service, version 2 goes through
the v2 bridge. A params payload without a version is treated as
version 2, and unsupported versions fail fast at startShim.

Also pass TTRPC_ADDRESS to the shim delete subcommand, matching
containerd dead-shim cleanup: some shims (containerd/rust-extensions
based ones unconditionally) read it during bootstrap and fail the
delete without it.

Found driving shimtest against a rust-extensions based shim, which
registers only the v2 task service and declares version 2.

Signed-off-by: Craig Gumbley <craiggumbley@gmail.com>
@dmcgowan
dmcgowan merged commit 4be8d12 into containerd:main Jul 28, 2026
5 of 6 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