mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 13:27:16 +00:00
parseStartResponse decodes a JSON bootstrap response into the deprecated three-field client.BootstrapParams, so every other field of BootstrapResult is silently discarded. This is reached when reloading a bundle: writeBootstrapParams stores bootstrap.json with encoding/json, and readBootstrapParams parses it back through here. It matters once BootstrapResult carries extensions, because a container joining an existing sandbox shim recovers that shim's result from bootstrap.json rather than from a fresh shim start, and so would have seen none of them. Decode into BootstrapResult instead. The stored format does not change and neither reader nor writer changes what it produces; encoding/json already round-trips every field, including extensions, whose Any is an opaque type URL and byte slice to it and so needs no type resolution, and including a capability value this version of containerd does not define, which must survive rather than being silently dropped. This also removes the last use of the deprecated client.BootstrapParams. Also fix TestRestoreBootstrapParams, which compared protobuf messages with reflect-based deep equality. That is not sound, as generated types carry internal state that varies with how the message was built. Signed-off-by: Derek McGowan <derek@mcg.dev>