nri

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginConfigEvent = &event{kind: "Configure"}
	PluginSyncedEvent = &event{kind: "Synchronize"}
	PluginClosedEvent = &event{kind: "Closed"}
)

Functions

func ConnectRuntime

func ConnectRuntime() (*runtime, error)

func ContainerEvent

func ContainerEvent(kind, pod, ctr string) *event

func CreateContainerEvent

func CreateContainerEvent(pod, ctr string) *event

func NewPlugin

func NewPlugin(namespace string, options ...PluginOption) *plugin

func PodEvent

func PodEvent(kind, pod string) *event

func PostCreateContainerEvent

func PostCreateContainerEvent(pod, ctr string) *event

func PostStartContainerEvent

func PostStartContainerEvent(pod, ctr string) *event

func PostUpdateContainerEvent

func PostUpdateContainerEvent(pod, ctr string) *event

func RemoveContainerEvent

func RemoveContainerEvent(pod, ctr string) *event

func RemovePodEvent

func RemovePodEvent(pod string) *event

func RunPodEvent

func RunPodEvent(pod string) *event

func StartContainerEvent

func StartContainerEvent(pod, ctr string) *event

func StopContainerEvent

func StopContainerEvent(pod, ctr string) *event

func StopPodEvent

func StopPodEvent(pod string) *event

func UpdateContainerEvent

func UpdateContainerEvent(pod, ctr string) *event

Types

type ContainerOption

type ContainerOption func(*cri.ContainerConfig) error

func WithAnnotations

func WithAnnotations(annotations map[string]string) ContainerOption

func WithArgs

func WithArgs(args ...string) ContainerOption

func WithCommand

func WithCommand(cmd ...string) ContainerOption

func WithEnv

func WithEnv(envs []*cri.KeyValue) ContainerOption

func WithImage

func WithImage(image string) ContainerOption

func WithLabels

func WithLabels(labels map[string]string) ContainerOption

func WithShellScript

func WithShellScript(cmd string) ContainerOption

type PluginOption

type PluginOption func(*plugin)

func WithCreateHandler

func WithCreateHandler(fn func(*plugin, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error)) PluginOption

func WithPostCreateHandler

func WithPostCreateHandler(fn func(*plugin, *api.PodSandbox, *api.Container) error) PluginOption

func WithStopHandler

func WithStopHandler(fn func(*plugin, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error)) PluginOption

func WithStubOptions

func WithStubOptions(options ...stub.Option) PluginOption

func WithTestNamespace

func WithTestNamespace(namespace string) PluginOption

func WithUpdateHandler

func WithUpdateHandler(fn func(*plugin, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error)) PluginOption

type PodOption

type PodOption func(*cri.PodSandboxConfig) error

func WithPodAnnotations

func WithPodAnnotations(annotations map[string]string) PodOption

func WithPodLabels

func WithPodLabels(labels map[string]string) PodOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL