Update vendor

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2026-01-23 16:11:41 -08:00
committed by Mike Brown
parent 7f39b2d933
commit e72145b192
7 changed files with 779 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ require (
github.com/containerd/ttrpc v1.2.5
github.com/containerd/typeurl/v2 v2.1.1
github.com/opencontainers/image-spec v1.1.1
github.com/stretchr/testify v1.8.2
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217
google.golang.org/grpc v1.79.3
google.golang.org/protobuf v1.36.10
@@ -13,8 +14,10 @@ require (
require (
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect

View File

@@ -36,7 +36,11 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -95,6 +99,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@@ -0,0 +1,577 @@
//
//Copyright The containerd Authors.
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
// Bootstrap Protocol
//
// This protocol defines the interface between containerd and shims at startup.
// It replaces the previous scattered configuration mechanisms (CLI args, env vars,
// stdin JSON, spec.json annotations) with a single, versioned, extensible protocol.
//
// Flow:
// 1. containerd spawns the shim process
// 2. containerd writes BootstrapParams as JSON to shim's stdin
// 3. shim initializes and writes BootstrapResult as JSON to stdout
// 4. containerd connects to the address provided in BootstrapResult
//
// Note: JSON serialization is used to keep shim binaries small since the
// encoding/json package is already part of the Go runtime. The proto
// definition serves as the schema for detecting breaking changes and
// maintaining forward/backward compatibility.
//
// This design enables:
// - Forward/backward compatibility via version field
// - Typed extensibility via google.protobuf.Any and Extension
// - Clear capability negotiation between containerd and shims
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc (unknown)
// source: runtime/boot/v1/bootstrap.proto
package bootstrap
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// BootstrapParams contains all configuration passed from containerd to shim at startup.
type BootstrapParams struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Container/sandbox ID
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Namespace for the container
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
// Enable debug messages in logs.
EnableDebug bool `protobuf:"varint,3,opt,name=enable_debug,json=enableDebug,proto3" json:"enable_debug,omitempty"`
// Containerd's TTRPC API address (e.g., "unix:///run/containerd/containerd.sock.ttrpc")
ContainerdTtrpcAddress string `protobuf:"bytes,4,opt,name=containerd_ttrpc_address,json=containerdTtrpcAddress,proto3" json:"containerd_ttrpc_address,omitempty"`
// Containerd's gRPC API address (e.g., "unix:///run/containerd/containerd.sock")
ContainerdGrpcAddress string `protobuf:"bytes,5,opt,name=containerd_grpc_address,json=containerdGrpcAddress,proto3" json:"containerd_grpc_address,omitempty"`
// Socket path to serve.
SocketPath string `protobuf:"bytes,6,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"`
// Debug socket path to serve.
SocketPathDebug string `protobuf:"bytes,7,opt,name=socket_path_debug,json=socketPathDebug,proto3" json:"socket_path_debug,omitempty"`
// Path to containerd binary for event publishing
ContainerdBinary string `protobuf:"bytes,8,opt,name=containerd_binary,json=containerdBinary,proto3" json:"containerd_binary,omitempty"`
// Extensible configuration sections for new features
// Each section can contain arbitrary structured data identified by type URL
// Examples: CRI config, NRI config, sandbox config, etc.
Extensions []*Extension `protobuf:"bytes,9,rep,name=extensions,proto3" json:"extensions,omitempty"`
}
func (x *BootstrapParams) Reset() {
*x = BootstrapParams{}
if protoimpl.UnsafeEnabled {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BootstrapParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BootstrapParams) ProtoMessage() {}
func (x *BootstrapParams) ProtoReflect() protoreflect.Message {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BootstrapParams.ProtoReflect.Descriptor instead.
func (*BootstrapParams) Descriptor() ([]byte, []int) {
return file_runtime_boot_v1_bootstrap_proto_rawDescGZIP(), []int{0}
}
func (x *BootstrapParams) GetID() string {
if x != nil {
return x.ID
}
return ""
}
func (x *BootstrapParams) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *BootstrapParams) GetEnableDebug() bool {
if x != nil {
return x.EnableDebug
}
return false
}
func (x *BootstrapParams) GetContainerdTtrpcAddress() string {
if x != nil {
return x.ContainerdTtrpcAddress
}
return ""
}
func (x *BootstrapParams) GetContainerdGrpcAddress() string {
if x != nil {
return x.ContainerdGrpcAddress
}
return ""
}
func (x *BootstrapParams) GetSocketPath() string {
if x != nil {
return x.SocketPath
}
return ""
}
func (x *BootstrapParams) GetSocketPathDebug() string {
if x != nil {
return x.SocketPathDebug
}
return ""
}
func (x *BootstrapParams) GetContainerdBinary() string {
if x != nil {
return x.ContainerdBinary
}
return ""
}
func (x *BootstrapParams) GetExtensions() []*Extension {
if x != nil {
return x.Extensions
}
return nil
}
// Extension provides extensibility for new configuration types
// without changing the core BootstrapParams protocol
type Extension struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Configuration data with embedded type URL
// Examples of type URLs:
// - "containerd.io/cri.v1.PodSandboxConfig"
// - "containerd.io/nri.v1.PluginConfig"
// - "containerd.io/sandbox.v1.SandboxConfig"
Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *Extension) Reset() {
*x = Extension{}
if protoimpl.UnsafeEnabled {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Extension) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Extension) ProtoMessage() {}
func (x *Extension) ProtoReflect() protoreflect.Message {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Extension.ProtoReflect.Descriptor instead.
func (*Extension) Descriptor() ([]byte, []int) {
return file_runtime_boot_v1_bootstrap_proto_rawDescGZIP(), []int{1}
}
func (x *Extension) GetValue() *anypb.Any {
if x != nil {
return x.Value
}
return nil
}
// BootstrapResult is returned by shim via stdout after successful startup
type BootstrapResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Version of shim parameters (expected 2 for shim v2)
Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
// Address where shim is listening (e.g., "unix:///run/containerd/shim.sock")
// Containerd will connect to this address for task operations
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// Protocol used by shim: "ttrpc" or "grpc"
Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
// Optional: Capabilities supported by this shim instance
// Allows shim to advertise what features it supports
Capabilities []string `protobuf:"bytes,4,rep,name=capabilities,proto3" json:"capabilities,omitempty"`
// Optional: Additional metadata from shim
Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *BootstrapResult) Reset() {
*x = BootstrapResult{}
if protoimpl.UnsafeEnabled {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BootstrapResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BootstrapResult) ProtoMessage() {}
func (x *BootstrapResult) ProtoReflect() protoreflect.Message {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BootstrapResult.ProtoReflect.Descriptor instead.
func (*BootstrapResult) Descriptor() ([]byte, []int) {
return file_runtime_boot_v1_bootstrap_proto_rawDescGZIP(), []int{2}
}
func (x *BootstrapResult) GetVersion() int32 {
if x != nil {
return x.Version
}
return 0
}
func (x *BootstrapResult) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *BootstrapResult) GetProtocol() string {
if x != nil {
return x.Protocol
}
return ""
}
func (x *BootstrapResult) GetCapabilities() []string {
if x != nil {
return x.Capabilities
}
return nil
}
func (x *BootstrapResult) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
type RuncV2Extensions struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Annotations are spec annotations read from config.json.
Annotations map[string]string `protobuf:"bytes,1,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Enable core scheduling if available
SchedCore bool `protobuf:"varint,2,opt,name=sched_core,json=schedCore,proto3" json:"sched_core,omitempty"`
// Cgroup path to place the shim process into
ShimCgroup string `protobuf:"bytes,3,opt,name=shim_cgroup,json=shimCgroup,proto3" json:"shim_cgroup,omitempty"`
}
func (x *RuncV2Extensions) Reset() {
*x = RuncV2Extensions{}
if protoimpl.UnsafeEnabled {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RuncV2Extensions) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RuncV2Extensions) ProtoMessage() {}
func (x *RuncV2Extensions) ProtoReflect() protoreflect.Message {
mi := &file_runtime_boot_v1_bootstrap_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RuncV2Extensions.ProtoReflect.Descriptor instead.
func (*RuncV2Extensions) Descriptor() ([]byte, []int) {
return file_runtime_boot_v1_bootstrap_proto_rawDescGZIP(), []int{3}
}
func (x *RuncV2Extensions) GetAnnotations() map[string]string {
if x != nil {
return x.Annotations
}
return nil
}
func (x *RuncV2Extensions) GetSchedCore() bool {
if x != nil {
return x.SchedCore
}
return false
}
func (x *RuncV2Extensions) GetShimCgroup() string {
if x != nil {
return x.ShimCgroup
}
return ""
}
var File_runtime_boot_v1_bootstrap_proto protoreflect.FileDescriptor
var file_runtime_boot_v1_bootstrap_proto_rawDesc = []byte{
0x0a, 0x1f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x2f, 0x76,
0x31, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x1f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75,
0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e,
0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x03,
0x0a, 0x0f, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12,
0x21, 0x0a, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x62,
0x75, 0x67, 0x12, 0x38, 0x0a, 0x18, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
0x5f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
0x54, 0x74, 0x72, 0x70, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x17,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x5f,
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x47, 0x72, 0x70, 0x63, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x70,
0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x63, 0x6b, 0x65,
0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f,
0x70, 0x61, 0x74, 0x68, 0x5f, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x44, 0x65, 0x62, 0x75,
0x67, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x5f,
0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x4a,
0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e,
0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a,
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x37, 0x0a, 0x09, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x22, 0x9e, 0x02, 0x0a, 0x0f, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62,
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63,
0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x5a, 0x0a, 0x08, 0x6d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69,
0x6d, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e,
0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x22, 0xf8, 0x01, 0x0a, 0x10, 0x52, 0x75, 0x6e, 0x63, 0x56, 0x32, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x64, 0x0a, 0x0b, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x42,
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x74,
0x69, 0x6d, 0x65, 0x2e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x76, 0x31,
0x2e, 0x52, 0x75, 0x6e, 0x63, 0x56, 0x32, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x1f,
0x0a, 0x0b, 0x73, 0x68, 0x69, 0x6d, 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x6d, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a,
0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,
0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6f, 0x6f,
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_runtime_boot_v1_bootstrap_proto_rawDescOnce sync.Once
file_runtime_boot_v1_bootstrap_proto_rawDescData = file_runtime_boot_v1_bootstrap_proto_rawDesc
)
func file_runtime_boot_v1_bootstrap_proto_rawDescGZIP() []byte {
file_runtime_boot_v1_bootstrap_proto_rawDescOnce.Do(func() {
file_runtime_boot_v1_bootstrap_proto_rawDescData = protoimpl.X.CompressGZIP(file_runtime_boot_v1_bootstrap_proto_rawDescData)
})
return file_runtime_boot_v1_bootstrap_proto_rawDescData
}
var file_runtime_boot_v1_bootstrap_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_runtime_boot_v1_bootstrap_proto_goTypes = []interface{}{
(*BootstrapParams)(nil), // 0: containerd.runtime.bootstrap.v1.BootstrapParams
(*Extension)(nil), // 1: containerd.runtime.bootstrap.v1.Extension
(*BootstrapResult)(nil), // 2: containerd.runtime.bootstrap.v1.BootstrapResult
(*RuncV2Extensions)(nil), // 3: containerd.runtime.bootstrap.v1.RuncV2Extensions
nil, // 4: containerd.runtime.bootstrap.v1.BootstrapResult.MetadataEntry
nil, // 5: containerd.runtime.bootstrap.v1.RuncV2Extensions.AnnotationsEntry
(*anypb.Any)(nil), // 6: google.protobuf.Any
}
var file_runtime_boot_v1_bootstrap_proto_depIdxs = []int32{
1, // 0: containerd.runtime.bootstrap.v1.BootstrapParams.extensions:type_name -> containerd.runtime.bootstrap.v1.Extension
6, // 1: containerd.runtime.bootstrap.v1.Extension.value:type_name -> google.protobuf.Any
4, // 2: containerd.runtime.bootstrap.v1.BootstrapResult.metadata:type_name -> containerd.runtime.bootstrap.v1.BootstrapResult.MetadataEntry
5, // 3: containerd.runtime.bootstrap.v1.RuncV2Extensions.annotations:type_name -> containerd.runtime.bootstrap.v1.RuncV2Extensions.AnnotationsEntry
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_runtime_boot_v1_bootstrap_proto_init() }
func file_runtime_boot_v1_bootstrap_proto_init() {
if File_runtime_boot_v1_bootstrap_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_runtime_boot_v1_bootstrap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BootstrapParams); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_runtime_boot_v1_bootstrap_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Extension); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_runtime_boot_v1_bootstrap_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BootstrapResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_runtime_boot_v1_bootstrap_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RuncV2Extensions); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_runtime_boot_v1_bootstrap_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_runtime_boot_v1_bootstrap_proto_goTypes,
DependencyIndexes: file_runtime_boot_v1_bootstrap_proto_depIdxs,
MessageInfos: file_runtime_boot_v1_bootstrap_proto_msgTypes,
}.Build()
File_runtime_boot_v1_bootstrap_proto = out.File
file_runtime_boot_v1_bootstrap_proto_rawDesc = nil
file_runtime_boot_v1_bootstrap_proto_goTypes = nil
file_runtime_boot_v1_bootstrap_proto_depIdxs = nil
}

View File

@@ -0,0 +1,119 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Bootstrap Protocol
//
// This protocol defines the interface between containerd and shims at startup.
// It replaces the previous scattered configuration mechanisms (CLI args, env vars,
// stdin JSON, spec.json annotations) with a single, versioned, extensible protocol.
//
// Flow:
// 1. containerd spawns the shim process
// 2. containerd writes BootstrapParams as JSON to shim's stdin
// 3. shim initializes and writes BootstrapResult as JSON to stdout
// 4. containerd connects to the address provided in BootstrapResult
//
// Note: JSON serialization is used to keep shim binaries small since the
// encoding/json package is already part of the Go runtime. The proto
// definition serves as the schema for detecting breaking changes and
// maintaining forward/backward compatibility.
//
// This design enables:
// - Forward/backward compatibility via version field
// - Typed extensibility via google.protobuf.Any and Extension
// - Clear capability negotiation between containerd and shims
syntax = "proto3";
package containerd.runtime.bootstrap.v1;
import "google/protobuf/any.proto";
option go_package = "github.com/containerd/containerd/api/runtime/bootstrap/v1;bootstrap";
// BootstrapParams contains all configuration passed from containerd to shim at startup.
message BootstrapParams {
// Container/sandbox ID
string id = 1;
// Namespace for the container
string namespace = 2;
// Enable debug messages in logs.
bool enable_debug = 3;
// Containerd's TTRPC API address (e.g., "unix:///run/containerd/containerd.sock.ttrpc")
string containerd_ttrpc_address = 4;
// Containerd's gRPC API address (e.g., "unix:///run/containerd/containerd.sock")
string containerd_grpc_address = 5;
// Socket path to serve.
string socket_path = 6;
// Debug socket path to serve.
string socket_path_debug = 7;
// Path to containerd binary for event publishing
string containerd_binary = 8;
// Extensible configuration sections for new features
// Each section can contain arbitrary structured data identified by type URL
// Examples: CRI config, NRI config, sandbox config, etc.
repeated Extension extensions = 9;
}
// Extension provides extensibility for new configuration types
// without changing the core BootstrapParams protocol
message Extension {
// Configuration data with embedded type URL
// Examples of type URLs:
// - "containerd.io/cri.v1.PodSandboxConfig"
// - "containerd.io/nri.v1.PluginConfig"
// - "containerd.io/sandbox.v1.SandboxConfig"
google.protobuf.Any value = 1;
}
// BootstrapResult is returned by shim via stdout after successful startup
message BootstrapResult {
// Version of shim parameters (expected 2 for shim v2)
int32 version = 1;
// Address where shim is listening (e.g., "unix:///run/containerd/shim.sock")
// Containerd will connect to this address for task operations
string address = 2;
// Protocol used by shim: "ttrpc" or "grpc"
string protocol = 3;
// Optional: Capabilities supported by this shim instance
// Allows shim to advertise what features it supports
repeated string capabilities = 4;
// Optional: Additional metadata from shim
map<string, string> metadata = 5;
}
message RuncV2Extensions {
// Annotations are spec annotations read from config.json.
map<string, string> annotations = 1;
// Enable core scheduling if available
bool sched_core = 2;
// Cgroup path to place the shim process into
string shim_cgroup = 3;
}

View File

@@ -0,0 +1,17 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package bootstrap

View File

@@ -0,0 +1,57 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package bootstrap
import (
"fmt"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
)
// AddExtension adds a new extension to the BootstrapParams.
// The message is wrapped in a google.protobuf.Any with its type URL automatically set.
func (p *BootstrapParams) AddExtension(msg proto.Message) error {
anyVal, err := anypb.New(msg)
if err != nil {
return err
}
p.Extensions = append(p.Extensions, &Extension{Value: anyVal})
return nil
}
func GetExtension[T proto.Message](p *BootstrapParams) (T, error) {
var (
empty T
reflect = empty.ProtoReflect()
name = reflect.Descriptor().FullName()
out = reflect.New().Interface().(T)
)
for _, ext := range p.Extensions {
if ext.GetValue().MessageIs(out) {
if err := ext.GetValue().UnmarshalTo(out); err != nil {
return out, fmt.Errorf("failed to unmarshal extension %q: %w", name, err)
}
return out, nil
}
}
return out, fmt.Errorf("extension %q not found", name)
}

1
vendor/modules.txt vendored
View File

@@ -117,6 +117,7 @@ github.com/containerd/console
# github.com/containerd/containerd/api v1.11.0-beta.0 => ./api
## explicit; go 1.24.0
github.com/containerd/containerd/api/events
github.com/containerd/containerd/api/runtime/boot/v1
github.com/containerd/containerd/api/runtime/sandbox/v1
github.com/containerd/containerd/api/runtime/task/v2
github.com/containerd/containerd/api/runtime/task/v3