From 018a0abe0fb5f49c288755ae2c60b9afdc92bb5a Mon Sep 17 00:00:00 2001 From: ymmt Date: Mon, 25 Oct 2021 21:58:52 +0000 Subject: [PATCH] Fix infinite reconciliation on non-existent namespaces --- controllers/propagate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/propagate.go b/controllers/propagate.go index 92e9e78..de35d4c 100644 --- a/controllers/propagate.go +++ b/controllers/propagate.go @@ -162,6 +162,9 @@ func (r *PropagateController) handleDelete(ctx context.Context, req ctrl.Request ns := &corev1.Namespace{} if err := r.Get(ctx, client.ObjectKey{Name: req.Namespace}, ns); err != nil { + if apierrors.IsNotFound(err) { + return nil + } return fmt.Errorf("failed to get namespace %s: %w", req.Namespace, err) }