config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailurePolicyType

type FailurePolicyType string
const (
	// PolicyFail returns error to caller when got an error cri hook server
	PolicyFail FailurePolicyType = "Fail"
	// PolicyIgnore transfer cri request to containerd/dockerd when got an error to cri serer
	PolicyIgnore FailurePolicyType = "Ignore"
)

type Manager

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewConfigManager

func NewConfigManager() *Manager

func (*Manager) GetAllHook

func (m *Manager) GetAllHook() []*RuntimeHookConfig

func (*Manager) Setup

func (m *Manager) Setup() error

type RuntimeHookConfig

type RuntimeHookConfig struct {
	RemoteEndpoint string            `json:"remote-endpoint,omitempty"`
	FailurePolicy  FailurePolicyType `json:"failure-policy,omitempty"`
	RuntimeHooks   []RuntimeHookType `json:"runtime-hooks,omitempty"`
}

type RuntimeHookConfigItem

type RuntimeHookConfigItem struct {
	*RuntimeHookConfig
	// contains filtered or unexported fields
}

type RuntimeHookStage

type RuntimeHookStage string
const (
	PreHook     RuntimeHookStage = "PreHook"
	PostHook    RuntimeHookStage = "PostHook"
	UnknownHook RuntimeHookStage = "UnknownHook"
)

type RuntimeHookType

type RuntimeHookType string
const (
	PreRunPodSandbox            RuntimeHookType = "PreRunPodSandbox"
	PreStartContainer           RuntimeHookType = "PreStartContainer"
	PostStartContainer          RuntimeHookType = "PostStartContainer"
	PreUpdateContainerResources RuntimeHookType = "PreUpdateContainerResources"
	PostStopContainer           RuntimeHookType = "PostStopContainer"
	NoneRuntimeHookType         RuntimeHookType = "NoneRuntimeHookType"
)

func (RuntimeHookType) HookStage

func (ht RuntimeHookType) HookStage() RuntimeHookStage

func (RuntimeHookType) OccursOn

func (ht RuntimeHookType) OccursOn(path RuntimeRequestPath) bool

type RuntimeRequestPath

type RuntimeRequestPath string
const (
	RunPodSandbox            RuntimeRequestPath = "RunPodSandbox"
	StartContainer           RuntimeRequestPath = "StartContainer"
	UpdateContainerResources RuntimeRequestPath = "UpdateContainerResources"
	StopContainer            RuntimeRequestPath = "StopContainer"
	NoneRuntimeHookPath      RuntimeRequestPath = "NoneRuntimeHookPath"
)

func (RuntimeRequestPath) PostHookType

func (hp RuntimeRequestPath) PostHookType() RuntimeHookType

func (RuntimeRequestPath) PreHookType

func (hp RuntimeRequestPath) PreHookType() RuntimeHookType

Jump to

Keyboard shortcuts

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