Skip to content

wire protocol: use dedicated RPC calls for all pod and container life-cycle events.#274

Draft
klihub wants to merge 4 commits intocontainerd:mainfrom
klihub:devel/dedicated-lifecycle-events
Draft

wire protocol: use dedicated RPC calls for all pod and container life-cycle events.#274
klihub wants to merge 4 commits intocontainerd:mainfrom
klihub:devel/dedicated-lifecycle-events

Conversation

@klihub
Copy link
Member

@klihub klihub commented Feb 26, 2026

This PR updates the wire protocol/ttrpc API to have proper RPC calls and messages for all pod and container life-cycle events.

The added calls and messages replace the 'catch-most' StateChange call which is now used to relay {Run,Stop,Remove}PodSandbox pod and {PostCreate,Start,PostStart, PostUpdate,Remove} container events using a single 'event type + field union' message on the wire. The visible stub/plugin and runtime adaptation interfaces are unaffected. The PR leaves StateChange in the protocol to allow transparent backward compatibility, and updates the runtime adaptation to fall back to using StateChange if the plugin side NRI version does not implement the new RPC calls yet.

This has been attempted a few times earlier in connection with other changes, but since we've had multiple other real functional changes in flight, we always shied away from the resulting rebase conflicts and seeing this through. This time this is a self-contained PR with no other functional changes.

Although functionally straightforward, it's still painfully intrusive as it touches a lot of boilerplate. Currently we have 3 remaining PRs open which touch the protocol and will conflict: #166 (memory policy adjustment), #183 (plugin authentication), and #271 (version exchange). Of these #166 and #217 are probably small footprint enough to be fairly easily rebases (either way around).

Here are my updated runtime test trees with these changes included:

Define dedicated RPC calls on the wire for all pod lifecycle events.
Update stub, builtin and WASM plugins accordingly.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub klihub requested a review from samuelkarp February 26, 2026 07:43
Define dedicated RPC calls on the wire for all container lifecycle
events. Update stub, builtin and WASM plugins accordingly.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update to use the new dedicated RPC calls to relay all pod and
container lifecycle events to plugins. Remove old StateChange
which used to multiplex {Run,PostUpdate,Stop,Remove}PodSandbox
pod and {PostCreate,Start,PostStart,PostUpdate,Remove}Container
container events.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add a backward compatibility wrapper for old plugins which do not
support the full set of dedicated lifecycle events yet. Fall back
to relaying StateChange events to them.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
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.

1 participant