From 0754cc033b9a7437fc9722b86a5715b0ce261687 Mon Sep 17 00:00:00 2001 From: "Charel Baum (external expert on behalf of DB InfraGO AG)" Date: Thu, 15 Feb 2024 10:40:31 +0100 Subject: [PATCH] fix(database): skip isUpToDate on deletion Signed-off-by: Charel Baum (external expert on behalf of DB InfraGO AG) --- pkg/controller/database/rdsinstance/rdsinstance.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/database/rdsinstance/rdsinstance.go b/pkg/controller/database/rdsinstance/rdsinstance.go index 82777131fe..3028e0ef19 100644 --- a/pkg/controller/database/rdsinstance/rdsinstance.go +++ b/pkg/controller/database/rdsinstance/rdsinstance.go @@ -161,11 +161,16 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex cr.Status.SetConditions(xpv1.Unavailable()) } + if meta.WasDeleted(cr) { // There is no need to run isUpToDate if the resource is deleted + return managed.ExternalObservation{ + ResourceExists: true, + }, nil + } + var upToDate bool var diff string upToDate, diff, e.cache.AddTags, e.cache.RemoveTags, err = rds.IsUpToDate(ctx, e.kube, cr, instance) - if err != nil { return managed.ExternalObservation{}, errorutils.Wrap(err, errUpToDateFailed) }