@@ -324,7 +324,7 @@ func (c *controller) reconcileServiceInstanceDelete(instance *v1beta1.ServiceIns
324
324
s )
325
325
}
326
326
327
- c . clearServiceInstanceCurrentOperation (toUpdate )
327
+ clearServiceInstanceCurrentOperation (toUpdate )
328
328
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusFailed
329
329
330
330
if _ , err := c .updateServiceInstanceStatus (toUpdate ); err != nil {
@@ -466,7 +466,7 @@ func (c *controller) reconcileServiceInstanceDelete(instance *v1beta1.ServiceIns
466
466
s )
467
467
}
468
468
469
- c . clearServiceInstanceCurrentOperation (toUpdate )
469
+ clearServiceInstanceCurrentOperation (toUpdate )
470
470
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusFailed
471
471
if _ , err := c .updateServiceInstanceStatus (toUpdate ); err != nil {
472
472
return err
@@ -517,7 +517,7 @@ func (c *controller) reconcileServiceInstanceDelete(instance *v1beta1.ServiceIns
517
517
518
518
glog .V (5 ).Info (pcb .Message ("Deprovision call to broker succeeded, finalizing" ))
519
519
520
- c . clearServiceInstanceCurrentOperation (toUpdate )
520
+ clearServiceInstanceCurrentOperation (toUpdate )
521
521
toUpdate .Status .ExternalProperties = nil
522
522
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusSucceeded
523
523
@@ -877,7 +877,7 @@ func (c *controller) reconcileServiceInstance(instance *v1beta1.ServiceInstance)
877
877
reason ,
878
878
fmt .Sprintf ("ClusterServiceBroker returned a failure for %v call; operation will not be retried: %v" , provisionOrUpdateText , s ))
879
879
880
- c . clearServiceInstanceCurrentOperation (toUpdate )
880
+ clearServiceInstanceCurrentOperation (toUpdate )
881
881
882
882
if _ , err := c .updateServiceInstanceStatus (toUpdate ); err != nil {
883
883
return err
@@ -924,7 +924,7 @@ func (c *controller) reconcileServiceInstance(instance *v1beta1.ServiceInstance)
924
924
v1beta1 .ConditionFalse ,
925
925
reason ,
926
926
message )
927
- c . clearServiceInstanceCurrentOperation (toUpdate )
927
+ clearServiceInstanceCurrentOperation (toUpdate )
928
928
}
929
929
930
930
if _ , err := c .updateServiceInstanceStatus (toUpdate ); err != nil {
@@ -958,7 +958,7 @@ func (c *controller) reconcileServiceInstance(instance *v1beta1.ServiceInstance)
958
958
errorReconciliationRetryTimeoutReason ,
959
959
s )
960
960
}
961
- c . clearServiceInstanceCurrentOperation (toUpdate )
961
+ clearServiceInstanceCurrentOperation (toUpdate )
962
962
if _ , err := c .updateServiceInstanceStatus (toUpdate ); err != nil {
963
963
return err
964
964
}
@@ -1047,7 +1047,7 @@ func (c *controller) reconcileServiceInstance(instance *v1beta1.ServiceInstance)
1047
1047
))
1048
1048
1049
1049
toUpdate .Status .ExternalProperties = toUpdate .Status .InProgressProperties
1050
- c . clearServiceInstanceCurrentOperation (toUpdate )
1050
+ clearServiceInstanceCurrentOperation (toUpdate )
1051
1051
1052
1052
// TODO: process response
1053
1053
setServiceInstanceCondition (
@@ -1124,7 +1124,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1124
1124
}
1125
1125
1126
1126
if ! provisioning {
1127
- c . clearServiceInstanceCurrentOperation (toUpdate )
1127
+ clearServiceInstanceCurrentOperation (toUpdate )
1128
1128
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusFailed
1129
1129
} else {
1130
1130
c .setServiceInstanceStartOrphanMitigation (toUpdate )
@@ -1198,7 +1198,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1198
1198
message = successDeprovisionMessage
1199
1199
}
1200
1200
1201
- c . clearServiceInstanceCurrentOperation (toUpdate )
1201
+ clearServiceInstanceCurrentOperation (toUpdate )
1202
1202
toUpdate .Status .ExternalProperties = nil
1203
1203
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusSucceeded
1204
1204
@@ -1279,7 +1279,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1279
1279
}
1280
1280
1281
1281
if ! provisioning {
1282
- c . clearServiceInstanceCurrentOperation (toUpdate )
1282
+ clearServiceInstanceCurrentOperation (toUpdate )
1283
1283
} else {
1284
1284
c .setServiceInstanceStartOrphanMitigation (toUpdate )
1285
1285
}
@@ -1377,7 +1377,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1377
1377
}
1378
1378
1379
1379
if ! provisioning {
1380
- c . clearServiceInstanceCurrentOperation (toUpdate )
1380
+ clearServiceInstanceCurrentOperation (toUpdate )
1381
1381
} else {
1382
1382
c .setServiceInstanceStartOrphanMitigation (toUpdate )
1383
1383
}
@@ -1443,7 +1443,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1443
1443
toUpdate := clone .(* v1beta1.ServiceInstance )
1444
1444
1445
1445
toUpdate .Status .ExternalProperties = toUpdate .Status .InProgressProperties
1446
- c . clearServiceInstanceCurrentOperation (toUpdate )
1446
+ clearServiceInstanceCurrentOperation (toUpdate )
1447
1447
if deleting {
1448
1448
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusSucceeded
1449
1449
}
@@ -1509,7 +1509,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1509
1509
toUpdate := clone .(* v1beta1.ServiceInstance )
1510
1510
1511
1511
if ! deleting {
1512
- c . clearServiceInstanceCurrentOperation (toUpdate )
1512
+ clearServiceInstanceCurrentOperation (toUpdate )
1513
1513
setServiceInstanceCondition (
1514
1514
toUpdate ,
1515
1515
v1beta1 .ServiceInstanceConditionReady ,
@@ -1537,7 +1537,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1537
1537
glog .Info (pcb .Message (s ))
1538
1538
c .recorder .Event (instance , corev1 .EventTypeWarning , errorReconciliationRetryTimeoutReason , s )
1539
1539
1540
- c . clearServiceInstanceCurrentOperation (toUpdate )
1540
+ clearServiceInstanceCurrentOperation (toUpdate )
1541
1541
toUpdate .Status .DeprovisionStatus = v1beta1 .ServiceInstanceDeprovisionStatusFailed
1542
1542
1543
1543
setServiceInstanceCondition (
@@ -1621,7 +1621,7 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro
1621
1621
}
1622
1622
1623
1623
if ! provisioning {
1624
- c . clearServiceInstanceCurrentOperation (toUpdate )
1624
+ clearServiceInstanceCurrentOperation (toUpdate )
1625
1625
} else {
1626
1626
c .setServiceInstanceStartOrphanMitigation (toUpdate )
1627
1627
}
@@ -1980,19 +1980,6 @@ func (c *controller) recordStartOfServiceInstanceOperation(toUpdate *v1beta1.Ser
1980
1980
return c .updateServiceInstanceStatus (toUpdate )
1981
1981
}
1982
1982
1983
- // clearServiceInstanceCurrentOperation sets the fields of the instance's Status
1984
- // to indicate that there is no current operation being performed. The Status
1985
- // is *not* recorded in the registry.
1986
- func (c * controller ) clearServiceInstanceCurrentOperation (toUpdate * v1beta1.ServiceInstance ) {
1987
- toUpdate .Status .CurrentOperation = ""
1988
- toUpdate .Status .OperationStartTime = nil
1989
- toUpdate .Status .AsyncOpInProgress = false
1990
- toUpdate .Status .OrphanMitigationInProgress = false
1991
- toUpdate .Status .LastOperation = nil
1992
- toUpdate .Status .InProgressProperties = nil
1993
- toUpdate .Status .ReconciledGeneration = toUpdate .Generation
1994
- }
1995
-
1996
1983
// setServiceInstanceStartOrphanMitigation sets the fields of the instance's
1997
1984
// Status to indicate that orphan mitigation is starting. The Status is *not*
1998
1985
// recorded in the registry.
@@ -2083,6 +2070,19 @@ func (c *controller) checkForRemovedClassAndPlan(instance *v1beta1.ServiceInstan
2083
2070
return fmt .Errorf (s )
2084
2071
}
2085
2072
2073
+ // clearServiceInstanceCurrentOperation sets the fields of the instance's Status
2074
+ // to indicate that there is no current operation being performed. The Status
2075
+ // is *not* recorded in the registry.
2076
+ func clearServiceInstanceCurrentOperation (toUpdate * v1beta1.ServiceInstance ) {
2077
+ toUpdate .Status .CurrentOperation = ""
2078
+ toUpdate .Status .OperationStartTime = nil
2079
+ toUpdate .Status .AsyncOpInProgress = false
2080
+ toUpdate .Status .OrphanMitigationInProgress = false
2081
+ toUpdate .Status .LastOperation = nil
2082
+ toUpdate .Status .InProgressProperties = nil
2083
+ toUpdate .Status .ReconciledGeneration = toUpdate .Generation
2084
+ }
2085
+
2086
2086
// shouldStartOrphanMitigation returns whether an error with the given status
2087
2087
// code indicates that orphan migitation should start.
2088
2088
func shouldStartOrphanMitigation (statusCode int ) bool {
0 commit comments