utils

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LifecycleEnabledPredicate = predicate.NewPredicateFuncs(func(object client.Object) bool {
		if hv, ok := object.(*kvmv1.Hypervisor); ok {
			return hv.Spec.LifecycleEnabled
		}
		return true
	})
)
View Source
var StatusPatchBackoff = wait.Backoff{
	Steps:    10,
	Duration: 50 * time.Millisecond,
	Factor:   2.0,
	Jitter:   0.2,
}

StatusPatchBackoff is a retry backoff for status patches that may conflict with other controllers. Uses exponential backoff with more retries than the default to handle high contention scenarios.

Functions

func Difference added in v1.2.1

func Difference[S ~[]E, E comparable](s1, s2 S) S

Difference returns all elements in s2 that are not in s1.

func PatchHypervisorStatusWithRetry added in v1.1.0

func PatchHypervisorStatusWithRetry(ctx context.Context, c k8sclient.Client, name, fieldOwner string, updateFn func(*kvmv1.Hypervisor)) error

PatchHypervisorStatusWithRetry patches hypervisor status with retry on conflict. The updateFn receives a fresh copy of the hypervisor and should apply status changes to it. It re-fetches the resource before each retry attempt to get the latest resourceVersion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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