postgres database finalizer#1750
postgres database finalizer#1750limak9182 wants to merge 4 commits intofeature/database-controllersfrom
Conversation
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
| return r.updateStatus(ctx, postgresDB, conditionType, conditionStatus, reason, message, phase) | ||
| } | ||
|
|
||
| // Finalizer logic: clean up managed users and databases from CNPG when PostgresDatabase is deleted |
There was a problem hiding this comment.
according to the ERD we should also have a way to say if database should be retained or removed. We already reflected this in DatabaseDefinition struct. If deleted we should remove it, but in case of retained we should probably keep cnpg Database CR available
| } | ||
|
|
||
| // Finalizer logic: clean up managed users and databases from CNPG when PostgresDatabase is deleted | ||
| if !postgresDB.ObjectMeta.DeletionTimestamp.IsZero() { |
There was a problem hiding this comment.
should we have a higher finalizer function that wraps it for the sake of readability? we could then also simplify status management
| return fmt.Errorf("failed to list CNPG Databases for cleanup: %w", err) | ||
| } | ||
|
|
||
| for i := range cnpgDBList.Items { |
There was a problem hiding this comment.
you can do for _, db := range cnpgDBList.Items without using index to get the db
Description
What does this PR have in it?
Key Changes
Highlight the updates in specific files
Testing and Verification
How did you test these changes? What automated tests are added?
Related Issues
Jira tickets, GitHub issues, Support tickets...
PR Checklist