Skip to content
Closed
Changes from 1 commit
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
17 changes: 13 additions & 4 deletions internal/cmd/controller/reconciler/bundle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@ func (r *BundleReconciler) SetupWithManager(mgr ctrl.Manager) error {
predicate.AnnotationChangedPredicate{},
predicate.LabelChangedPredicate{},
),
sharding.FilterByShardID(r.ShardID),
),
).
// Note: Maybe improve with WatchesMetadata, does it have access to labels?
Watches(
// Fan out from bundledeployment to bundle, this is useful to update the
// bundle's status fields.
&fleet.BundleDeployment{}, handler.EnqueueRequestsFromMapFunc(BundleDeploymentMapFunc(r)),
builder.WithPredicates(bundleDeploymentStatusChangedPredicate()),
builder.WithPredicates(
bundleDeploymentStatusChangedPredicate(),
sharding.FilterByShardID(r.ShardID),
Comment thread
johnjcool marked this conversation as resolved.
Outdated
),
).
Watches(
// Fan out from cluster to bundle, this is useful for targeting and templating.
Expand Down Expand Up @@ -132,16 +136,21 @@ func (r *BundleReconciler) SetupWithManager(mgr ctrl.Manager) error {
// referenced in DownstreamResources changes.
&corev1.Secret{},
handler.EnqueueRequestsFromMapFunc(r.downstreamResourceMapFunc("Secret")),
builder.WithPredicates(dataChangedPredicate()),
builder.WithPredicates(
dataChangedPredicate(),
sharding.FilterByShardID(r.ShardID),
),
).
Watches(
// Fan out from configmap to bundle, reconcile bundles when a configmap
// referenced in DownstreamResources changes.
&corev1.ConfigMap{},
handler.EnqueueRequestsFromMapFunc(r.downstreamResourceMapFunc("ConfigMap")),
builder.WithPredicates(dataChangedPredicate()),
builder.WithPredicates(
dataChangedPredicate(),
sharding.FilterByShardID(r.ShardID),
),
).
WithEventFilter(sharding.FilterByShardID(r.ShardID)).
WithOptions(controller.Options{MaxConcurrentReconciles: r.Workers}).
Complete(r)
}
Expand Down