From d5c45ac376aad746b9a2c23ba5fa303b5db5fe94 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Thu, 16 Oct 2025 16:14:23 +0000 Subject: [PATCH] printf around a bunch of deletion stuff to figure out ordering and stuckness --- internal/controllers/reconciliation/controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/controllers/reconciliation/controller.go b/internal/controllers/reconciliation/controller.go index 99c85fd8..3a048f7f 100644 --- a/internal/controllers/reconciliation/controller.go +++ b/internal/controllers/reconciliation/controller.go @@ -131,9 +131,11 @@ func (c *Controller) Reconcile(ctx context.Context, req resource.Request) (ctrl. prev, _, _ = c.resourceClient.Get(ctx, syn.UUID, req.Resource) } + fmt.Println("PAUL RECONCILING " + resource.Ref.Name) snap, current, ready, modified, err := c.reconcileResource(ctx, comp, prev, resource) failingOpen := c.shouldFailOpen(resource) if failingOpen { + fmt.Println("PAUL FAILING OPEN " + resource.Ref.Name) err = nil modified = false } @@ -148,6 +150,7 @@ func (c *Controller) Reconcile(ctx context.Context, req resource.Request) (ctrl. deleted := current == nil || (current.GetDeletionTimestamp() != nil && !snap.ForegroundDeletion) || (snap.Deleted() && (snap.Orphan || snap.Disable || failingOpen)) // orphaning should be reflected on the status. + fmt.Printf("PAUL %s resource is not ready or pending deletion : deleted=%t\n", resource.Ref.Name, deleted) c.writeBuffer.PatchStatusAsync(ctx, &resource.ManifestRef, patchResourceState(deleted, ready)) return c.requeue(logger, snap, ready) @@ -218,6 +221,7 @@ func (c *Controller) reconcileSnapshot(ctx context.Context, comp *apiv1.Composit if err != nil { return true, client.IgnoreNotFound(fmt.Errorf("deleting resource: %w", err)) } + fmt.Println("PAUL " + res.Ref.Name + " resource is not ready or pending deletion") logger.V(0).Info("deleted resource") return true, nil } @@ -387,6 +391,7 @@ func (c *Controller) requeue(logger logr.Logger, resource *resource.Snapshot, re pendingForegroundDeletion := (resource != nil && resource.Deleted() && !resource.Disable && resource.ForegroundDeletion) if ready == nil || pendingForegroundDeletion { + fmt.Println("PAUL " + resource.Ref.Name + " resource is not ready or pending deletion") return ctrl.Result{RequeueAfter: wait.Jitter(c.readinessPollInterval, 0.1)}, nil }