Skip to content

Commit

Permalink
ignore transient error during polling
Browse files Browse the repository at this point in the history
  • Loading branch information
kerenlahav committed May 8, 2024
1 parent 6042787 commit 421cd16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/servicebinding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (r *ServiceBindingReconciler) poll(ctx context.Context, serviceBinding *ser
status, statusErr := smClient.Status(serviceBinding.Status.OperationURL, nil)
if statusErr != nil {
log.Info(fmt.Sprintf("failed to fetch operation, got error from SM: %s", statusErr.Error()), "operationURL", serviceBinding.Status.OperationURL)
utils.SetFailureConditions(serviceBinding.Status.OperationType, statusErr.Error(), serviceBinding)
utils.SetFailureConditions(serviceBinding.Status.OperationType, string(smClientTypes.INPROGRESS), serviceBinding)
freshStatus := servicesv1.ServiceBindingStatus{
Conditions: serviceBinding.GetConditions(),
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/serviceinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (r *ServiceInstanceReconciler) poll(ctx context.Context, serviceInstance *s
status, statusErr := smClient.Status(serviceInstance.Status.OperationURL, nil)
if statusErr != nil {
log.Info(fmt.Sprintf("failed to fetch operation, got error from SM: %s", statusErr.Error()), "operationURL", serviceInstance.Status.OperationURL)
utils.SetInProgressConditions(ctx, serviceInstance.Status.OperationType, statusErr.Error(), serviceInstance)
utils.SetInProgressConditions(ctx, serviceInstance.Status.OperationType, string(smClientTypes.INPROGRESS), serviceInstance)
// if failed to read operation status we cleanup the status to trigger re-sync from SM
freshStatus := servicesv1.ServiceInstanceStatus{Conditions: serviceInstance.GetConditions(), ObservedGeneration: serviceInstance.Generation}
if utils.IsMarkedForDeletion(serviceInstance.ObjectMeta) {
Expand Down

0 comments on commit 421cd16

Please sign in to comment.