Skip to content

Commit fac12df

Browse files
committed
skip PRs in syncmanager that have sync disabled
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent ade0c40 commit fac12df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/controller/syncmanager/controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,16 @@ func getPublishedResourceKey(pr *syncagentv1alpha1.PublishedResource) string {
408408
return fmt.Sprintf("%s-%s", pr.UID, pr.ResourceVersion)
409409
}
410410

411+
func isSyncEnabled(pr *syncagentv1alpha1.PublishedResource) bool {
412+
return pr.Spec.Synchronization == nil || pr.Spec.Synchronization.Enabled
413+
}
414+
411415
func (r *Reconciler) ensureSyncControllers(ctx context.Context, log *zap.SugaredLogger, publishedResources []syncagentv1alpha1.PublishedResource) error {
412416
requiredWorkers := sets.New[string]()
413417
for _, pr := range publishedResources {
414-
requiredWorkers.Insert(getPublishedResourceKey(&pr))
418+
if isSyncEnabled(&pr) {
419+
requiredWorkers.Insert(getPublishedResourceKey(&pr))
420+
}
415421
}
416422

417423
// stop controllers that are no longer needed

0 commit comments

Comments
 (0)