-
Notifications
You must be signed in to change notification settings - Fork 65
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
Enable purging of CFServiceInstances #3573
Enable purging of CFServiceInstances #3573
Conversation
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.
Overall looks OK. I would request adding a test into the managed service instance controller to verify that whenever a CFServiceInstance without finalizers is being deleted (i.e. it has its DeletionTimestamp
set), the controller does not talk to the broker.
Maybe When("the instance is purged"
next to When("the instance is being deleted
0769054
to
273919d
Compare
bef485a
to
322ac66
Compare
322ac66
to
3175373
Compare
Requested chnges are done
Is there a related GitHub Issue?
Related to #3572
What is this change about?
Here we enable purging of Service Instances. We take advantage of the Owner Reference to Service Instances in the CFServiceBinding Object. This way, if purge is true, we just remove the finalizer on the CFServiceInstance, so the broker won't be contacted. Since the bindings are a child of the instance, they will be deleted.
I wanted to include a test case in the service_instance_repository_test for checking if a service binding is purged, but I did not work for some reason. At some point I found out that envtest has some drawbacks in this case. As per: https://book.kubebuilder.io/reference/envtest#testing-considerations - "One common example is garbage collection; because there are no controllers monitoring built-in resources, objects do not get deleted, even if an OwnerReference is set up". So we could not directly verify this via test case.