Documentation
¶
Index ¶
- func ConfigMapWatcherFilter(r reconciler.Reconciler, ctx context.Context, obj client.Object, ...)
- func SecretWatcherFilter(r reconciler.Reconciler, ctx context.Context, obj client.Object, ...)
- type ConfigMapUpdateHandler
- func (h *ConfigMapUpdateHandler) Create(ctx context.Context, evt event.CreateEvent, ...)
- func (h *ConfigMapUpdateHandler) Delete(ctx context.Context, evt event.DeleteEvent, ...)
- func (h *ConfigMapUpdateHandler) Generic(ctx context.Context, evt event.GenericEvent, ...)
- func (h *ConfigMapUpdateHandler) Update(ctx context.Context, evt event.UpdateEvent, ...)
- type RestartFunc
- type SecretUpdateHandler
- func (h *SecretUpdateHandler) Create(ctx context.Context, evt event.CreateEvent, ...)
- func (h *SecretUpdateHandler) Delete(ctx context.Context, evt event.DeleteEvent, ...)
- func (h *SecretUpdateHandler) Generic(ctx context.Context, evt event.GenericEvent, ...)
- func (h *SecretUpdateHandler) Update(ctx context.Context, evt event.UpdateEvent, ...)
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 ¶
func (h *ConfigMapUpdateHandler) Create(ctx context.Context, evt event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
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 ¶
func (h *ConfigMapUpdateHandler) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
Delete implements handler.EventHandler - we don't care about deletes
func (*ConfigMapUpdateHandler) Generic ¶
func (h *ConfigMapUpdateHandler) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
Generic implements handler.EventHandler - we don't use generic events
func (*ConfigMapUpdateHandler) Update ¶
func (h *ConfigMapUpdateHandler) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
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 ¶
func (h *SecretUpdateHandler) Create(ctx context.Context, evt event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
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 ¶
func (h *SecretUpdateHandler) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
Delete implements handler.EventHandler - we don't care about deletes
func (*SecretUpdateHandler) Generic ¶
func (h *SecretUpdateHandler) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
Generic implements handler.EventHandler - we don't use generic events
func (*SecretUpdateHandler) Update ¶
func (h *SecretUpdateHandler) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
Update implements handler.EventHandler - this is where we check if secret data changed