Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Fix deprovisioning process in TestBroker (#2656)
Browse files Browse the repository at this point in the history
* Fix deprovisioning process in TestBroker

* Fix file format
  • Loading branch information
Piotr Jasiak authored and k8s-ci-robot committed Jun 13, 2019
1 parent 492c017 commit 87ab5c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contrib/pkg/broker/test_broker/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func CreateController() controller.Controller {
"2f2e85b5-030d-4776-ba7e-e26eb312f10f",
"A test service that only has a single plan",
"35b6030d-f81e-49cd-9d1f-2f5eaec57048",
false, noHTTPError, 0, 0, 0, 0),
false, http.StatusBadRequest, 0, 0, 0, 0),
newTestService(
"test-service-provision-fail400",
"308c0400-2edb-45d6-a63e-67f18226a404",
Expand Down Expand Up @@ -226,6 +226,7 @@ func CreateController() controller.Controller {
Bindable: true,
PlanUpdateable: true,
},
DeprovisionFailTimes: 0,
},
{
Service: brokerapi.Service{
Expand Down Expand Up @@ -318,6 +319,7 @@ func CreateController() controller.Controller {
Bindable: true,
PlanUpdateable: true,
},
DeprovisionFailTimes: 0,
},
}

Expand Down Expand Up @@ -573,7 +575,8 @@ func (c *testController) RemoveServiceInstance(
}, nil
}

if instance.deprovisionAttempts <= service.DeprovisionFailTimes {
if service.DeprovisionFailTimes > 0 && instance.deprovisionAttempts < service.DeprovisionFailTimes {
instance.deprovisionAttempts++
return nil, server.NewErrorWithHTTPStatus("Service is configured to fail deprovisioning", service.HTTPErrorStatus)
}

Expand Down

0 comments on commit 87ab5c4

Please sign in to comment.