Skip to content

Commit

Permalink
fix: check for errors when finding artifacts
Browse files Browse the repository at this point in the history
Attempt to fix argoproj/argo-workflows#13248

`fi` is null in the stack trace, and `err` isn't being checked
here. So check `err` and don't attempt to continue.

Signed-off-by: Alan Clucas <[email protected]>
  • Loading branch information
Joibel committed Jun 26, 2024
1 parent 8be8da6 commit 3bd1433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ func generatePutTasks(keyPrefix, rootPath string) chan uploadTask {
rootPath = filepath.Clean(rootPath) + string(os.PathSeparator)
uploadTasks := make(chan uploadTask)
go func() {
_ = filepath.Walk(rootPath, func(localPath string, fi os.FileInfo, _ error) error {
_ = filepath.Walk(rootPath, func(localPath string, fi os.FileInfo, err error) error {
if err != nil {
log.WithFields(log.Fields{"localPath": localPath}).Error("Failed to walk artifacts path", err)
return err
}
relPath := strings.TrimPrefix(localPath, rootPath)
if fi.IsDir() {
return nil
Expand Down

0 comments on commit 3bd1433

Please sign in to comment.