Documentation
¶
Index ¶
- Constants
- Variables
- func NamespaceFromRoot(root string) string
- func PluginForContainer(ctx context.Context, client *containerd.Client, id string) (plugin string, runtime string, binary string, err error)
- func PluginForRuntime(runtime string) string
- func PluginForRuntimeBinary(runtime string, binary string) string
- func RootFromPlugin(plugin, namespace string) string
- func RootFromRuntime(runtime, namespace string) string
- func Runtime(container *containerd_proto.Containerd) string
Constants ¶
const ( RUNTIME_PATTERN = "io.containerd.(.*).v[0-9]+" // The runtime may instead be a path to a shim binary, e.g. for containers // created by cedana, which use the cedana shim as the container's runtime SHIM_BINARY_PATTERN = "(?:containerd|cedana)-shim-(.*)-v[0-9]+$" )
Variables ¶
var WRAPPER_RUNTIME_BINARIES = map[string]string{
"nvidia-container-runtime": "runc",
}
Some runtime binaries are thin wrappers around another runtime, and their containers are handled by the wrapped runtime's plugin. E.g. the (legacy) nvidia-container-runtime just injects NVIDIA's prestart hook into the spec and execs runc, so its containers are runc containers.
Functions ¶
func NamespaceFromRoot ¶
Extract the namespace from the root path E.g. /run/containerd/runc/default -> default
func PluginForContainer ¶ added in v0.9.303
func PluginForContainer(ctx context.Context, client *containerd.Client, id string) (plugin string, runtime string, binary string, err error)
PluginForContainer returns the plugin that handles the container's runtime, alongside the runtime name and the runtime binary (if a custom one is set). Unlike PluginForRuntime, it inspects the container's runtime options, since runtimes like crun run under the same shim as runc (io.containerd.runc.v2) with just a different binary name.
func PluginForRuntime ¶
E.g. io.containerd.runc.v2 -> runc, /usr/local/bin/cedana-shim-runc-v2 -> runc
func PluginForRuntimeBinary ¶ added in v0.9.303
PluginForRuntimeBinary returns the plugin that handles the given runtime and runtime binary combination (e.g. io.containerd.runc.v2 + crun -> crun).
func RootFromPlugin ¶
Get the root runtime directory for the plugin in namespace (e.g. runc) E.g. /run/containerd/runc/default
func RootFromRuntime ¶ added in v0.9.278
Get the root runtime directory for the runtime in namespace (e.g. io.containerd.runc.v2) E.g. /run/containerd/runc/default
func Runtime ¶ added in v0.9.278
func Runtime(container *containerd_proto.Containerd) string
Types ¶
This section is empty.