Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle retries when downloading artifacts from minio. Fixes #9908/#10988 #13887

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions workflow/artifacts/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ func loadS3Artifact(s3cli argos3.S3Client, inputArtifact *wfv1.Artifact, path st
if origErr == nil {
return true, nil
}

if strings.Contains(origErr.Error(), "fileName is a directory.") {
tooptoop4 marked this conversation as resolved.
Show resolved Hide resolved
// Handle directory case by checking if it's a valid directory
isDir, err := s3cli.IsDirectory(inputArtifact.S3.Bucket, inputArtifact.S3.Key)
if err != nil {
return !isTransientS3Err(err), fmt.Errorf("failed to test if %s is a directory: %v", inputArtifact.S3.Key, err)
}
if isDir {
// Proceed to get the directory contents if it's actually a directory
if err := s3cli.GetDirectory(inputArtifact.S3.Bucket, inputArtifact.S3.Key, path); err != nil {
return !isTransientS3Err(err), fmt.Errorf("failed to get directory: %v", err)
}
return true, nil
}
}

if !argos3.IsS3ErrCode(origErr, "NoSuchKey") {
return !isTransientS3Err(origErr), fmt.Errorf("failed to get file: %v", origErr)
}
Expand Down
Loading