From e627634184fac8e51a19c42a85bcbb4caffe5806 Mon Sep 17 00:00:00 2001
From: Hidde Beydals <hello@hidde.co>
Date: Fri, 9 Apr 2021 09:45:04 +0200
Subject: [PATCH] Detect suspended Kustomization in bootstrap

Signed-off-by: Hidde Beydals <hello@hidde.co>
---
 internal/bootstrap/bootstrap.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go
index bb265a57..45fc0803 100644
--- a/internal/bootstrap/bootstrap.go
+++ b/internal/bootstrap/bootstrap.go
@@ -160,6 +160,11 @@ func kustomizationReconciled(ctx context.Context, kube client.Client, objKey cli
 			return false, err
 		}
 
+		// Detect suspended Kustomization, as this would result in an endless wait
+		if kustomization.Spec.Suspend {
+			return false, fmt.Errorf("Kustomization is suspended")
+		}
+
 		// Confirm the state we are observing is for the current generation
 		if kustomization.Generation != kustomization.Status.ObservedGeneration {
 			return false, nil
-- 
GitLab