Version: v1.1.3 Latest Latest

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 0




This section is empty.


View Source
var (
	ErrPoolAtMaxCapacity          = fmt.Errorf("cannot assign any more resource from warm pool")
	ErrResourceAreBeingCooledDown = fmt.Errorf("cannot assign resource now, resources are being cooled down")
	ErrResourcesAreBeingCreated   = fmt.Errorf("cannot assign resource now, resources are being created")
	ErrWarmPoolEmpty              = fmt.Errorf("warm pool is empty")
	ErrResourceAlreadyAssigned    = fmt.Errorf("resource is already assigned to the requestor")
	ErrResourceDoesntExist        = fmt.Errorf("requested resource doesn't exist in used pool")
	ErrIncorrectResourceOwner     = fmt.Errorf("resource doesn't belong to the requestor")


This section is empty.


type CoolDownResource added in v1.1.0

type CoolDownResource struct {
	// ResourceID is the unique ID of the resource
	ResourceID string
	// DeletionTimestamp is the time when the owner of the resource was deleted
	DeletionTimestamp time.Time

type IntrospectResponse added in v1.1.0

type IntrospectResponse struct {
	UsedResources    map[string]string
	WarmResources    []string
	CoolingResources []CoolDownResource

IntrospectResponse is the pool state returned to the introspect API

type Pool

type Pool interface {
	AssignResource(requesterID string) (resourceID string, shouldReconcile bool, err error)
	FreeResource(requesterID string, resourceID string) (shouldReconcile bool, err error)
	GetAssignedResource(requesterID string) (resourceID string, ownsResource bool)
	UpdatePool(job *worker.WarmPoolJob, didSucceed bool) (shouldReconcile bool)
	ReSync(resources []string)
	ReconcilePool() *worker.WarmPoolJob
	ProcessCoolDownQueue() bool
	Introspect() IntrospectResponse

func NewResourcePool

func NewResourcePool(log logr.Logger, poolConfig *config.WarmPoolConfig, usedResources map[string]string,
	warmResources []string, nodeName string, capacity int) Pool

Source Files

Jump to

Keyboard shortcuts

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