util

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateRevisions

func CertificateRevisions(certs []*certmanagerv1.Certificate) (map[string]string, bool)

CertificateRevisions returns a map of name to revision for each certificate. It returns false if any Certificate is not ready.

func EngageFor

func EngageFor(opts []mcbuilder.EngageOptions) []mcbuilder.ForOption

EngageFor casts engage options for For. mcbuilder has no controller-wide engage setting, so the same options must be cast per builder method.

func EngageOwns

func EngageOwns(opts []mcbuilder.EngageOptions) []mcbuilder.OwnsOption

EngageOwns casts engage options for Owns.

func EngageWatches

func EngageWatches(opts []mcbuilder.EngageOptions) []mcbuilder.WatchesOption

EngageWatches casts engage options for Watches.

func EnqueueAllInNamespace

func EnqueueAllInNamespace(newList func() ctrlruntimeclient.ObjectList) mchandler.EventHandlerFunc

EnqueueAllInNamespace wakes every object the given list type yields in the changed object's namespace. The compiled controllers mount Secrets they do not own, so an ownership-based watch would never fire for them and a Deployment blocked on a missing mount would never be retried.

func EnqueueMapped

func EnqueueMapped(mapFunc ClusterMapFunc) mchandler.EventHandlerFunc

EnqueueMapped adapts a ClusterMapFunc to Watches, which takes a factory rather than a handler because the cluster is only known once it is engaged.

func FakeSingleCluster

FakeSingleCluster serves the given client for every cluster name, so a reconciler can be tested without a manager or a provider.

func GetCompiledAvailableCondition

func GetCompiledAvailableCondition(conditions []metav1.Condition, compiledName string) metav1.Condition

GetCompiledAvailableCondition adopts the Available condition published on a Compiled* object, so the source object still reports on the Deployment it no longer owns.

func GetDeploymentAvailableCondition

func GetDeploymentAvailableCondition(ctx context.Context, client ctrlruntimeclient.Client, key types.NamespacedName) (metav1.Condition, error)

func GetRootShardChildren

func GetRootShardChildren(ctx context.Context, client ctrlruntimeclient.Client, rootShard *operatorv1alpha1.RootShard) ([]operatorv1alpha1.Shard, error)

GetRootShardChildren returns all shards that are currently registered with the given root shard. The shards are sorted by name before returning.

func GetTestScheme

func GetTestScheme() *runtime.Scheme

func MutateKeys

func MutateKeys(m map[string]string, prefix, suffix string) map[string]string

MutateKeys returns a copy of m with each key wrapped by prefix and suffix.

func UpdateCondition

func UpdateCondition(conditions []metav1.Condition, newCondition metav1.Condition) []metav1.Condition

Types

type ClusterMapFunc

type ClusterMapFunc func(ctx context.Context, client ctrlruntimeclient.Client, obj ctrlruntimeclient.Object) []reconcile.Request

ClusterMapFunc is a handler.MapFunc that also gets a client, because the reverse lookups these controllers watch on have to run against the cluster the event came from.

Jump to

Keyboard shortcuts

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