@@ -121,13 +121,13 @@ func isServiceBindingFailed(binding *v1beta1.ServiceBinding) bool {
121
121
return false
122
122
}
123
123
124
- // setAndUpdateOrphanMitigation is for setting the OrphanMitigationInProgress
125
- // status to true, setting the proper condition statuses, and persisting the
126
- // changes via updateServiceBindingStatus.
127
- func (c * controller ) setAndUpdateOrphanMitigation ( binding * v1beta1. ServiceBinding , toUpdate * v1beta1.ServiceBinding , instance * v1beta1. ServiceInstance , serviceClass * v1beta1. ClusterServiceClass , brokerName string , errorStr string ) error {
124
+ // setAndUpdateServiceBindingStartOrphanMitigation is for setting the
125
+ // OrphanMitigationInProgress status to true, setting the proper condition
126
+ // statuses, and persisting the changes via updateServiceBindingStatus.
127
+ func (c * controller ) setAndUpdateServiceBindingStartOrphanMitigation ( toUpdate * v1beta1.ServiceBinding ) error {
128
128
s := fmt .Sprintf (
129
129
`%s "%s/%s": Starting orphan mitgation` ,
130
- typeSB , binding .Name , binding .Namespace ,
130
+ typeSB , toUpdate .Name , toUpdate .Namespace ,
131
131
)
132
132
toUpdate .Status .OrphanMitigationInProgress = true
133
133
toUpdate .Status .OperationStartTime = nil
@@ -141,7 +141,7 @@ func (c *controller) setAndUpdateOrphanMitigation(binding *v1beta1.ServiceBindin
141
141
s ,
142
142
)
143
143
144
- c .recorder .Event (binding , corev1 .EventTypeWarning , errorServiceBindingOrphanMitigation , s )
144
+ c .recorder .Event (toUpdate , corev1 .EventTypeWarning , errorServiceBindingOrphanMitigation , s )
145
145
if _ , err := c .updateServiceBindingStatus (toUpdate ); err != nil {
146
146
return err
147
147
}
@@ -449,7 +449,7 @@ func (c *controller) reconcileServiceBinding(binding *v1beta1.ServiceBinding) er
449
449
errorBindCallReason ,
450
450
"Communication with the ServiceBroker timed out; Bind operation will not be retried: " + err .Error (),
451
451
)
452
- return c .setAndUpdateOrphanMitigation ( binding , toUpdate , instance , serviceClass , brokerName , netErr . Error () )
452
+ return c .setAndUpdateServiceBindingStartOrphanMitigation ( toUpdate )
453
453
} else if err != nil {
454
454
if httpErr , ok := osb .IsHTTPError (err ); ok {
455
455
// orphan mitigation: looking for 2xx (excluding 200), 408, 5xx
@@ -463,7 +463,7 @@ func (c *controller) reconcileServiceBinding(binding *v1beta1.ServiceBinding) er
463
463
errorBindCallReason ,
464
464
"ServiceBroker returned a failure; Bind operation will not be retried: " + err .Error (),
465
465
)
466
- return c .setAndUpdateOrphanMitigation ( binding , toUpdate , instance , serviceClass , brokerName , httpErr . Error () )
466
+ return c .setAndUpdateServiceBindingStartOrphanMitigation ( toUpdate )
467
467
}
468
468
s := fmt .Sprintf (
469
469
`Error creating ServiceBinding for ServiceInstance "%s/%s" of ClusterServiceClass (K8S: %q ExternalName: %q) at ClusterServiceBroker %q: %v` ,
@@ -573,7 +573,7 @@ func (c *controller) reconcileServiceBinding(binding *v1beta1.ServiceBinding) er
573
573
v1beta1 .ConditionTrue ,
574
574
errorReconciliationRetryTimeoutReason ,
575
575
s )
576
- return c .setAndUpdateOrphanMitigation ( binding , toUpdate , instance , serviceClass , brokerName , "too much time has elapsed" )
576
+ return c .setAndUpdateServiceBindingStartOrphanMitigation ( toUpdate )
577
577
}
578
578
579
579
if _ , err := c .updateServiceBindingStatus (toUpdate ); err != nil {
0 commit comments