From a4d7fde636e3e605ecd8a4a521a78e4728bcf503 Mon Sep 17 00:00:00 2001 From: Nail Islamov Date: Sat, 4 Aug 2018 00:32:50 +0500 Subject: [PATCH] Fix panic when retry duration is exceeded (#2259) --- pkg/controller/controller_instance.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/controller/controller_instance.go b/pkg/controller/controller_instance.go index 0ec7f1e6171..79f14a21627 100644 --- a/pkg/controller/controller_instance.go +++ b/pkg/controller/controller_instance.go @@ -958,12 +958,14 @@ func (c *controller) pollServiceInstance(instance *v1beta1.ServiceInstance) erro // // The instance's Ready condition should already be False, so // we just need to record an event. - s := fmt.Sprintf("Error polling last operation: %v", err) - glog.V(4).Info(pcb.Message(s)) - c.recorder.Event(instance, corev1.EventTypeWarning, errorPollingLastOperationReason, s) + reason := errorPollingLastOperationReason + message := fmt.Sprintf("Error polling last operation: %v", err) + glog.V(4).Info(pcb.Message(message)) + c.recorder.Event(instance, corev1.EventTypeWarning, reason, message) if c.reconciliationRetryDurationExceeded(instance.Status.OperationStartTime) { - return c.processServiceInstancePollingFailureRetryTimeout(instance, nil) + readyCond := newServiceInstanceReadyCondition(v1beta1.ConditionFalse, reason, message) + return c.processServiceInstancePollingFailureRetryTimeout(instance, readyCond) } return c.continuePollingServiceInstance(instance)