Skip to content

Commit 815bbf2

Browse files
committed
Update launcher_v2 local path helper method.
Signed-off-by: agoins <[email protected]>
1 parent 1533981 commit 815bbf2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

backend/src/v2/component/launcher_v2.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func uploadOutputArtifacts(ctx context.Context, executorInput *pipelinespec.Exec
628628
}
629629

630630
// Upload artifacts from local path to remote storages.
631-
localDir, err := LocalPathForURI(outputArtifact.Uri)
631+
localDir, err := retrieveArtifactPath(outputArtifact)
632632
if err != nil {
633633
glog.Warningf("Output Artifact %q does not have a recognized storage URI %q. Skipping uploading to remote storage.", name, outputArtifact.Uri)
634634
} else if !strings.HasPrefix(outputArtifact.Uri, "oci://") {
@@ -994,6 +994,16 @@ func LocalPathForURI(uri string) (string, error) {
994994
return "", fmt.Errorf("failed to generate local path for URI %s: unsupported storage scheme", uri)
995995
}
996996

997+
func retrieveArtifactPath(artifact *pipelinespec.RuntimeArtifact) (string, error) {
998+
// If artifact custom path is set, use custom path. Otherwise, use URI.
999+
customPath := artifact.CustomPath
1000+
if customPath != nil {
1001+
return *customPath, nil
1002+
} else {
1003+
return LocalPathForURI(artifact.Uri)
1004+
}
1005+
}
1006+
9971007
func prepareOutputFolders(executorInput *pipelinespec.ExecutorInput) error {
9981008
for name, parameter := range executorInput.GetOutputs().GetParameters() {
9991009
dir := filepath.Dir(parameter.OutputFile)

0 commit comments

Comments
 (0)