pprutil

package
v0.0.0-...-aca9518 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DisruptionResultOk = DisruptionResult(iota)
	DisruptionResultRetry
	DisruptionResultDenied
)

Variables

This section is empty.

Functions

func CompactBuckets

func CompactBuckets(
	config defaultconfig.Computed,
	buckets *[]podseidonv1a1.PodProtectorAdmissionBucket,
)

func GetAggregationSelector

func GetAggregationSelector(ppr *podseidonv1a1.PodProtector) metav1.LabelSelector

func SetupPprInformer

func SetupPprInformer(
	ctx context.Context,
	pprInformer podseidonv1a1informers.PodProtectorInformer,
	postHandler func(types.NamespacedName),
	selectorIndex SelectorIndex,
	observeStartEnqueue o11y.ObserveScopeFunc[types.NamespacedName],
	observeEndEnqueue func(context.Context),
	observeEnqueueError func(context.Context, types.NamespacedName, error),
) error

func Summarize

func Summarize(config defaultconfig.Computed, ppr *podseidonv1a1.PodProtector)

Reconcile the .status field of a PodProtector.

This function should not be called unless the PodProtector status is otherwise updated locally.

The caller is responsible for cleaning up obsolete buckets. This function assumes that all remaining buckets are lagging buckets. Failure to do so would result in incorrect EstimatedAvailable computation.

Types

type DisruptionQuota

type DisruptionQuota struct {
	// Number of replicas that can be disrupted without any risk.
	Cleared int32
	// Number of replicas that cannot be disrupted due to admission history,
	// but can be disrupted if admission history is emptied.
	Transitional int32
}

func ComputeDisruptionQuota

func ComputeDisruptionQuota(
	minAvailable int32,
	config defaultconfig.Computed,
	summary podseidonv1a1.PodProtectorStatusSummary,
) DisruptionQuota

func (*DisruptionQuota) Disrupt

func (quota *DisruptionQuota) Disrupt() DisruptionResult

type DisruptionResult

type DisruptionResult uint8

func (DisruptionResult) String

func (result DisruptionResult) String() string

type IndexedInformer

type IndexedInformer struct {
	// contains filtered or unexported fields
}

func (IndexedInformer) AddPostHandler

func (ii IndexedInformer) AddPostHandler(handler func(types.NamespacedName))

func (IndexedInformer) Get

func (IndexedInformer) HasSynced

func (ii IndexedInformer) HasSynced() bool

func (IndexedInformer) Query

func (ii IndexedInformer) Query(namespace string, labels map[string]string) []types.NamespacedName

type IndexedInformerArgs

type IndexedInformerArgs struct {
	ClusterName   kube.ClusterName
	InformerPhase kube.InformerPhase
	Elector       optional.Optional[kube.ElectorArgs]
}

type IndexedInformerDeps

type IndexedInformerDeps struct {
	// contains filtered or unexported fields
}

type IndexedInformerOptions

type IndexedInformerOptions struct{}

type IndexedInformerState

type IndexedInformerState struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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