Skip to content

Commit 452f2e2

Browse files
test: update to pipelinev1
1 parent 11604e3 commit 452f2e2

22 files changed

+163
-162
lines changed

pkg/cmd/breakpoint/breakpoint.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/jenkins-x/lighthouse-client/pkg/apis/lighthouse"
1818
"github.com/jenkins-x/lighthouse-client/pkg/apis/lighthouse/v1alpha1"
1919
lhclient "github.com/jenkins-x/lighthouse-client/pkg/client/clientset/versioned"
20-
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
20+
pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
2121
apierrors "k8s.io/apimachinery/pkg/api/errors"
2222

2323
"github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned"
@@ -198,8 +198,8 @@ func (o *Options) Run() error {
198198
},
199199
Spec: v1alpha1.LighthouseBreakpointSpec{
200200
Filter: *f,
201-
Debug: v1beta1.TaskRunDebug{
202-
Breakpoint: o.BreakpointNames,
201+
Debug: pipelinev1.TaskRunDebug{
202+
Breakpoints: &pipelinev1.TaskBreakpoints{BeforeSteps: o.BreakpointNames},
203203
},
204204
},
205205
}
@@ -220,7 +220,7 @@ func (o *Options) ToLabel(a *v1.PipelineActivity) string {
220220

221221
debug := f.ResolveDebug(o.Breakpoints)
222222
if debug != nil {
223-
label += " => breakpoint: " + strings.Join(debug.Breakpoint, ", ")
223+
label += " => breakpoint: " + strings.Join(debug.Breakpoints.BeforeSteps, ", ")
224224
}
225225
return label
226226
}

pkg/cmd/effective/effective.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/jenkins-x/jx-helpers/v3/pkg/input/inputfactory"
1919
"github.com/jenkins-x/jx-helpers/v3/pkg/options"
2020
"github.com/jenkins-x/jx-logging/v3/pkg/log"
21-
tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2221
"sigs.k8s.io/yaml"
2322

2423
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/helper"
@@ -303,7 +302,7 @@ func (o *Options) processTriggers() error {
303302
return o.displayPipeline(trigger.Path, pipelineName, pipeline)
304303
}
305304

