From 1bf95ef96c78b26c7a245c6efe83ad589205d222 Mon Sep 17 00:00:00 2001 From: sid8489 Date: Wed, 6 Mar 2024 13:55:32 +0530 Subject: [PATCH] fix: Skip CA Secret Upsert for Namespace in Terminating state Signed-off-by: sid8489 --- pkg/controller/vault/vault_controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/vault/vault_controller.go b/pkg/controller/vault/vault_controller.go index b2c1418d..138993b2 100644 --- a/pkg/controller/vault/vault_controller.go +++ b/pkg/controller/vault/vault_controller.go @@ -2100,6 +2100,10 @@ func (r *ReconcileVault) distributeCACertificate(ctx context.Context, v *vaultv1 } for _, namespace := range namespaceList.Items { + // Skip the namespace if it's being deleted + if namespace.DeletionTimestamp != nil { + continue + } namespaces = append(namespaces, namespace.Name) } } else {