Skip to content

Commit

Permalink
Correct the reasons and messages set on the ready condition during as…
Browse files Browse the repository at this point in the history
…ync polling (openshift#1235)
  • Loading branch information
pmorie authored and Jeff Peeler committed Sep 18, 2017
1 parent d2bb82f commit b0f3222
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pkg/controller/controller_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,14 +883,15 @@ func (c *controller) pollServiceInstance(serviceClass *v1alpha1.ServiceClass, se
var message string
var reason string
if deleting {
reason = asyncDeprovisioningMessage
reason = asyncDeprovisioningReason
message = asyncDeprovisioningMessage
} else {
reason = asyncProvisioningReason
message = asyncProvisioningMessage
}

if response.Description != nil {
message = fmt.Sprintf("%s (%s)", asyncProvisioningMessage, *response.Description)
} else {
message = asyncProvisioningMessage
message = fmt.Sprintf("%s (%s)", message, *response.Description)
}
c.updateServiceInstanceCondition(
toUpdate,
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/controller_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ func TestPollServiceInstanceInProgressDeprovisioningWithOperationNoFinalizer(t *
assertNumberOfActions(t, actions, 1)
action := actions[0]
updatedServiceInstance := assertUpdateStatus(t, action, instance)
assertServiceInstanceReadyFalse(t, updatedServiceInstance, asyncDeprovisioningMessage)
assertServiceInstanceReadyFalse(t, updatedServiceInstance, asyncDeprovisioningReason)

// verify no kube resources created.
// No actions
Expand Down

0 comments on commit b0f3222

Please sign in to comment.