handler

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequeueAfterWhenPrefixNotAvailable = time.Minute * 2
	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 {
	HandleCreate(requestCount int, pod *v1.Pod) (ctrl.Result, error)
	HandleDelete(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, resourceName string,
	ondDemandProvider 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, wrapper api.Wrapper,
	resourceName string, resourceProviders provider.ResourceProvider, ctx context.Context) Handler

Jump to

Keyboard shortcuts

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