Skip to content

Commit

Permalink
fix(database): skip isUpToDate on deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Charel Baum (external expert on behalf of DB InfraGO AG) <charel.baum-extern@deutschebahn.com>
  • Loading branch information
Charel Baum (external expert on behalf of DB InfraGO AG) committed Feb 15, 2024
1 parent f759905 commit cc0fe05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/database/rdsinstance/rdsinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit cc0fe05

Please sign in to comment.