Skip to content

Commit

Permalink
fix: create dir when input path is not exist in oss (#12323)
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <[email protected]>
Co-authored-by: zjgemi <[email protected]>
  • Loading branch information
2 people authored and isubasinghe committed May 5, 2024
1 parent a68e1f0 commit fedfb37
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions workflow/artifacts/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func (ossDriver *ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string)
return !isTransientOSSErr(err), err
}
objectName := inputArtifact.OSS.Key
dirPath := filepath.Dir(path)
err = os.MkdirAll(dirPath, 0o700)
if err != nil {
return false, fmt.Errorf("mkdir %s error: %w", dirPath, err)
}
origErr := bucket.GetObjectToFile(objectName, path)
if origErr == nil {
return true, nil
Expand Down

0 comments on commit fedfb37

Please sign in to comment.