chore: processUsesSteps now handle ps.Finally tasks too
@@ -12,6 +12,7 @@ import (
"time"
"github.com/pkg/errors"
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"
@@ -256,14 +257,20 @@ func processUsesSteps(resolver *UsesResolver, prs *tektonv1beta1.PipelineRun) er
if ps == nil {
return nil
}
- for i := range ps.Tasks {
- pt := &ps.Tasks[i]
+ tasksAndFinally := [][]v1beta1.PipelineTask{
+ ps.Tasks,
+ ps.Finally,
+ }
+ for i := range tasksAndFinally {
+ pipelineTasks := tasksAndFinally[i]
+ for j := range pipelineTasks {
+ pt := &pipelineTasks[j]
if pt.TaskSpec != nil {
ts := &pt.TaskSpec.TaskSpec
clearStepTemplateImage := false
var steps []tektonv1beta1.Step
- for j := range ts.Steps {
- step := ts.Steps[j]
+ for k := range ts.Steps {
+ step := ts.Steps[k]
image := step.Image
if image == "" && ts.StepTemplate != nil {
// lets default to the step image so we can share uses across steps
@@ -297,6 +304,8 @@ func processUsesSteps(resolver *UsesResolver, prs *tektonv1beta1.PipelineRun) er
}
}
}
+ }
+
return nil
}
