config

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 11 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"
	// PolicyNone when no Policy configured. Proxy would ignore errors for PolicyNone like PolicyIgnore.
	PolicyNone = ""
)

func GetFailurePolicyType added in v0.7.0

func GetFailurePolicyType(typeString string) (FailurePolicyType, error)

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) Run added in v1.0.0

func (m *Manager) Run() error

type ManagerInterface added in v1.0.0

type ManagerInterface interface {
	GetAllHook() []*RuntimeHookConfig
	Run() 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"
	PostStopPodSandbox          RuntimeHookType = "PostStopPodSandbox"
	PreCreateContainer          RuntimeHookType = "PreCreateContainer"
	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"
	StopPodSandbox           RuntimeRequestPath = "StopPodSandbox"
	CreateContainer          RuntimeRequestPath = "CreateContainer"
	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