306-
func (o *Options) displayPipeline(path, name string, pipeline *tektonv1beta1.PipelineRun) error {
305+
func (o *Options) displayPipeline(path, name string, pipeline *pipelinev1.PipelineRun) error {
307306
if o.AddDefaults {
308307
err := o.addPipelineParameterDefaults(path, pipeline)
309308
if err != nil {
@@ -389,7 +388,7 @@ func (o *Options) openInEditor(path, editor string) error {
389388
return nil
390389
}
391390

392-
func (o *Options) addPipelineParameterDefaults(path string, pipeline *tektonv1beta1.PipelineRun) error {
391+
func (o *Options) addPipelineParameterDefaults(path string, pipeline *pipelinev1.PipelineRun) error {
393392
ps := &pipeline.Spec
394393

395394
dscm := &o.DiscoverScm
@@ -453,7 +452,7 @@ func (o *Options) addPipelineParameterDefaults(path string, pipeline *tektonv1be
453452
for i := range ps.Params {
454453
pa := &ps.Params[i]
455454
if string(pa.Value.Type) == "" {
456-
pa.Value.Type = tektonv1beta1.ParamTypeString
455+
pa.Value.Type = pipelinev1.ParamTypeString
457456
}
458457
if pa.Value.StringVal == "" {
459458
switch pa.Name {

pkg/cmd/effective/effective_jenkins_integration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88

99
"github.com/jenkins-x/jx-helpers/v3/pkg/files"
1010
"github.com/jenkins-x/jx-helpers/v3/pkg/testhelpers"
11+
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1112

1213
"github.com/jenkins-x-plugins/jx-pipeline/pkg/cmd/effective"
1314
"github.com/jenkins-x/jx-helpers/v3/pkg/yamls"
1415
"github.com/stretchr/testify/assert"
15-
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1616

1717
"github.com/stretchr/testify/require"
1818
)

pkg/cmd/effective/effective_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import (
1010
"github.com/jenkins-x/lighthouse-client/pkg/filebrowser"
1111
"github.com/jenkins-x/lighthouse-client/pkg/filebrowser/fake"
1212
"github.com/jenkins-x/lighthouse-client/pkg/triggerconfig/inrepo"
13+
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1314

1415
"github.com/jenkins-x-plugins/jx-pipeline/pkg/cmd/effective"
1516
"github.com/jenkins-x/jx-helpers/v3/pkg/yamls"
1617
"github.com/stretchr/testify/assert"
17-
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1818

1919
"github.com/stretchr/testify/require"
2020
)

pkg/cmd/env/env.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/jenkins-x/jx-kube-client/v3/pkg/kubeclient"
2020
"github.com/jenkins-x/jx-logging/v3/pkg/log"
2121

22+
pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
2223
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2324
tektonclient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
2425
corev1 "k8s.io/api/core/v1"
@@ -50,7 +51,7 @@ type Options struct {
5051
type PipelinePod struct {
5152
PodName string
5253
ActivitySpec *v1.PipelineActivitySpec
53-
PipelineRuns []*v1beta1.PipelineRun
54+
PipelineRuns []*pipelinev1.PipelineRun
5455
}
5556

5657
var (

pkg/cmd/fmt/default_parameters.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package fmt
22

3-
import (
4-
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
5-
)
3+
import "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
64

75
var (
86
// defaultParameterSpecs the default Lighthouse Pipeline Parameters which can be injected by the

pkg/cmd/fmt/fmt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212
"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient/cli"
1313
"github.com/jenkins-x/jx-helpers/v3/pkg/options"
1414
"github.com/jenkins-x/jx-helpers/v3/pkg/yamls"
15-
1615
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
16+
1717
corev1 "k8s.io/api/core/v1"
1818
"sigs.k8s.io/yaml"
1919

pkg/cmd/get/get.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/jenkins-x/jx-logging/v3/pkg/log"
2222

2323
"github.com/spf13/cobra"
24-
pipelineapi "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
24+
pipelineapi "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
2525
tektonclient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
2626
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2727
"k8s.io/client-go/kubernetes"

pkg/cmd/get/get_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/jenkins-x-plugins/jx-pipeline/pkg/cmd/get"
1111
"github.com/jenkins-x-plugins/jx-pipeline/pkg/tektonlog"
1212
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
13-
tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1413
faketekton "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake"
1514
"k8s.io/client-go/kubernetes/fake"
1615

@@ -20,7 +19,7 @@ import (
2019

2120
const testDevNameSpace = "jx-test"
2221

23-
func pipelineRun(ns, repo, branch, owner, context string, now metav1.Time) *tektonv1beta1.PipelineRun {
22+
func pipelineRun(ns, repo, branch, owner, context string, now metav1.Time) *pipelinev1.PipelineRun {
2423
return &v1beta1.PipelineRun{
2524
ObjectMeta: metav1.ObjectMeta{
2625
Name: "PR1",
@@ -51,7 +50,7 @@ func pipelineRun(ns, repo, branch, owner, context string, now metav1.Time) *tekt
5150
},
5251
},
5352
Status: v1beta1.PipelineRunStatus{
54-
PipelineRunStatusFields: tektonv1beta1.PipelineRunStatusFields{
53+
PipelineRunStatusFields: pipelinev1.PipelineRunStatusFields{
5554
CompletionTime: &now,
5655
},
5756
},

pkg/cmd/grid/grid.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/jenkins-x/jx-kube-client/v3/pkg/kubeclient"
2222
"github.com/jenkins-x/jx-logging/v3/pkg/log"
2323
"github.com/spf13/cobra"
24-
tektonapis "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2524
tektonclient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
2625
apierrors "k8s.io/apimachinery/pkg/api/errors"
2726
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -211,7 +210,7 @@ func (o *Options) viewLogsFor(act *v1.PipelineActivity, paList []v1.PipelineActi
211210
return fmt.Errorf("no PipelineRun resources found for namespace %s", ns)
212211
}
213212

214-
var prList []*tektonapis.PipelineRun
213+
var prList []*pipelinev1.PipelineRun
215214
for i := range resources.Items {
216215
pr := &resources.Items[i]
217216

pkg/cmd/start/start.go

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"github.com/sirupsen/logrus"
12+
v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
1213
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1314
v1 "k8s.io/api/core/v1"
1415

pkg/cmd/stop/stop.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
tektonclient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
3333
"k8s.io/client-go/kubernetes"
3434

35-
pipelineapi "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
35+
pipelineapi "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
3636
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3737

3838
"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/templates"

pkg/lighthouses/catalogs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import (
77

88
"github.com/jenkins-x/jx-helpers/v3/pkg/scmhelpers"
99
"github.com/jenkins-x/jx-logging/v3/pkg/log"
10+
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1011

1112
"github.com/jenkins-x/lighthouse-client/pkg/triggerconfig/inrepo"
12-
13-
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
1413
)
1514

1615
// FindCatalogTaskSpec finds the pipeline catalog TaskSpec

pkg/lighthouses/pipelines.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77

88
"github.com/jenkins-x/lighthouse-client/pkg/triggerconfig/inrepo"
99

10-
tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
10+
pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
1111
)
1212

1313
// LoadEffectivePipelineRun loads the effective pipeline run
14-
func LoadEffectivePipelineRun(resolver *inrepo.UsesResolver, path string) (*tektonv1beta1.PipelineRun, error) {
14+
func LoadEffectivePipelineRun(resolver *inrepo.UsesResolver, path string) (*pipelinev1.PipelineRun, error) {
1515
data, err := os.ReadFile(path)
1616
if err != nil {
1717
return nil, fmt.Errorf("failed to load file %s: %w", path, err)

0 commit comments

Comments
 (0)