handler

package
Version: v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequeueAfterWhenWPEmpty         = time.Millisecond * 600
	RequeueAfterWhenResourceCooling = time.Second * 20
	ReasonResourceAllocationFailed  = "ResourceAllocationFailed"
	ReasonResourceAllocated         = "ResourceAllocated"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	CanHandle(resourceName string) bool
	HandleCreate(resourceName string, requestCount int, pod *v1.Pod) (ctrl.Result, error)
	HandleDelete(resourceName string, pod *v1.Pod) (ctrl.Result, error)
}

Handler interface allows different types of resource implementation to be clubbed under a single handler. For instance, warm resource handler would handle all the types of resources that support warm pools. An example of warm pool resource is IPv4. Another example of handler is on demand handler, resources that can be only processed on demand would fit into this category. For instance, Branch ENIs are tied to the Security Group required by the pod which we would know only after receiving the pod request.

func NewOnDemandHandler

func NewOnDemandHandler(log logr.Logger, ondDemandProviders map[string]provider.ResourceProvider) Handler

NewOnDemandHandler returns a new on demand handler with all the workers that can handle particular resource types

func NewWarmResourceHandler

func NewWarmResourceHandler(log logr.Logger, k8sWrapper k8s.K8sWrapper,
	resourceProviders map[string]provider.ResourceProvider) Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL