Skip to content

Commit 361114a

Browse files
committed
remove accidental debug leftover
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 333b6e4 commit 361114a

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

internal/controller/syncmanager/controller.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,9 @@ func (r *Reconciler) reconcile(ctx context.Context, log *zap.SugaredLogger, vwUR
244244
// Filter out those that have not been processed into APIResourceSchemas yet; starting
245245
// sync controllers too early, before the schemes are available, will make the watches
246246
// not work properly.
247+
// Also remove those PRs that have sync disabled.
247248
pubResources := slices.DeleteFunc(pubResList.Items, func(pr syncagentv1alpha1.PublishedResource) bool {
248-
return pr.Status.ResourceSchemaName == ""
249+
return pr.Status.ResourceSchemaName == "" || !isSyncEnabled(&pr)
249250
})
250251

251252
// make sure that for every PublishedResource, a matching sync controller exists
@@ -423,9 +424,7 @@ func isSyncEnabled(pr *syncagentv1alpha1.PublishedResource) bool {
423424
func (r *Reconciler) ensureSyncControllers(ctx context.Context, log *zap.SugaredLogger, publishedResources []syncagentv1alpha1.PublishedResource) error {
424425
requiredWorkers := sets.New[string]()
425426
for _, pr := range publishedResources {
426-
if isSyncEnabled(&pr) {
427-
requiredWorkers.Insert(getPublishedResourceKey(&pr))
428-
}
427+
requiredWorkers.Insert(getPublishedResourceKey(&pr))
429428
}
430429

431430
// stop controllers that are no longer needed
@@ -445,10 +444,6 @@ func (r *Reconciler) ensureSyncControllers(ctx context.Context, log *zap.Sugared
445444

446445
// start missing controllers
447446
for _, pubRes := range publishedResources {
448-
if !isSyncEnabled(&pubRes) {
449-
continue
450-
}
451-
452447
key := getPublishedResourceKey(&pubRes)
453448

454449
// controller already exists

test/e2e/sync/related_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,9 +1524,6 @@ func TestSyncNonStandardRelatedResourcesMultipleAPIExports(t *testing.T) {
15241524
t.Fatalf("Failed to create related object: %v", err)
15251525
}
15261526

1527-
t.Log("sove...")
1528-
time.Sleep(30 * time.Second)
1529-
15301527
// wait for the agents to do their magic
15311528
t.Log("Wait for related object to be synced…")
15321529
projectedGVR := projection.RelatedResourceProjectedGVR(&testcase.relatedConfig)

0 commit comments

Comments
 (0)