predicates

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManagedVPALifecycle added in v0.0.12

func ManagedVPALifecycle(managedLabel, profileKey string) predicate.Predicate

ManagedVPALifecycle returns a predicate that requeues the owning workload when a managed VPA diverges from the operator’s desired state.

This predicate is intended for workload reconcilers (e.g. DeploymentReconciler) to provide “snap-back” behavior when users manually tamper with managed VPAs.

It reacts to *operator-owned drift*, not arbitrary churn.

Semantics:

  • Create: enqueue only if the VPA is managed.
  • Update: enqueue if:
  • managed label toggled,
  • deletion started,
  • controller ownerRef changed,
  • operator-owned labels changed (managed/profile), or
  • spec changed.
  • Delete: enqueue only if the deleted VPA was managed.
  • Generic: disabled to avoid noisy resyncs.

func ManagedVPAStructuralLifecycle added in v0.0.17

func ManagedVPAStructuralLifecycle(managedLabel string) predicate.Predicate

ManagedVPAStructuralLifecycle returns a predicate that reacts only to *structural lifecycle events* of managed VPAs.

This predicate is intended for the VPAReconciler, which acts as a safety net and enforces ownership correctness.

It deliberately ignores spec, label drift, and status churn.

Semantics:

  • Create: enqueue only if the VPA is managed (label == "true").
  • Update: enqueue if:
  • managed label toggled,
  • deletion started, or
  • controller ownerRef changed.
  • Delete: enqueue only if the deleted VPA was managed.
  • Generic: disabled to avoid noisy resyncs.

func ProfileAnnotationLifecycle added in v0.0.12

func ProfileAnnotationLifecycle(annotation string) predicate.Predicate

ProfileAnnotationLifecycle returns a predicate that reacts to lifecycle events relevant to the operator’s profile annotation on workload resources (Deployments, StatefulSets, DaemonSets).

This predicate determines *when a workload should be reconciled* based on opt-in semantics controlled via an annotation.

Semantics:

  • Create: enqueue only if the workload is opted-in (annotation present and non-empty).
  • Update: enqueue if:
  • opt-in was added or removed,
  • the profile value changed, or
  • deletion has just started (for cleanup).
  • Delete: enqueue only if the workload was opted-in, so managed VPAs can be cleaned up.
  • Generic: disabled to avoid noisy resyncs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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