From fdc209a7a65ce4780f9b942522104e67ecc937f3 Mon Sep 17 00:00:00 2001 From: Peixuan Ding Date: Mon, 12 Apr 2021 20:48:42 -0400 Subject: [PATCH] fix(artifacts): moved transient error codes to a new file Signed-off-by: Peixuan Ding --- workflow/artifacts/s3/error_codes.go | 14 ++++++++++++++ workflow/artifacts/s3/s3.go | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 workflow/artifacts/s3/error_codes.go diff --git a/workflow/artifacts/s3/error_codes.go b/workflow/artifacts/s3/error_codes.go new file mode 100644 index 000000000000..81716e3aac5d --- /dev/null +++ b/workflow/artifacts/s3/error_codes.go @@ -0,0 +1,14 @@ +package s3 + +// s3TransientErrorCodes is a list of S3 error codes that are transient (retryable) +// Reference: https://github.com/minio/minio-go/blob/92fe50d14294782d96402deb861d442992038109/retry.go#L90-L102 +var s3TransientErrorCodes = []string{ + "InternalError", + "RequestTimeout", + "Throttling", + "ThrottlingException", + "RequestLimitExceeded", + "RequestThrottled", + "InternalError", + "SlowDown", +} diff --git a/workflow/artifacts/s3/s3.go b/workflow/artifacts/s3/s3.go index a6415f5da175..7a9f5b3e5fef 100644 --- a/workflow/artifacts/s3/s3.go +++ b/workflow/artifacts/s3/s3.go @@ -31,19 +31,6 @@ type ArtifactDriver struct { Context context.Context } -// s3TransientErrorCodes is a list of S3 error codes that are transient (retryable) -// Reference: https://github.com/minio/minio-go/blob/92fe50d14294782d96402deb861d442992038109/retry.go#L90-L102 -var s3TransientErrorCodes = []string{ - "InternalError", - "RequestTimeout", - "Throttling", - "ThrottlingException", - "RequestLimitExceeded", - "RequestThrottled", - "InternalError", - "SlowDown", -} - var ( _ artifactscommon.ArtifactDriver = &ArtifactDriver{} defaultRetry = wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}