From 896034a8e6bac19339e37b3ae123090152f9edd2 Mon Sep 17 00:00:00 2001 From: Michael Riesberg-Timmer Date: Wed, 7 Aug 2024 17:12:52 +0000 Subject: [PATCH] fix(controller): Finish loop early when a PDB is deleted to avoid StorageErrors Signed-off-by: Michael Riesberg-Timmer --- controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controller.go b/controller.go index 093db5c..b27e31f 100644 --- a/controller.go +++ b/controller.go @@ -208,6 +208,10 @@ func (n *PDBController) reconcilePDBs(ctx context.Context, desiredPDBs, managedP "namespace": managedPDB.Namespace, "selector": managedPDB.Spec.Selector.String(), }).Info("") + + // If we delete a PDB then we don't want to attempt to update it later since this will + // result in a `StorageError` since we can't find the PDB to make an update to it. + continue } // check if PDBs are equal an only update if not