Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database): skip isUpToDate on deletion #2001

Conversation

wotolom
Copy link
Contributor

@wotolom wotolom commented Feb 15, 2024

Description of your changes

for database.rdsinstance:

This fixes e.g. a common case of a missing k8s secret blocking the deletion, if it was deleted from the cluster before the MR.

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

manually

Comment on lines 164 to 165
upToDate := true
diff := ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier to read would be

Suggested change
upToDate := true
diff := ""
if meta.WasDeleted(cr) {
return managed.ExternalObservation{}, nil
}
var upToDate bool
var diff string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!

Just added ResourceExists: true, else the MR is deleted without sending a deletion-call due to never reach Delete().

@wotolom wotolom force-pushed the fix-database-rdsinstance-skip-isuptodate-on-delete branch from 128fddc to cc0fe05 Compare February 15, 2024 12:01
@MisterMX
Copy link
Collaborator

@wotolom can you rebase on the latest master to fix e2e tests?

Signed-off-by: Charel Baum (external expert on behalf of DB InfraGO AG) <charel.baum-extern@deutschebahn.com>
@wotolom wotolom force-pushed the fix-database-rdsinstance-skip-isuptodate-on-delete branch from cc0fe05 to 0754cc0 Compare February 21, 2024 09:07
Copy link
Collaborator

@MisterMX MisterMX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you very much @wotolom!

@MisterMX MisterMX merged commit 4b536aa into crossplane-contrib:master Feb 21, 2024
9 checks passed
@wotolom wotolom deleted the fix-database-rdsinstance-skip-isuptodate-on-delete branch February 21, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants