Documentation ¶
Index ¶
Constants ¶
const ( // RuntimeLinuxV1 is the legacy linux runtime RuntimeLinuxV1 = "io.containerd.runtime.v1.linux" // RuntimeRuncV1 is the runc runtime that supports a single container RuntimeRuncV1 = "io.containerd.runc.v1" // RuntimeRuncV2 is the runc runtime that supports multiple containers per shim RuntimeRuncV2 = "io.containerd.runc.v2" )
Variables ¶
var ( // ErrNoType is returned when no type is specified ErrNoType = errors.New("plugin: no type") // ErrNoPluginID is returned when no id is specified ErrNoPluginID = errors.New("plugin: no id") // ErrIDRegistered is returned when a duplicate id is already registered ErrIDRegistered = errors.New("plugin: id already registered") // ErrSkipPlugin is used when a plugin is not initialized and should not be loaded, // this allows the plugin loader differentiate between a plugin which is configured // not to load and one that fails to load. ErrSkipPlugin = errors.New("skip plugin") // ErrInvalidRequires will be thrown if the requirements for a plugin are // defined in an invalid manner. ErrInvalidRequires = errors.New("invalid requires") )
Functions ¶
func IsSkipPlugin ¶
IsSkipPlugin returns true if the error is skipping the plugin
Types ¶
type DisableFilter ¶ added in v1.3.0
type DisableFilter func(r *Registration) bool
DisableFilter filters out disabled plugins
type InitContext ¶
type InitContext struct { Context context.Context Root string State string Config interface{} Address string TTRPCAddress string // deprecated: will be removed in 2.0, use plugin.EventType Events *exchange.Exchange Meta *Meta // plugins can fill in metadata at init. // contains filtered or unexported fields }
InitContext is used for plugin initialization
func NewContext ¶
func NewContext(ctx context.Context, r *Registration, plugins *Set, root, state string) *InitContext
NewContext returns a new plugin InitContext
func (*InitContext) Get ¶
func (i *InitContext) Get(t Type) (interface{}, error)
Get returns the first plugin by its type
type Meta ¶
type Meta struct { Platforms []ocispec.Platform // platforms supported by plugin Exports map[string]string // values exported by plugin Capabilities []string // feature switches for plugin }
Meta contains information gathered from the registration and initialization process.
type Plugin ¶
type Plugin struct { Registration *Registration // registration, as initialized Config interface{} // config, as initialized Meta *Meta // contains filtered or unexported fields }
Plugin represents an initialized plugin, used with an init context.
type Registration ¶
type Registration struct { // Type of the plugin Type Type // ID of the plugin ID string // Config specific to the plugin Config interface{} // Requires is a list of plugins that the registered plugin requires to be available Requires []Type // InitFn is called when initializing a plugin. The registration and // context are passed in. The init function may modify the registration to // add exports, capabilities and platform support declarations. InitFn func(*InitContext) (interface{}, error) // Disable the plugin from loading Disable bool }
Registration contains information for registering a plugin
func Graph ¶
func Graph(filter DisableFilter) (ordered []*Registration)
Graph returns an ordered list of registered plugins for initialization. Plugins in disableList specified by id will be disabled.
func (*Registration) Init ¶
func (r *Registration) Init(ic *InitContext) *Plugin
Init the registered plugin
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set defines a plugin collection, used with InitContext.
This maintains ordering and unique indexing over the set.
After iteratively instantiating plugins, this set should represent, the ordered, initialization set of plugins for a containerd instance.
type Type ¶
type Type string
Type is the type of the plugin
const ( // InternalPlugin implements an internal plugin to containerd InternalPlugin Type = "io.containerd.internal.v1" // RuntimePlugin implements a runtime RuntimePlugin Type = "io.containerd.runtime.v1" // RuntimePluginV2 implements a runtime v2 RuntimePluginV2 Type = "io.containerd.runtime.v2" // ServicePlugin implements a internal service ServicePlugin Type = "io.containerd.service.v1" // GRPCPlugin implements a grpc service GRPCPlugin Type = "io.containerd.grpc.v1" // TTRPCPlugin implements a ttrpc shim service TTRPCPlugin Type = "io.containerd.ttrpc.v1" // SnapshotPlugin implements a snapshotter SnapshotPlugin Type = "io.containerd.snapshotter.v1" // TaskMonitorPlugin implements a task monitor TaskMonitorPlugin Type = "io.containerd.monitor.v1" // DiffPlugin implements a differ DiffPlugin Type = "io.containerd.differ.v1" // MetadataPlugin implements a metadata store MetadataPlugin Type = "io.containerd.metadata.v1" // ContentPlugin implements a content store ContentPlugin Type = "io.containerd.content.v1" // GCPlugin implements garbage collection policy GCPlugin Type = "io.containerd.gc.v1" // EventPlugin implements event handling EventPlugin Type = "io.containerd.event.v1" // TracingProcessorPlugin implements a open telemetry span processor TracingProcessorPlugin Type = "io.containerd.tracing.processor.v1" )