Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pkg/controller/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ func AddConfigMapController(ctx context.Context, log logr.Logger, opts Options)
}

return ctrl.NewControllerManagedBy(opts.Manager).
// Reconcile ConfigMaps but only cache metadata
For(new(corev1.ConfigMap), builder.OnlyMetadata, builder.WithPredicates(predicate.NewPredicateFuncs(func(obj client.Object) bool {
// Only process ConfigMaps with the istio configmap name
return obj.GetName() == configMapNameIstioRoot
}))).
// Reconcile ConfigMaps but only cache metadata.
// Use WithLowPriorityWhenUnchanged to deprioritize events from initial list sync and resyncs.
Watches(
&corev1.ConfigMap{},
handler.WithLowPriorityWhenUnchanged(&handler.EnqueueRequestForObject{}),
builder.OnlyMetadata,
builder.WithPredicates(predicate.NewPredicateFuncs(func(obj client.Object) bool {
// Only process ConfigMaps with the istio configmap name
return obj.GetName() == configMapNameIstioRoot
})),
).

// Watch all Namespaces. Cache whole Namespace to include Phase Status.
Watches(&corev1.Namespace{}, handler.EnqueueRequestsFromMapFunc(
Expand Down