Skip to content

Commit

Permalink
Merge pull request #2001 from wotolom/fix-database-rdsinstance-skip-i…
Browse files Browse the repository at this point in the history
…suptodate-on-delete

fix(database): skip isUpToDate on deletion
  • Loading branch information
MisterMX committed Feb 21, 2024
2 parents 7c27367 + 0754cc0 commit 4b536aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/database/rdsinstance/rdsinstance.go
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 4b536aa

Please sign in to comment.