-
Notifications
You must be signed in to change notification settings - Fork 382
Add --abandon and --yes flags to svcat deprovision command #2589
Add --abandon and --yes flags to svcat deprovision command #2589
Conversation
/cc @jberkhahn |
cf5e875
to
72b631e
Compare
s.Scan() | ||
|
||
err = s.Err() | ||
fmt.Fprintln(c.Output, err) |
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.
Are you sure you need to always print this?
hmm, this doesn't seem like it works. When I try to get it to deprovision an instance to a broker that I've removed on the back end, the instance says the deprovision call failed and gets stuck like this:
Is there some other thing we have to do to get it to delete the instance? |
Hmm, seems removing the finalizers gets us past this check: https://github.com/kubernetes-incubator/service-catalog/blob/master/pkg/controller/controller_instance.go#L825 but it will still try to reach out to the broker to deprovision. I'm not really sure what we want to do in this case. Will bring it up in the meeting on Monday. |
Adding a work in progress label, please remove it once you are set on this and ready for review. Thanks @taragu |
so just for comparison, here's the reconcile for deleting a binding: https://github.com/kubernetes-incubator/service-catalog/blob/master/pkg/controller/controller_binding.go#L348 I'm not seeing offhand how this succeeds while the deprovision case doesn't. Hmm. Maybe I'm doing something wrong on my end? I tested this by deploying a minibroker, registering it with service catalog, provisioning an instance, and then deleting the minibroker deployment directly, and then trying to svcat deprovision --abandon the instance. |
c302a23
to
8f49c21
Compare
} | ||
|
||
si := &v1beta1.ServiceInstance{ObjectMeta: metav1.ObjectMeta{Name: c.instanceName, Namespace: c.Namespace}} | ||
if _, err = c.App.RemoveBindingFinalizerByInstance(si); err != nil { |
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.
As we discussed in SIG meeting on Monday, this is the problem. We need to remove the finalizers from this instance. This call to RemoveBindingFinalizerByInstance is removing the finalizer from any bindings related to the instance.
8f49c21
to
8625b1f
Compare
8625b1f
to
113b3a5
Compare
8bbadb1
to
3c62e6b
Compare
3c62e6b
to
ea9c051
Compare
ea9c051
to
1c729a3
Compare
1c729a3
to
0cf2e9e
Compare
0cf2e9e
to
645a642
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jberkhahn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Actually just noticed a problem right here: https://github.com/kubernetes-incubator/service-catalog/blob/645a642342ac55f0e7731518d8efd112d1575b75/cmd/svcat/binding/unbind_cmd.go#L116
This shouldn't just print the error. It should check if the error is nil or not, and return the err if it exists.
645a642
to
e95a78f
Compare
e95a78f
to
8861487
Compare
/test pull-service-catalog-integration |
/lgtm |
This PR is a
What this PR does / why we need it: Add --abandon and --yes flags to svcat deprovision command
Which issue(s) this PR fixes
Fixes #2268
Please leave this checklist in the PR comment so that maintainers can ensure a good PR.
Merge Checklist:
breaking the chart release and existing clients who provide a
flag that will get an error when they try to update