@@ -30,11 +30,12 @@ import (
30
30
"github.com/jonboulle/clockwork"
31
31
"github.com/tektoncd/cli/pkg/formatted"
32
32
"github.com/tektoncd/cli/test/framework"
33
- "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
33
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
34
+ "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1"
34
35
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
35
36
)
36
37
37
- func GetTask (c * framework.Clients , name string ) * v1alpha1 .Task {
38
+ func GetTask (c * framework.Clients , name string ) * v1beta1 .Task {
38
39
39
40
task , err := c .TaskClient .Get (context .Background (), name , metav1.GetOptions {})
40
41
if err != nil {
@@ -44,15 +45,15 @@ func GetTask(c *framework.Clients, name string) *v1alpha1.Task {
44
45
return task
45
46
}
46
47
47
- func GetClusterTask (c * framework.Clients , name string ) * v1alpha1 .ClusterTask {
48
+ func GetClusterTask (c * framework.Clients , name string ) * v1beta1 .ClusterTask {
48
49
clustertask , err := c .ClusterTaskClient .Get (context .Background (), name , metav1.GetOptions {})
49
50
if err != nil {
50
51
log .Fatalf ("Couldn't get expected clustertask %s" , err )
51
52
}
52
53
return clustertask
53
54
}
54
55
55
- func GetTaskList (c * framework.Clients ) * v1alpha1 .TaskList {
56
+ func GetTaskList (c * framework.Clients ) * v1beta1 .TaskList {
56
57
57
58
tasklist , err := c .TaskClient .List (context .Background (), metav1.ListOptions {})
58
59
@@ -63,15 +64,15 @@ func GetTaskList(c *framework.Clients) *v1alpha1.TaskList {
63
64
return tasklist
64
65
}
65
66
66
- func GetClusterTaskList (c * framework.Clients ) * v1alpha1 .ClusterTaskList {
67
+ func GetClusterTaskList (c * framework.Clients ) * v1beta1 .ClusterTaskList {
67
68
clustertasklist , err := c .ClusterTaskClient .List (context .Background (), metav1.ListOptions {})
68
69
if err != nil {
69
70
log .Fatalf ("Couldn't get expected clustertasklist %s" , err )
70
71
}
71
72
return clustertasklist
72
73
}
73
74
74
- func GetTaskRun (c * framework.Clients , name string ) * v1alpha1 .TaskRun {
75
+ func GetTaskRun (c * framework.Clients , name string ) * v1beta1 .TaskRun {
75
76
76
77
taskRun , err := c .TaskRunClient .Get (context .Background (), name , metav1.GetOptions {})
77
78
@@ -82,7 +83,7 @@ func GetTaskRun(c *framework.Clients, name string) *v1alpha1.TaskRun {
82
83
return taskRun
83
84
}
84
85
85
- func GetTaskRunList (c * framework.Clients ) * v1alpha1 .TaskRunList {
86
+ func GetTaskRunList (c * framework.Clients ) * v1beta1 .TaskRunList {
86
87
taskRunlist , err := c .TaskRunClient .List (context .Background (), metav1.ListOptions {})
87
88
88
89
if err != nil {
@@ -114,7 +115,7 @@ func GetPipelineResourceList(c *framework.Clients) *v1alpha1.PipelineResourceLis
114
115
return pipelineResourceList
115
116
}
116
117
117
- func GetPipeline (c * framework.Clients , name string ) * v1alpha1 .Pipeline {
118
+ func GetPipeline (c * framework.Clients , name string ) * v1beta1 .Pipeline {
118
119
119
120
pipeline , err := c .PipelineClient .Get (context .Background (), name , metav1.GetOptions {})
120
121
@@ -125,7 +126,7 @@ func GetPipeline(c *framework.Clients, name string) *v1alpha1.Pipeline {
125
126
return pipeline
126
127
}
127
128
128
- func GetPipelineList (c * framework.Clients ) * v1alpha1 .PipelineList {
129
+ func GetPipelineList (c * framework.Clients ) * v1beta1 .PipelineList {
129
130
130
131
pipelineList , err := c .PipelineClient .List (context .Background (), metav1.ListOptions {})
131
132
@@ -136,7 +137,7 @@ func GetPipelineList(c *framework.Clients) *v1alpha1.PipelineList {
136
137
return pipelineList
137
138
}
138
139
139
- func GetPipelineRun (c * framework.Clients , name string ) * v1alpha1 .PipelineRun {
140
+ func GetPipelineRun (c * framework.Clients , name string ) * v1beta1 .PipelineRun {
140
141
141
142
pipelineRun , err := c .PipelineRunClient .Get (context .Background (), name , metav1.GetOptions {})
142
143
@@ -147,7 +148,7 @@ func GetPipelineRun(c *framework.Clients, name string) *v1alpha1.PipelineRun {
147
148
return pipelineRun
148
149
}
149
150
150
- func GetPipelineRunListWithName (c * framework.Clients , pname string , sortByStartTime bool ) * v1alpha1 .PipelineRunList {
151
+ func GetPipelineRunListWithName (c * framework.Clients , pname string , sortByStartTime bool ) * v1beta1 .PipelineRunList {
151
152
opts := metav1.ListOptions {
152
153
LabelSelector : fmt .Sprintf ("tekton.dev/pipeline=%s" , pname ),
153
154
}
@@ -164,7 +165,7 @@ func GetPipelineRunListWithName(c *framework.Clients, pname string, sortByStartT
164
165
return pipelineRunList
165
166
}
166
167
167
- func GetTaskRunListByLabel (c * framework.Clients , tname string , sortByStartTime bool , label string ) * v1alpha1 .TaskRunList {
168
+ func GetTaskRunListByLabel (c * framework.Clients , tname string , sortByStartTime bool , label string ) * v1beta1 .TaskRunList {
168
169
opts := metav1.ListOptions {
169
170
LabelSelector : label ,
170
171
}
@@ -183,17 +184,17 @@ func GetTaskRunListByLabel(c *framework.Clients, tname string, sortByStartTime b
183
184
return taskRunList
184
185
}
185
186
186
- func GetTaskRunListWithTaskName (c * framework.Clients , tname string , sortByStartTime bool ) * v1alpha1 .TaskRunList {
187
+ func GetTaskRunListWithTaskName (c * framework.Clients , tname string , sortByStartTime bool ) * v1beta1 .TaskRunList {
187
188
label := fmt .Sprintf ("tekton.dev/task=%s" , tname )
188
189
return GetTaskRunListByLabel (c , tname , sortByStartTime , label )
189
190
}
190
191
191
- func GetTaskRunListWithClusterTaskName (c * framework.Clients , ctname string , sortByStartTime bool ) * v1alpha1 .TaskRunList {
192
+ func GetTaskRunListWithClusterTaskName (c * framework.Clients , ctname string , sortByStartTime bool ) * v1beta1 .TaskRunList {
192
193
label := fmt .Sprintf ("tekton.dev/clusterTask=%s" , ctname )
193
194
return GetTaskRunListByLabel (c , ctname , sortByStartTime , label )
194
195
}
195
196
196
- func GetPipelineRunList (c * framework.Clients ) * v1alpha1 .PipelineRunList {
197
+ func GetPipelineRunList (c * framework.Clients ) * v1beta1 .PipelineRunList {
197
198
198
199
pipelineRunList , err := c .PipelineRunClient .List (context .Background (), metav1.ListOptions {})
199
200
@@ -213,7 +214,7 @@ func ListResourceNamesForJSONPath(obj interface{}) string {
213
214
w := tabwriter .NewWriter (& tmplBytes , 0 , 5 , 3 , ' ' , tabwriter .TabIndent )
214
215
215
216
switch obj := obj .(type ) {
216
- case * v1alpha1 .TaskList :
217
+ case * v1beta1 .TaskList :
217
218
218
219
if len (obj .Items ) == 0 {
219
220
@@ -227,7 +228,7 @@ func ListResourceNamesForJSONPath(obj interface{}) string {
227
228
}
228
229
w .Flush ()
229
230
return tmplBytes .String ()
230
- case * v1alpha1 .TaskRunList :
231
+ case * v1beta1 .TaskRunList :
231
232
if len (obj .Items ) == 0 {
232
233
233
234
return emptyMsg
@@ -242,7 +243,7 @@ func ListResourceNamesForJSONPath(obj interface{}) string {
242
243
}
243
244
w .Flush ()
244
245
return tmplBytes .String ()
245
- case * v1alpha1 .PipelineList :
246
+ case * v1beta1 .PipelineList :
246
247
if len (obj .Items ) == 0 {
247
248
return emptyMsg
248
249
}
@@ -255,7 +256,7 @@ func ListResourceNamesForJSONPath(obj interface{}) string {
255
256
w .Flush ()
256
257
return tmplBytes .String ()
257
258
258
- case * v1alpha1 .PipelineRunList :
259
+ case * v1beta1 .PipelineRunList :
259
260
if len (obj .Items ) == 0 {
260
261
return emptyMsg
261
262
}
@@ -279,7 +280,7 @@ func ListResourceNamesForJSONPath(obj interface{}) string {
279
280
}
280
281
w .Flush ()
281
282
return tmplBytes .String ()
282
- case * v1alpha1 .ClusterTaskList :
283
+ case * v1beta1 .ClusterTaskList :
283
284
if len (obj .Items ) == 0 {
284
285
return emptyMsg
285
286
}
@@ -367,7 +368,7 @@ func ListAllClusterTasksOutput(t *testing.T, cs *framework.Clients, td map[int]i
367
368
return tmplBytes .String ()
368
369
}
369
370
370
- func GetTaskListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1alpha1 .TaskList {
371
+ func GetTaskListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1beta1 .TaskList {
371
372
t .Helper ()
372
373
373
374
tasklist := GetTaskList (c )
@@ -393,7 +394,7 @@ func GetTaskListWithTestData(t *testing.T, c *framework.Clients, td map[int]inte
393
394
return tasklist
394
395
}
395
396
396
- func GetClusterTaskListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1alpha1 .ClusterTaskList {
397
+ func GetClusterTaskListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1beta1 .ClusterTaskList {
397
398
t .Helper ()
398
399
399
400
clustertasklist := GetClusterTaskList (c )
@@ -445,7 +446,7 @@ NAME STARTED DURATION STATUS{{- if $.AllNamespaces }} NAMESPACE{{- end }}
445
446
SortByStartTimeTaskRun (taskrun .Items )
446
447
}
447
448
var data = struct {
448
- TaskRuns * v1alpha1 .TaskRunList
449
+ TaskRuns * v1beta1 .TaskRunList
449
450
Time clockwork.Clock
450
451
AllNamespaces bool
451
452
}{
@@ -473,7 +474,7 @@ NAME STARTED DURATION STATUS{{- if $.AllNamespaces }} NAMESPACE{{- end }}
473
474
return tmplBytes .String ()
474
475
}
475
476
476
- func GetTaskRunListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1alpha1 .TaskRunList {
477
+ func GetTaskRunListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1beta1 .TaskRunList {
477
478
taskRunlist := GetTaskRunList (c )
478
479
if len (taskRunlist .Items ) != len (td ) {
479
480
t .Errorf ("Length of taskrun list and Testdata provided not matching" )
@@ -502,7 +503,7 @@ func GetTaskRunListWithTestData(t *testing.T, c *framework.Clients, td map[int]i
502
503
return taskRunlist
503
504
}
504
505
505
- type pipelineruns map [string ]v1alpha1 .PipelineRun
506
+ type pipelineruns map [string ]v1beta1 .PipelineRun
506
507
507
508
type PipelinesListData struct {
508
509
Name string
@@ -533,7 +534,7 @@ func ListAllPipelinesOutput(t *testing.T, cs *framework.Clients, td map[int]inte
533
534
t .Error ("Failed to list pipelines" )
534
535
}
535
536
var data = struct {
536
- Pipelines * v1alpha1 .PipelineList
537
+ Pipelines * v1beta1 .PipelineList
537
538
PipelineRuns pipelineruns
538
539
Params clockwork.Clock
539
540
}{
@@ -543,7 +544,7 @@ func ListAllPipelinesOutput(t *testing.T, cs *framework.Clients, td map[int]inte
543
544
}
544
545
545
546
funcMap := template.FuncMap {
546
- "accessMap" : func (prs pipelineruns , name string ) * v1alpha1 .PipelineRun {
547
+ "accessMap" : func (prs pipelineruns , name string ) * v1beta1 .PipelineRun {
547
548
if pr , ok := prs [name ]; ok {
548
549
return & pr
549
550
}
@@ -570,7 +571,7 @@ func ListAllPipelinesOutput(t *testing.T, cs *framework.Clients, td map[int]inte
570
571
return tmplBytes .String ()
571
572
}
572
573
573
- func listPipelineDetailsWithTestData (t * testing.T , cs * framework.Clients , td map [int ]interface {}) (* v1alpha1 .PipelineList , pipelineruns , error ) {
574
+ func listPipelineDetailsWithTestData (t * testing.T , cs * framework.Clients , td map [int ]interface {}) (* v1beta1 .PipelineList , pipelineruns , error ) {
574
575
t .Helper ()
575
576
ps := GetPipelineListWithTestData (t , cs , td )
576
577
runs := GetPipelineRunList (cs )
@@ -596,7 +597,7 @@ func listPipelineDetailsWithTestData(t *testing.T, cs *framework.Clients, td map
596
597
return ps , latestRuns , nil
597
598
}
598
599
599
- func GetPipelineListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1alpha1 .PipelineList {
600
+ func GetPipelineListWithTestData (t * testing.T , c * framework.Clients , td map [int ]interface {}) * v1beta1 .PipelineList {
600
601
t .Helper ()
601
602
ps := GetPipelineList (c )
602
603
@@ -718,8 +719,8 @@ func GetPipelineDescribeOutput(t *testing.T, cs *framework.Clients, pname string
718
719
pipelineRuns := GetPipelineRunListWithNameAndTestData (t , cs , pname , td )
719
720
720
721
var data = struct {
721
- Pipeline * v1alpha1 .Pipeline
722
- PipelineRuns * v1alpha1 .PipelineRunList
722
+ Pipeline * v1beta1 .Pipeline
723
+ PipelineRuns * v1beta1 .PipelineRunList
723
724
PipelineName string
724
725
Params clockwork.Clock
725
726
}{
@@ -756,7 +757,7 @@ func GetPipelineDescribeOutput(t *testing.T, cs *framework.Clients, pname string
756
757
757
758
}
758
759
759
- func GetPipelineWithTestData (t * testing.T , c * framework.Clients , name string , td map [int ]interface {}) * v1alpha1 .Pipeline {
760
+ func GetPipelineWithTestData (t * testing.T , c * framework.Clients , name string , td map [int ]interface {}) * v1beta1 .Pipeline {
760
761
t .Helper ()
761
762
pipeline := GetPipeline (c , name )
762
763
@@ -770,19 +771,17 @@ func GetPipelineWithTestData(t *testing.T, c *framework.Clients, name string, td
770
771
pipeline .Spec .Resources [count ].Name = k
771
772
switch v {
772
773
case "git" :
773
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypeGit
774
+ pipeline .Spec .Resources [count ].Type = v1beta1 .PipelineResourceTypeGit
774
775
case "storage" :
775
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypeStorage
776
+ pipeline .Spec .Resources [count ].Type = v1beta1 .PipelineResourceTypeStorage
776
777
case "image" :
777
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypeImage
778
+ pipeline .Spec .Resources [count ].Type = v1beta1 .PipelineResourceTypeImage
778
779
case "cluster" :
779
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypeCluster
780
+ pipeline .Spec .Resources [count ].Type = v1beta1 .PipelineResourceTypeCluster
780
781
case "pullRequest" :
781
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypePullRequest
782
- case "gcs" :
783
- pipeline .Spec .Resources [count ].Type = v1alpha1 .PipelineResourceTypeGCS
782
+ pipeline .Spec .Resources [count ].Type = v1beta1 .PipelineResourceTypePullRequest
784
783
default :
785
- t .Errorf ("Provided PipelineResourcesData is not Valid Type : Need to Provide (%s, %s, %s, %s)" , v1alpha1 .PipelineResourceTypeGit , v1alpha1 .PipelineResourceTypeImage , v1alpha1 .PipelineResourceTypePullRequest , v1alpha1 .PipelineResourceTypeCluster )
784
+ t .Errorf ("Provided PipelineResourcesData is not Valid Type : Need to Provide (%s, %s, %s, %s)" , v1beta1 .PipelineResourceTypeGit , v1beta1 .PipelineResourceTypeImage , v1beta1 .PipelineResourceTypePullRequest , v1beta1 .PipelineResourceTypeCluster )
786
785
}
787
786
788
787
count ++
@@ -818,7 +817,7 @@ func GetPipelineWithTestData(t *testing.T, c *framework.Clients, name string, td
818
817
return pipeline
819
818
}
820
819
821
- func GetPipelineRunListWithNameAndTestData (t * testing.T , c * framework.Clients , pname string , td map [int ]interface {}) * v1alpha1 .PipelineRunList {
820
+ func GetPipelineRunListWithNameAndTestData (t * testing.T , c * framework.Clients , pname string , td map [int ]interface {}) * v1beta1 .PipelineRunList {
822
821
t .Helper ()
823
822
opts := metav1.ListOptions {
824
823
LabelSelector : fmt .Sprintf ("tekton.dev/pipeline=%s" , pname ),
0 commit comments