Skip to content

Commit

Permalink
Add Deadline Exceeded to transient error
Browse files Browse the repository at this point in the history
Sometime webhook or git server might take time, so we need to
add deadline exceeded to transient error.
  • Loading branch information
khrm committed Apr 18, 2024
1 parent fbed78f commit 847023d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/reconciler/taskrun/resources/taskref.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"slices"
"strings"

v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
Expand Down Expand Up @@ -282,7 +283,9 @@ func (l *LocalStepActionRefResolver) GetStepAction(ctx context.Context, name str

// IsErrTransient returns true if an error returned by GetTask/GetStepAction is retryable.
func IsErrTransient(err error) bool {
return strings.Contains(err.Error(), errEtcdLeaderChange)
return slices.ContainsFunc([]string{errEtcdLeaderChange, context.DeadlineExceeded.Error()}, func(s string) bool {
return strings.Contains(err.Error(), s)
})
}

// convertClusterTaskToTask converts deprecated v1beta1 ClusterTasks to Tasks for
Expand Down

0 comments on commit 847023d

Please sign in to comment.