resources

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const RC_KEY_DEPLOYMENT = "DEPLOYMENT"
View Source
const RC_KEY_INGRESS = "INGRESS"
View Source
const RC_KEY_NETWORK_POLICY = "NETWORK_POLICY"
View Source
const RC_KEY_POD_DISRUPTION_BUDGET_V1 = "POD_DISRUPTION_BUDGET_V1"
View Source
const RC_KEY_POD_DISRUPTION_BUDGET_V1BETA1 = "POD_DISRUPTION_BUDGET_V1BETA1"
View Source
const RC_KEY_ROUTE_OCP = "ROUTE_OCP"
View Source
const RC_KEY_SERVICE = "SERVICE"
View Source
const RC_KEY_SPEC = "SPEC"
View Source
const RC_KEY_STATUS = "STATUS"
View Source
const RC_NOT_CREATED_NAME_EMPTY = ""

Variables

This section is empty.

Functions

This section is empty.

Types

type PatchFunction

type PatchFunction = func(value interface{}) interface{}

Return a MODIFIED COPY of the given resource. Do not modify or return the original value.

type ResourceCache

type ResourceCache interface {
	// Returns the value and a boolean representing if the value exists
	Get(key string) (ResourceCacheEntry, bool)

	Set(key string, value ResourceCacheEntry) // TODO We may need multi-map in the future (add `type`)

	Remove(key string)

	Clear()
}

func NewResourceCache

func NewResourceCache() ResourceCache

Resource cache is a way for CF to avoid getting & recreating the resources unnecessarily, and do a pseudo-atomic patching It is cleared at the end of reconcilliation cycle, and there must be some CF responsible for filling the values

type ResourceCacheEntry

type ResourceCacheEntry interface {
	// Get the k8s name of the resource, we are not supporting multiple namespaces yet
	// May return null if the resource was just created
	GetName() common.Name

	// get the stored value, it has to be cast using type assertion
	GetValue() interface{}

	GetOriginalValue() interface{}

	ApplyPatch(pf PatchFunction)

	HasChanged() bool
	ResetHasChanged()
}

func NewResourceCacheEntry

func NewResourceCacheEntry(name common.Name, value interface{}) ResourceCacheEntry

Jump to

Keyboard shortcuts

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