Files
containerd/api/types/mount.proto
T
Derek McGowan a72247425b api: add shim mount capabilities
A shim that performs some mount types or transformations itself, so that
containerd's mount manager does not perform them on its behalf, had no
way to say so other than a comma separated string in the generic
annotations map of its RuntimeInfo.

Add a containerd.types.MountCapabilities extension a shim can attach to
its BootstrapResult, naming the mount types and transforms it handles.
Detail lives in an extension rather than fields of BootstrapResult so
that containerd can ignore an extension whose type it does not
recognize, letting a shim advertise unconditionally.

Presence of the extension is enough: it is not gated behind a
Capability enum value, since with no other consumer of that field an
enum value here would only ever duplicate what the extension's
presence already says, while still permitting states with no single
correct interpretation, such as the enum value being set with no
extension attached, or the reverse.

This is additive: only a new field is added to BootstrapResult, and
buf breaking is clean.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2026-08-26 10:47:43 -07:00

90 lines
2.8 KiB
Protocol Buffer

/*
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.
*/
syntax = "proto3";
package containerd.types;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/containerd/containerd/api/types;types";
// Mount describes mounts for a container.
//
// This type is the lingua franca of ContainerD. All services provide mounts
// to be used with the container at creation time.
//
// The Mount type follows the structure of the mount syscall, including a type,
// source, target and options.
message Mount {
// Type defines the nature of the mount.
string type = 1;
// Source specifies the name of the mount. Depending on mount type, this
// may be a volume name or a host path, or even ignored.
string source = 2;
// Target path in container
string target = 3;
// Options specifies zero or more fstab style mount options.
repeated string options = 4;
}
message ActiveMount {
Mount mount = 1;
google.protobuf.Timestamp mounted_at = 2;
string mount_point = 3;
map<string, string> data = 4;
}
message ActivationInfo {
string name = 1;
repeated ActiveMount active = 2;
repeated Mount system = 3;
map<string, string> labels = 4;
}
// MountCapabilities describes mount handling that a component performs itself,
// so that the mount manager does not perform it on the component's behalf.
//
// A shim advertises this as an extension of its BootstrapResult. A runtime
// may be able to handle a mount more efficiently than the host can; a VM
// based runtime, for example, may pass a disk image directly to the guest
// instead of having a loop device set up for it on the host.
//
// Mount types and transforms are named with open ended strings, so
// supporting a new one of either is not a change to this protocol.
message MountCapabilities {
// Types are the mount types the sender performs itself, such as "erofs" or
// "loop". These are base mount types, with any transform prefixes removed.
repeated string types = 1;
// Transforms are the mount transforms the sender applies itself, such as
// "format", "mkfs" or "mkdir".
//
// A transform is named on its own, without the "/<mount-type>" suffix that
// appears in a mount type, so "format" covers the mount types "format/bind"
// and "format/mkdir/overlay" alike.
repeated string transforms = 2;
}