From 0c6cd04a40451fda93c5ced1df867eba564964ef Mon Sep 17 00:00:00 2001 From: Jawed khelil Date: Mon, 16 Sep 2024 16:20:44 +0200 Subject: [PATCH] fix ValidateStepResultsVariables and validateTaskResultsVariables --- pkg/apis/pipeline/v1/task_validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/pipeline/v1/task_validation.go b/pkg/apis/pipeline/v1/task_validation.go index 4232d295d2b..23b508858d4 100644 --- a/pkg/apis/pipeline/v1/task_validation.go +++ b/pkg/apis/pipeline/v1/task_validation.go @@ -647,6 +647,7 @@ func validateTaskResultsVariables(ctx context.Context, steps []Step, results []T for _, r := range results { resultsNames.Insert(r.Name) } + for idx, step := range steps { errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(step.Script, "results", resultsNames).ViaField("script").ViaFieldIndex("steps", idx)) } @@ -859,6 +860,5 @@ func ValidateStepResultsVariables(ctx context.Context, results []StepResult, scr resultsNames.Insert(r.Name) } errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(script, "step.results", resultsNames).ViaField("script")) - errs = errs.Also(substitution.ValidateNoReferencesToUnknownVariables(script, "results", resultsNames).ViaField("script")) return errs }