Instance never provisioned should not invoke broker#891
Conversation
|
Right now, this is an e2e that demonstrates the problem, working on the fix. |
68a5701 to
2d46035
Compare
|
ok, this should be ready for review. |
8c5068f to
b03693d
Compare
|
@derekwaynecarr rebase needed, thanks to you! |
|
This is related to #908 @derekwaynecarr let me know when this is rebased, and I'll review. |
b03693d to
0c37961
Compare
|
@arschles -- this is rebased. |
c0ef021 to
e7dda8a
Compare
|
Looks like this is haunted by the same ghost or spectre as #917: |
|
...the difference being that this didn't pass anywhere, so perhaps this is a legit failure |
| v1alpha1.InstanceConditionReady, | ||
| v1alpha1.ConditionUnknown, | ||
| errorDeprovisionCalledReason, | ||
| "Deprovision call failed. "+s) |
There was a problem hiding this comment.
Just a note, nothing necessary to do for this PR - this is the code that we'll need to change in order to fix #908
arschles
left a comment
There was a problem hiding this comment.
@derekwaynecarr looks good, I just have 2 changes - one nit and one in response code handling for the deprovision
| v1alpha1.InstanceConditionReady, | ||
| v1alpha1.ConditionFalse, | ||
| successDeprovisionReason, | ||
| successDeprovisionMessage, |
There was a problem hiding this comment.
It's not necessarily a successful deprovision in this case - only if http.StatusOK is returned. Otherwise, we should update to a failure message. I've done something similar for provision in #923
| } | ||
| } | ||
|
|
||
| func TestReconcileInstanceDeleteDoesNotInvokeBroker(t *testing.T) { |
There was a problem hiding this comment.
Can you put a comment above this func to explain basically what it's testing? A sentence or 2 is enough
e7dda8a to
237395e
Compare
237395e to
cbca747
Compare
pmorie
left a comment
There was a problem hiding this comment.
Generally LGTM, a couple little nits and one questions
|
|
||
| // if the instance is marked for deletion, handle that first. | ||
| if instance.ObjectMeta.DeletionTimestamp != nil { | ||
| glog.V(4).Infof("Soft-deleting Instance %v/%v", instance.Namespace, instance.Name) |
There was a problem hiding this comment.
I'm not sure exactly what "soft-deleting" means here - can you clarify?
There was a problem hiding this comment.
I realize now that was in the existing code, FORGIVENESS PLEASE
| return err | ||
| } | ||
| } | ||
| glog.V(4).Infof("Adding/Updating Instance %v/%v", instance.Namespace, instance.Name) |
There was a problem hiding this comment.
Not feedback about your PR, just a signpost: this is where we will have to determine whether we're doing an add or an update.
|
|
||
| // reconcileInstance is the control-loop for reconciling Instances. | ||
| func (c *controller) reconcileInstance(instance *v1alpha1.Instance) error { | ||
|
|
There was a problem hiding this comment.
Signpost, not an issue with your PR: we will need to recalculate the checksums here eventually based on the total parameter payload that we would send to broker, which may include stuff that is not in the spec (ie, content of a secret that may have changed).
| } | ||
| } | ||
|
|
||
| // TestReconcileInstanceDeleteDoesNotInvokeBroker verfies that if an instance is created that is never |
|
|
||
| // TestReconcileInstanceDeleteDoesNotInvokeBroker verfies that if an instance is created that is never | ||
| // actually provisioned the instance is able to be deleted and is not blocked by any interaction with | ||
| // a broker (since its very likely that a broker never actually existed). |
Fixes #878
If you create an Instance that references a ServiceClass that does not exist, you were never able to delete the Instance, as the controller error-ed out when the ServiceClass is not resolvable. In this scenario, the Instance is never able to be provisioned, so there is no need to gate deletion on ability to deprovision. For this PR, we do not invoke the broker upon deletion if an instance never actually provisioned.