-
Notifications
You must be signed in to change notification settings - Fork 77
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
CLOUDP-178754: Deletion Protection for Data Federation #1044
Conversation
pkg/controller/atlasdatafederation/datafederation_controller.go
Outdated
Show resolved
Hide resolved
5e6978c
to
510ca16
Compare
17ff66e
to
bdb1bf4
Compare
pkg/controller/atlasdatafederation/datafederation_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/atlasdatafederation/datafederation_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/atlasdatafederation/datafederation_controller.go
Outdated
Show resolved
Hide resolved
pkg/controller/atlasdatafederation/datafederation_controller.go
Outdated
Show resolved
Hide resolved
c2253bd
to
9da259e
Compare
384727b
to
e64418c
Compare
There was a problem hiding this 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.
return ctrl.NewControllerManagedBy(mgr). | ||
Named("AtlasDataFederation"). | ||
For(&mdbv1.AtlasDataFederation{}, builder.WithPredicates(r.GlobalPredicates...)). | ||
Complete(r) |
There was a problem hiding this comment.
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...)
There was a problem hiding this comment.
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.
b472b40
to
d19614d
Compare
return nil | ||
return ctrl.NewControllerManagedBy(mgr). | ||
Named("AtlasDataFederation"). | ||
Watches(&source.Kind{Type: &mdbv1.AtlasDataFederation{}}, &watch.EventHandlerWithDelete{Controller: r}, builder.WithPredicates(r.GlobalPredicates...)). |
There was a problem hiding this comment.
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.
All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if there is one).