Skip to content

Commit

Permalink
[SAPBTPCFS-7876] Optimize handling of non-transient errors
Browse files Browse the repository at this point in the history
  • Loading branch information
I065450 committed Dec 4, 2023
1 parent 1469afe commit d1e9565
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions controllers/base_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func isTransientError(smError *sm.ServiceManagerError, log logr.Logger, resource
log.Info(fmt.Sprintf("SM returned error with status code %d", statusCode))
isTransient := isTransientStatusCode(statusCode) || isConcurrentOperationError(smError)
annotations := resource.GetAnnotations()
if !isTransient && statusCode == http.StatusBadRequest && annotations != nil {
if !isTransient && statusCode != http.StatusInternalServerError && annotations != nil {
if _, ok := annotations[api.IgnoreNonTransientErrorAnnotation]; ok {
log.Info("ignoreNonTransientErrorAnnotation checking timeout")
timeoutReached := true
Expand Down Expand Up @@ -379,10 +379,6 @@ func (r *BaseReconciler) markAsNonTransientError(ctx context.Context, operationT
if err != nil {
return ctrl.Result{}, err
}
err = r.removeIgnoreNonTransientErrorAnnotation(ctx, object)
if err != nil {
return ctrl.Result{}, err
}
if operationType == smClientTypes.DELETE {
return ctrl.Result{}, fmt.Errorf(errMsg)
}
Expand Down

0 comments on commit d1e9565

Please sign in to comment.