rthooks

package
v0.8.20 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package rthooks contains code for managing run-time hooks Runtime hooks are hooks for (synchronously) notifying the agent for runtime events such as the creation of a container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCallbacksAtInit

func RegisterCallbacksAtInit(cbs Callbacks)

RegisterCallbacksAtInit registers callbacks (should be called at init())

Types

type Callbacks

type Callbacks struct {
	CreateContainer func(ctx context.Context, arg *CreateContainerArg) error
}

type CreateContainerArg

type CreateContainerArg struct {
	Req     *v1.CreateContainer
	Watcher watcher.K8sResourceWatcher
}

type DummyHookRunner

type DummyHookRunner struct{}

func (DummyHookRunner) RunHooks

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func GlobalRunner

func GlobalRunner() *Runner

After RegisterCallbacksAtInit(), this function can be used to retrieve the Runner. Once this function is called, subsequent calls of RegisterCallbacksAtInit() will panic()

func (*Runner) RunHooks

func (r *Runner) RunHooks(ctx context.Context, req *v1.RuntimeHookRequest) error

runHooks executes all registered callbacks

func (*Runner) WithWatcher

func (r *Runner) WithWatcher(watcher watcher.K8sResourceWatcher) *Runner

WithWatcher sets the watcher on a runner

Jump to

Keyboard shortcuts

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