From 219725d9f02b690cf0829a21faf092a3e4c65531 Mon Sep 17 00:00:00 2001 From: b4sus Date: Thu, 3 Oct 2024 13:39:03 -0700 Subject: [PATCH] fix(backend): randomizing output uri path to avoid overwriting. Fixes #10186 (#11243) Signed-off-by: b4sus --- backend/src/v2/driver/driver.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/v2/driver/driver.go b/backend/src/v2/driver/driver.go index aeeda9b6a48..12d7a377182 100644 --- a/backend/src/v2/driver/driver.go +++ b/backend/src/v2/driver/driver.go @@ -272,7 +272,7 @@ func Container(ctx context.Context, opts Options, mlmd *metadata.Client, cacheCl execution.Condition = &willTrigger } if execution.WillTrigger() { - executorInput.Outputs = provisionOutputs(pipeline.GetPipelineRoot(), opts.Task.GetTaskInfo().GetName(), opts.Component.GetOutputDefinitions()) + executorInput.Outputs = provisionOutputs(pipeline.GetPipelineRoot(), opts.Task.GetTaskInfo().GetName(), opts.Component.GetOutputDefinitions(), uuid.NewString()) } ecfg, err := metadata.GenerateExecutionConfig(executorInput) @@ -1227,7 +1227,7 @@ func resolveInputs(ctx context.Context, dag *metadata.DAG, iterationIndex *int, return inputs, nil } -func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.ComponentOutputsSpec) *pipelinespec.ExecutorInput_Outputs { +func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.ComponentOutputsSpec, outputUriSalt string) *pipelinespec.ExecutorInput_Outputs { outputs := &pipelinespec.ExecutorInput_Outputs{ Artifacts: make(map[string]*pipelinespec.ArtifactList), Parameters: make(map[string]*pipelinespec.ExecutorInput_OutputParameter), @@ -1239,7 +1239,7 @@ func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.C { // Do not preserve the query string for output artifacts, as otherwise // they'd appear in file and artifact names. - Uri: metadata.GenerateOutputURI(pipelineRoot, []string{taskName, name}, false), + Uri: metadata.GenerateOutputURI(pipelineRoot, []string{taskName, outputUriSalt, name}, false), Type: artifact.GetArtifactType(), Metadata: artifact.GetMetadata(), },