package adaptation
import "github.com/containerd/nri/pkg/adaptation"
Index ¶
- Constants
- Variables
- func SetPluginRegistrationTimeout(t time.Duration)
- func SetPluginRequestTimeout(t time.Duration)
- type Adaptation
- func New(name, version string, syncFn SyncFn, updateFn UpdateFn, opts ...Option) (*Adaptation, error)
- func (r *Adaptation) BlockPluginSync() *PluginSyncBlock
- func (r *Adaptation) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error)
- func (r *Adaptation) PostCreateContainer(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) PostStartContainer(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) PostUpdateContainer(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) RemoveContainer(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) RemovePodSandbox(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) RunPodSandbox(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) Start() error
- func (r *Adaptation) StartContainer(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) StateChange(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) Stop()
- func (r *Adaptation) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error)
- func (r *Adaptation) StopPodSandbox(ctx context.Context, evt *StateChangeEvent) error
- func (r *Adaptation) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error)
- type CDIDevice
- type ConfigureRequest
- type ConfigureResponse
- type Container
- type ContainerAdjustment
- type ContainerEviction
- type ContainerState
- type ContainerUpdate
- type CreateContainerRequest
- type CreateContainerResponse
- type EventMask
- type Hook
- type Hooks
- type HugepageLimit
- type KeyValue
- type LinuxCPU
- type LinuxContainer
- type LinuxContainerAdjustment
- type LinuxContainerUpdate
- type LinuxDevice
- type LinuxDeviceCgroup
- type LinuxMemory
- type LinuxNamespace
- type LinuxPodSandbox
- type LinuxResources
- type Mount
- type Option
- func WithDisabledExternalConnections() Option
- func WithPluginConfigPath(path string) Option
- func WithPluginPath(path string) Option
- func WithSocketPath(path string) Option
- func WithTTRPCOptions(clientOpts []ttrpc.ClientOpts, serverOpts []ttrpc.ServerOpt) Option
- type OptionalBool
- type OptionalFileMode
- type OptionalInt
- type OptionalInt32
- type OptionalInt64
- type OptionalString
- type OptionalUInt32
- type OptionalUInt64
- type POSIXRlimit
- type PluginSyncBlock
- type PodSandbox
- type PostCreateContainerRequest
- type PostCreateContainerResponse
- type PostStartContainerRequest
- type PostStartContainerResponse
- type PostUpdateContainerRequest
- type PostUpdateContainerResponse
- type RegisterPluginRequest
- type RegisterPluginResponse
- type RemoveContainerRequest
- type RemoveContainerResponse
- type RemovePodSandboxRequest
- type RunPodSandboxRequest
- type StartContainerRequest
- type StartContainerResponse
- type StateChangeEvent
- type StateChangeResponse
- type StopContainerRequest
- type StopContainerResponse
- type StopPodSandboxRequest
- type SyncCB
- type SyncFn
- type SynchronizeRequest
- type SynchronizeResponse
- type UpdateContainerRequest
- type UpdateContainerResponse
- type UpdateContainersRequest
- type UpdateContainersResponse
- type UpdateFn
Constants ¶
const ( // DefaultPluginPath is the default path to search for NRI plugins. DefaultPluginPath = "/opt/nri/plugins" // DefaultSocketPath is the default socket path for external plugins. DefaultSocketPath = api.DefaultSocketPath // PluginConfigDir is the drop-in directory for NRI-launched plugin configuration. DefaultPluginConfigPath = "/etc/nri/conf.d" )
const ( Event_UNKNOWN = api.Event_UNKNOWN Event_RUN_POD_SANDBOX = api.Event_RUN_POD_SANDBOX Event_STOP_POD_SANDBOX = api.Event_STOP_POD_SANDBOX Event_REMOVE_POD_SANDBOX = api.Event_REMOVE_POD_SANDBOX Event_CREATE_CONTAINER = api.Event_CREATE_CONTAINER Event_POST_CREATE_CONTAINER = api.Event_POST_CREATE_CONTAINER Event_START_CONTAINER = api.Event_START_CONTAINER Event_POST_START_CONTAINER = api.Event_POST_START_CONTAINER Event_UPDATE_CONTAINER = api.Event_UPDATE_CONTAINER Event_POST_UPDATE_CONTAINER = api.Event_POST_UPDATE_CONTAINER Event_STOP_CONTAINER = api.Event_STOP_CONTAINER Event_REMOVE_CONTAINER = api.Event_REMOVE_CONTAINER ValidEvents = api.ValidEvents ContainerState_CONTAINER_UNKNOWN = api.ContainerState_CONTAINER_UNKNOWN ContainerState_CONTAINER_CREATED = api.ContainerState_CONTAINER_CREATED ContainerState_CONTAINER_PAUSED = api.ContainerState_CONTAINER_PAUSED ContainerState_CONTAINER_RUNNING = api.ContainerState_CONTAINER_RUNNING ContainerState_CONTAINER_STOPPED = api.ContainerState_CONTAINER_STOPPED ContainerState_CONTAINER_EXITED = api.ContainerState_CONTAINER_STOPPED )
Aliased consts for api/api.proto. nolint
const ( // DefaultPluginRegistrationTimeout is the default timeout for plugin registration. DefaultPluginRegistrationTimeout = api.DefaultPluginRegistrationTimeout // DefaultPluginRequestTimeout is the default timeout for plugins to handle a request. DefaultPluginRequestTimeout = api.DefaultPluginRequestTimeout )
Variables ¶
var ( String = api.String Int = api.Int Int32 = api.Int32 UInt32 = api.UInt32 Int64 = api.Int64 UInt64 = api.UInt64 Bool = api.Bool FileMode = api.FileMode )
Aliased functions for api/optional.go. nolint
var ( FromOCIMounts = api.FromOCIMounts FromOCIHooks = api.FromOCIHooks FromOCILinuxNamespaces = api.FromOCILinuxNamespaces FromOCILinuxDevices = api.FromOCILinuxDevices FromOCILinuxResources = api.FromOCILinuxResources DupStringSlice = api.DupStringSlice DupStringMap = api.DupStringMap IsMarkedForRemoval = api.IsMarkedForRemoval MarkForRemoval = api.MarkForRemoval )
Aliased functions for api/types.go. nolint
Functions ¶
func SetPluginRegistrationTimeout ¶
SetPluginRegistrationTimeout sets the timeout for plugin registration.
func SetPluginRequestTimeout ¶
SetPluginRequestTimeout sets the timeout for plugins to handle a request.
Types ¶
type Adaptation ¶
Adaptation is the NRI abstraction for container runtime NRI adaptation/integration.
func New ¶
func New(name, version string, syncFn SyncFn, updateFn UpdateFn, opts ...Option) (*Adaptation, error)
New creates a new NRI Runtime.
func (*Adaptation) BlockPluginSync ¶
func (r *Adaptation) BlockPluginSync() *PluginSyncBlock
BlockPluginSync blocks plugins from being synchronized/fully registered.
func (*Adaptation) CreateContainer ¶
func (r *Adaptation) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error)
CreateContainer relays the corresponding CRI request to plugins.
func (*Adaptation) PostCreateContainer ¶
func (r *Adaptation) PostCreateContainer(ctx context.Context, evt *StateChangeEvent) error
PostCreateContainer relays the corresponding CRI event to plugins.
func (*Adaptation) PostStartContainer ¶
func (r *Adaptation) PostStartContainer(ctx context.Context, evt *StateChangeEvent) error
PostStartContainer relays the corresponding CRI event to plugins.
func (*Adaptation) PostUpdateContainer ¶
func (r *Adaptation) PostUpdateContainer(ctx context.Context, evt *StateChangeEvent) error
PostUpdateContainer relays the corresponding CRI event to plugins.
func (*Adaptation) RemoveContainer ¶
func (r *Adaptation) RemoveContainer(ctx context.Context, evt *StateChangeEvent) error
RemoveContainer relays the corresponding CRI event to plugins.
func (*Adaptation) RemovePodSandbox ¶
func (r *Adaptation) RemovePodSandbox(ctx context.Context, evt *StateChangeEvent) error
RemovePodSandbox relays the corresponding CRI event to plugins.
func (*Adaptation) RunPodSandbox ¶
func (r *Adaptation) RunPodSandbox(ctx context.Context, evt *StateChangeEvent) error
RunPodSandbox relays the corresponding CRI event to plugins.
func (*Adaptation) Start ¶
func (r *Adaptation) Start() error
Start up the NRI runtime.
func (*Adaptation) StartContainer ¶
func (r *Adaptation) StartContainer(ctx context.Context, evt *StateChangeEvent) error
StartContainer relays the corresponding CRI event to plugins.
func (*Adaptation) StateChange ¶
func (r *Adaptation) StateChange(ctx context.Context, evt *StateChangeEvent) error
StateChange relays pod- or container events to plugins.
func (*Adaptation) Stop ¶
func (r *Adaptation) Stop()
Stop the NRI runtime.
func (*Adaptation) StopContainer ¶
func (r *Adaptation) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error)
StopContainer relays the corresponding CRI request to plugins.
func (*Adaptation) StopPodSandbox ¶
func (r *Adaptation) StopPodSandbox(ctx context.Context, evt *StateChangeEvent) error
StopPodSandbox relays the corresponding CRI event to plugins.
func (*Adaptation) UpdateContainer ¶
func (r *Adaptation) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error)
UpdateContainer relays the corresponding CRI request to plugins.
type CDIDevice ¶
Aliased request/response/event types for api/api.proto. nolint
type ConfigureRequest ¶
type ConfigureRequest = api.ConfigureRequest
Aliased request/response/event types for api/api.proto. nolint
type ConfigureResponse ¶
type ConfigureResponse = api.ConfigureResponse
Aliased request/response/event types for api/api.proto. nolint
type Container ¶
Aliased request/response/event types for api/api.proto. nolint
type ContainerAdjustment ¶
type ContainerAdjustment = api.ContainerAdjustment
Aliased request/response/event types for api/api.proto. nolint
type ContainerEviction ¶
type ContainerEviction = api.ContainerEviction
Aliased request/response/event types for api/api.proto. nolint
type ContainerState ¶
type ContainerState = api.ContainerState
Aliased request/response/event types for api/api.proto. nolint
type ContainerUpdate ¶
type ContainerUpdate = api.ContainerUpdate
Aliased request/response/event types for api/api.proto. nolint
type CreateContainerRequest ¶
type CreateContainerRequest = api.CreateContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type CreateContainerResponse ¶
type CreateContainerResponse = api.CreateContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type EventMask ¶
Aliased request/response/event types for api/api.proto. nolint
type Hook ¶
Aliased request/response/event types for api/api.proto. nolint
type Hooks ¶
Aliased request/response/event types for api/api.proto. nolint
type HugepageLimit ¶
type HugepageLimit = api.HugepageLimit
Aliased request/response/event types for api/api.proto. nolint
type KeyValue ¶
Aliased request/response/event types for api/api.proto. nolint
type LinuxCPU ¶
Aliased request/response/event types for api/api.proto. nolint
type LinuxContainer ¶
type LinuxContainer = api.LinuxContainer
Aliased request/response/event types for api/api.proto. nolint
type LinuxContainerAdjustment ¶
type LinuxContainerAdjustment = api.LinuxContainerAdjustment
Aliased request/response/event types for api/api.proto. nolint
type LinuxContainerUpdate ¶
type LinuxContainerUpdate = api.LinuxContainerUpdate
Aliased request/response/event types for api/api.proto. nolint
type LinuxDevice ¶
type LinuxDevice = api.LinuxDevice
Aliased request/response/event types for api/api.proto. nolint
type LinuxDeviceCgroup ¶
type LinuxDeviceCgroup = api.LinuxDeviceCgroup
Aliased request/response/event types for api/api.proto. nolint
type LinuxMemory ¶
type LinuxMemory = api.LinuxMemory
Aliased request/response/event types for api/api.proto. nolint
type LinuxNamespace ¶
type LinuxNamespace = api.LinuxNamespace
Aliased request/response/event types for api/api.proto. nolint
type LinuxPodSandbox ¶
type LinuxPodSandbox = api.LinuxPodSandbox
Aliased request/response/event types for api/api.proto. nolint
type LinuxResources ¶
type LinuxResources = api.LinuxResources
Aliased request/response/event types for api/api.proto. nolint
type Mount ¶
Aliased request/response/event types for api/api.proto. nolint
type Option ¶
type Option func(*Adaptation) error
Option to apply to the NRI runtime.
func WithDisabledExternalConnections ¶
func WithDisabledExternalConnections() Option
WithDisabledExternalConnections returns an options to disable accepting plugin connections.
func WithPluginConfigPath ¶
WithPluginConfigPath returns an option to override the default NRI plugin config path.
func WithPluginPath ¶
WithPluginPath returns an option to override the default NRI plugin path.
func WithSocketPath ¶
WithSocketPath returns an option to override the default NRI socket path.
func WithTTRPCOptions ¶
func WithTTRPCOptions(clientOpts []ttrpc.ClientOpts, serverOpts []ttrpc.ServerOpt) Option
WithTTRPCOptions sets extra client and server options to use for ttrpc.
type OptionalBool ¶
type OptionalBool = api.OptionalBool
Aliased types for api/optional.go. nolint
type OptionalFileMode ¶
type OptionalFileMode = api.OptionalFileMode
Aliased types for api/optional.go. nolint
type OptionalInt ¶
type OptionalInt = api.OptionalInt
Aliased types for api/optional.go. nolint
type OptionalInt32 ¶
type OptionalInt32 = api.OptionalInt32
Aliased types for api/optional.go. nolint
type OptionalInt64 ¶
type OptionalInt64 = api.OptionalInt64
Aliased types for api/optional.go. nolint
type OptionalString ¶
type OptionalString = api.OptionalString
Aliased types for api/optional.go. nolint
type OptionalUInt32 ¶
type OptionalUInt32 = api.OptionalUInt32
Aliased types for api/optional.go. nolint
type OptionalUInt64 ¶
type OptionalUInt64 = api.OptionalUInt64
Aliased types for api/optional.go. nolint
type POSIXRlimit ¶
type POSIXRlimit = api.POSIXRlimit
Aliased request/response/event types for api/api.proto. nolint
type PluginSyncBlock ¶
type PluginSyncBlock struct {
// contains filtered or unexported fields
}
func (*PluginSyncBlock) Unblock ¶
func (b *PluginSyncBlock) Unblock()
Unblock a plugin sync. block put in place by BlockPluginSync. Safe to call multiple times but only from a single goroutine.
type PodSandbox ¶
type PodSandbox = api.PodSandbox
Aliased request/response/event types for api/api.proto. nolint
type PostCreateContainerRequest ¶
type PostCreateContainerRequest = api.PostCreateContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type PostCreateContainerResponse ¶
type PostCreateContainerResponse = api.PostCreateContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type PostStartContainerRequest ¶
type PostStartContainerRequest = api.PostStartContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type PostStartContainerResponse ¶
type PostStartContainerResponse = api.PostStartContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type PostUpdateContainerRequest ¶
type PostUpdateContainerRequest = api.PostUpdateContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type PostUpdateContainerResponse ¶
type PostUpdateContainerResponse = api.PostUpdateContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type RegisterPluginRequest ¶
type RegisterPluginRequest = api.RegisterPluginRequest
Aliased request/response/event types for api/api.proto. nolint
type RegisterPluginResponse ¶
Aliased request/response/event types for api/api.proto. nolint
type RemoveContainerRequest ¶
type RemoveContainerRequest = api.RemoveContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type RemoveContainerResponse ¶
type RemoveContainerResponse = api.RemoveContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type RemovePodSandboxRequest ¶
type RemovePodSandboxRequest = api.RemovePodSandboxRequest
Aliased request/response/event types for api/api.proto. nolint
type RunPodSandboxRequest ¶
type RunPodSandboxRequest = api.RunPodSandboxRequest
Aliased request/response/event types for api/api.proto. nolint
type StartContainerRequest ¶
type StartContainerRequest = api.StartContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type StartContainerResponse ¶
type StartContainerResponse = api.StartContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type StateChangeEvent ¶
type StateChangeEvent = api.StateChangeEvent
Aliased request/response/event types for api/api.proto. nolint
type StateChangeResponse ¶
type StateChangeResponse = api.StateChangeResponse
Aliased request/response/event types for api/api.proto. nolint
type StopContainerRequest ¶
type StopContainerRequest = api.StopContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type StopContainerResponse ¶
type StopContainerResponse = api.StopContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type StopPodSandboxRequest ¶
type StopPodSandboxRequest = api.StopPodSandboxRequest
Aliased request/response/event types for api/api.proto. nolint
type SyncCB ¶
type SyncCB func(context.Context, []*PodSandbox, []*Container) ([]*ContainerUpdate, error)
SyncCB is an NRI function used to synchronize plugins with the runtime.
type SyncFn ¶
SyncFn is a container runtime function for state synchronization.
type SynchronizeRequest ¶
type SynchronizeRequest = api.SynchronizeRequest
Aliased request/response/event types for api/api.proto. nolint
type SynchronizeResponse ¶
type SynchronizeResponse = api.SynchronizeResponse
Aliased request/response/event types for api/api.proto. nolint
type UpdateContainerRequest ¶
type UpdateContainerRequest = api.UpdateContainerRequest
Aliased request/response/event types for api/api.proto. nolint
type UpdateContainerResponse ¶
type UpdateContainerResponse = api.UpdateContainerResponse
Aliased request/response/event types for api/api.proto. nolint
type UpdateContainersRequest ¶
type UpdateContainersRequest = api.UpdateContainersRequest
Aliased request/response/event types for api/api.proto. nolint
type UpdateContainersResponse ¶
type UpdateContainersResponse = api.UpdateContainersResponse
Aliased request/response/event types for api/api.proto. nolint
type UpdateFn ¶
type UpdateFn func(context.Context, []*ContainerUpdate) ([]*ContainerUpdate, error)
UpdateFn is a container runtime function for unsolicited container updates.
Source Files ¶
adaptation.go api.go plugin.go plugin_linux.go plugin_type.go result.go
- Version
- v0.9.0 (latest)
- Published
- Dec 12, 2024
- Platform
- linux/amd64
- Imports
- 21 packages
- Last checked
- 2 months ago –
Tools for package owners.