package adaptation
import "github.com/containerd/nri/pkg/adaptation"
Index ¶
- Constants
- Variables
- type Adaptation
- func New(name, version string, syncFn SyncFn, updateFn UpdateFn, opts ...Option) (*Adaptation, error)
- 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 Config
- 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 WithConfig(cfg *Config) Option
- func WithConfigPath(path string) Option
- func WithPluginPath(path string) Option
- func WithSocketPath(path string) Option
- type OptionalBool
- type OptionalFileMode
- type OptionalInt
- type OptionalInt32
- type OptionalInt64
- type OptionalString
- type OptionalUInt32
- type OptionalUInt64
- 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 ( // DefaultConfigPath is the default path to the NRI configuration. DefaultConfigPath = "/etc/nri/nri.conf" // 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 )
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 ( // PluginConfigSubdir is the drop-in directory for plugin configuration. PluginConfigSubdir = "conf.d" )
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
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) 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 Config ¶
type Config struct { // DisableConnections disables plugin-initiated connections. DisableConnections bool `json:"disableConnections"` // contains filtered or unexported fields }
Config is the runtime configuration for NRI.
func DefaultConfig ¶
DefaultConfig returns the default NRI configuration for a given path. This configuration should be identical to what ReadConfig would return for an empty file at the given location. If the given path is empty, DefaultConfigPath is used instead.
func ReadConfig ¶
ReadConfig reads the NRI runtime configuration from a file.
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 WithConfig ¶
WithConfig returns an option to provide a pre-parsed NRI configuration.
func WithConfigPath ¶
WithConfigPath returns an option to override the default NRI 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.
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 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 config.go plugin.go plugin_other.go result.go
- Version
- v0.2.0
- Published
- Dec 1, 2022
- Platform
- windows/amd64
- Imports
- 20 packages
- Last checked
- 4 hours ago –
Tools for package owners.