Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContainerEvent ¶
type ContainerEvent struct { // Type is whether the container was added or removed Type EventType // ContainerID is the container id, typically a 64 hexadecimal string ContainerID string // ContainerPID is the process id of the container ContainerPID uint32 // Container's configuration is the config.json from the OCI runtime // spec ContainerConfig *ocispec.Spec // Bundle is the directory containing the config.json from the OCI // runtime spec // See https://github.com/opencontainers/runtime-spec/blob/main/bundle.md Bundle string }
ContainerEvent is the notification for container creation or termination
type RuncNotifier ¶
type RuncNotifier struct {
// contains filtered or unexported fields
}
func NewRuncNotifier ¶
func NewRuncNotifier(callback RuncNotifyFunc) (*RuncNotifier, error)
NewRuncNotifier uses fanotify to detect when runc containers are created or terminated, and call the callback on such event.
Limitations: - runc must be installed in one of the paths listed by runcPaths
func (*RuncNotifier) AddWatchContainerTermination ¶
func (n *RuncNotifier) AddWatchContainerTermination(containerID string, containerPID int) error
AddWatchContainerTermination watches a container for termination and generates an event on the notifier. This is automatically called for new containers detected by RuncNotifier, but it can also be called for containers detected externally such as initial containers.
func (*RuncNotifier) Close ¶
func (n *RuncNotifier) Close()
type RuncNotifyFunc ¶
type RuncNotifyFunc func(notif ContainerEvent)
Click to show internal directories.
Click to hide internal directories.