watchers

package
v0.0.0-...-129a5e9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapWatcherFilter

func ConfigMapWatcherFilter(r reconciler.Reconciler, ctx context.Context, obj client.Object, inCluster ...bool)

ConfigMapWatcherFilter is a data-driven filter function for watching ConfigMaps. It uses the reconciler's WatcherConfig to determine which deployments to restart when a ConfigMap changes.

The filter handles two types of configmaps: 1. System configmaps (e.g., OpenShift CA bundle) - defined in WatcherConfig.ConfigMaps.SystemResources 2. Annotated configmaps (user-provided from CR) - marked with utils.WatcherAnnotationKey

For system configmaps, it uses the AffectedDeployments from WatcherConfig. For annotated configmaps, it looks up the deployment mapping in WatcherConfig.AnnotatedConfigMapMapping.

This function directly restarts affected deployments and does not trigger reconciliation.

func SecretWatcherFilter

func SecretWatcherFilter(r reconciler.Reconciler, ctx context.Context, obj client.Object, inCluster ...bool)

SecretWatcherFilter is a data-driven filter function for watching Secrets. It uses the reconciler's WatcherConfig to determine which deployments to restart when a Secret changes.

The filter handles two types of secrets: 1. System secrets (e.g., telemetry pull secret) - defined in WatcherConfig.Secrets.SystemResources 2. Annotated secrets (user-provided from CR) - marked with utils.WatcherAnnotationKey

For system secrets, it uses the AffectedDeployments from WatcherConfig. For annotated secrets, it looks up the deployment mapping in WatcherConfig.AnnotatedSecretMapping.

This function directly restarts affected deployments and does not trigger reconciliation.

Types

type ConfigMapUpdateHandler

type ConfigMapUpdateHandler struct {
	Reconciler reconciler.Reconciler
}

ConfigMapUpdateHandler handles update events for ConfigMaps and triggers deployment restarts when data changes.

func (*ConfigMapUpdateHandler) Create

Create implements handler.EventHandler - handle creation of watched configmaps This handles the case where a watched configmap is created or recreated. Instead of triggering full reconciliation, we check if the configmap is referenced in the CR, annotate it if needed, and directly trigger deployment restarts.

func (*ConfigMapUpdateHandler) Delete

Delete implements handler.EventHandler - we don't care about deletes

func (*ConfigMapUpdateHandler) Generic

Generic implements handler.EventHandler - we don't use generic events

func (*ConfigMapUpdateHandler) Update

Update implements handler.EventHandler - this is where we check if configmap data changed

type RestartFunc

type RestartFunc func(reconciler.Reconciler, context.Context, ...*appsv1.Deployment) error

RestartFunc is a function that restarts a deployment

type SecretUpdateHandler

type SecretUpdateHandler struct {
	Reconciler reconciler.Reconciler
}

SecretUpdateHandler handles update events for Secrets and triggers deployment restarts when data changes.

func (*SecretUpdateHandler) Create

Create implements handler.EventHandler - handle creation of watched secrets This handles the case where a watched secret is created or recreated. Instead of triggering full reconciliation, we check if the secret is referenced in the CR, annotate it if needed, and directly trigger deployment restarts.

func (*SecretUpdateHandler) Delete

Delete implements handler.EventHandler - we don't care about deletes

func (*SecretUpdateHandler) Generic

Generic implements handler.EventHandler - we don't use generic events

func (*SecretUpdateHandler) Update

Update implements handler.EventHandler - this is where we check if secret data changed

Jump to

Keyboard shortcuts

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