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

Commit

Permalink
removing redundant check for status code
Browse files Browse the repository at this point in the history
  • Loading branch information
arschles committed Jun 13, 2017
1 parent 1eb76bd commit 17a1e1e
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions pkg/controller/controller_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (c *controller) reconcileInstance(instance *v1alpha1.Instance) error {
return fmt.Errorf("Couldn't create a key for object %+v: %v", instance, err)
}
c.pollingQueue.Add(key)
} else if respCode == http.StatusCreated || respCode == http.StatusOK {
} else {
// the broker returned a successful, non-asynchronous response
glog.V(5).Infof("Successfully provisioned Instance %v/%v of ServiceClass %v at Broker %v: response: %v", instance.Namespace, instance.Name, serviceClass.Name, brokerName, response)

Expand All @@ -231,20 +231,6 @@ func (c *controller) reconcileInstance(instance *v1alpha1.Instance) error {
return err
}
c.recorder.Eventf(instance, api.EventTypeNormal, successProvisionReason, successProvisionMessage)
} else {
// the broker returned a failure response
errorProvisionCalledMessage := fmt.Sprintf("provision call failed")
if err := c.updateInstanceCondition(
instance,
v1alpha1.InstanceConditionReady,
v1alpha1.ConditionFalse,
errorProvisionCalledReason,
errorProvisionCalledMessage,
); err != nil {
glog.Errorf("updating instance condition to failure on failed provision call (%s)", err)
return err
}
c.recorder.Eventf(instance, api.EventTypeWarning, errorProvisionCalledReason, errorProvisionCalledMessage)
}
return nil
}
Expand Down

0 comments on commit 17a1e1e

Please sign in to comment.