Skip to content

Commit

Permalink
fix: Check file size before saving to artifact storage. Fixes #10902 (#…
Browse files Browse the repository at this point in the history
…10903)

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed Apr 19, 2023
1 parent 0b59428 commit b846eeb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workflow/executor/executor.go
Expand Up @@ -318,6 +318,14 @@ func (we *WorkflowExecutor) saveArtifact(ctx context.Context, containerName stri
}
return err
}
fi, err := os.Stat(localArtPath)
if err != nil {
return err
}
size := fi.Size()
if size == 0 {
log.Warnf("The file %q is empty. It may not be uploaded successfully depending on the artifact driver", localArtPath)
}
return we.saveArtifactFromFile(ctx, art, fileName, localArtPath)
}

Expand Down

0 comments on commit b846eeb

Please sign in to comment.