@@ -23,6 +23,7 @@ import (
2323
2424 v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
2525 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
26+ clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
2627 resolutionutil "github.com/tektoncd/pipeline/pkg/internal/resolution"
2728 "github.com/tektoncd/pipeline/pkg/trustedresources"
2829 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -51,7 +52,7 @@ type GetTaskRun func(string) (*v1.TaskRun, error)
5152// GetTaskData will retrieve the Task metadata and Spec associated with the
5253// provided TaskRun. This can come from a reference Task or from the TaskRun's
5354// metadata and embedded TaskSpec.
54- func GetTaskData (ctx context.Context , taskRun * v1.TaskRun , getTask GetTask , getStepAction GetStepAction ) (* resolutionutil.ResolvedObjectMeta , * v1.TaskSpec , error ) {
55+ func GetTaskData (ctx context.Context , taskRun * v1.TaskRun , getTask GetTask ) (* resolutionutil.ResolvedObjectMeta , * v1.TaskSpec , error ) {
5556 taskMeta := metav1.ObjectMeta {}
5657 taskSpec := v1.TaskSpec {}
5758 var refSource * v1.RefSource
@@ -89,13 +90,6 @@ func GetTaskData(ctx context.Context, taskRun *v1.TaskRun, getTask GetTask, getS
8990 return nil , nil , fmt .Errorf ("taskRun %s not providing TaskRef or TaskSpec" , taskRun .Name )
9091 }
9192
92- steps , err := extractStepActions (ctx , taskSpec , getStepAction )
93- if err != nil {
94- return nil , nil , err
95- } else {
96- taskSpec .Steps = steps
97- }
98-
9993 taskSpec .SetDefaults (ctx )
10094 return & resolutionutil.ResolvedObjectMeta {
10195 ObjectMeta : & taskMeta ,
@@ -104,13 +98,14 @@ func GetTaskData(ctx context.Context, taskRun *v1.TaskRun, getTask GetTask, getS
10498 }, & taskSpec , nil
10599}
106100
107- // extractStepActions extracts the StepActions and merges them with the inlined Step specification.
108- func extractStepActions (ctx context.Context , taskSpec v1.TaskSpec , getStepAction GetStepAction ) ([]v1.Step , error ) {
101+ // GetStepActionsData extracts the StepActions and merges them with the inlined Step specification.
102+ func GetStepActionsData (ctx context.Context , taskSpec v1.TaskSpec , tr * v1. TaskRun , tekton clientset. Interface ) ([]v1.Step , error ) {
109103 steps := []v1.Step {}
110104 for _ , step := range taskSpec .Steps {
111105 s := step .DeepCopy ()
112106 if step .Ref != nil {
113107 s .Ref = nil
108+ getStepAction := GetStepActionFunc (tekton , tr .Namespace )
114109 stepAction , _ , err := getStepAction (ctx , step .Ref .Name )
115110 if err != nil {
116111 return nil , err
0 commit comments