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

CLOUDP-178754: Deletion Protection for Data Federation #1044

Merged
merged 8 commits into from
Aug 11, 2023

Conversation

roothorp
Copy link
Collaborator

@roothorp roothorp commented Jul 21, 2023

All Submissions:

  • Have you signed our CLA?
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if there is one).
  • Update docs/release-notes/release-notes.md if your changes should be included in the release notes for the next release.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2023

@roothorp
Copy link
Collaborator Author

Based as best I could off @helderjs' #1028 - please let me know if I missed anything.

@roothorp roothorp force-pushed the cloudp-178754-deletion-protection-datafederation branch from 17ff66e to bdb1bf4 Compare July 28, 2023 12:28
Base automatically changed from deletion-protection-main to main August 2, 2023 16:41
@roothorp roothorp force-pushed the cloudp-178754-deletion-protection-datafederation branch from 384727b to e64418c Compare August 7, 2023 11:20
Copy link
Collaborator

@helderjs helderjs left a comment

Choose a reason for hiding this comment

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

All good, there's a last comment related to some refactoring done.

Comment on lines 224 to 229
return ctrl.NewControllerManagedBy(mgr).
Named("AtlasDataFederation").
For(&mdbv1.AtlasDataFederation{}, builder.WithPredicates(r.GlobalPredicates...)).
Complete(r)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to revert this or properly handle the delete event. There's a cleanup step which doesn't execute with this configuration. This line in the old code is responsible for keeping it in the flow.

err = c.Watch(&source.Kind{Type: &mdbv1.AtlasDataFederation{}}, &watch.EventHandlerWithDelete{Controller: r}, r.GlobalPredicates...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can use Watches() which looks to be the same as For(), but you can specify the event.

@roothorp roothorp force-pushed the cloudp-178754-deletion-protection-datafederation branch from b472b40 to d19614d Compare August 10, 2023 10:05
return nil
return ctrl.NewControllerManagedBy(mgr).
Named("AtlasDataFederation").
Watches(&source.Kind{Type: &mdbv1.AtlasDataFederation{}}, &watch.EventHandlerWithDelete{Controller: r}, builder.WithPredicates(r.GlobalPredicates...)).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks very strange to me, but it does the same as before using the builder interface. We should visit this later.

@roothorp roothorp merged commit b2f37bd into main Aug 11, 2023
38 checks passed
@roothorp roothorp deleted the cloudp-178754-deletion-protection-datafederation branch August 11, 2023 09:48
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.

3 participants