From 88bb3aded00d281103bf4f3c344410988771d082 Mon Sep 17 00:00:00 2001 From: Michael Sauter Date: Thu, 5 Oct 2023 11:32:45 +0200 Subject: [PATCH] Update from Tekton v1beta1 to v1 --- deploy/chart/templates/task-finish.yaml | 2 +- deploy/chart/templates/task-start.yaml | 2 +- docs/authoring-tasks.adoc | 6 +++--- internal/manager/pipeline.go | 28 ++++++++++++------------- internal/manager/pipeline_test.go | 6 +++--- internal/manager/prune.go | 2 +- internal/manager/prune_test.go | 2 +- internal/manager/receive_test.go | 8 +++---- internal/manager/schedule.go | 2 +- internal/manager/schedule_test.go | 2 +- internal/manager/watch.go | 2 +- internal/manager/watch_test.go | 6 ++++-- internal/tekton/client.go | 10 ++++----- internal/tekton/pipelinerun.go | 4 ++-- internal/tekton/pipelinerun_test.go | 2 +- internal/tekton/test_client.go | 2 +- pkg/config/ods.go | 4 +--- pkg/taskdoc/taskdoc.go | 2 +- pkg/tektontaskrun/task.go | 4 ++-- pkg/tektontaskrun/taskrun.go | 11 ++++++---- pkg/tektontaskrun/taskrun_opt.go | 2 +- test/e2e/pipeline_run_test.go | 10 ++++----- test/e2e/task_finish_test.go | 2 +- test/e2e/task_start_test.go | 2 +- 24 files changed, 63 insertions(+), 60 deletions(-) diff --git a/deploy/chart/templates/task-finish.yaml b/deploy/chart/templates/task-finish.yaml index d8e06aea..408e385e 100644 --- a/deploy/chart/templates/task-finish.yaml +++ b/deploy/chart/templates/task-finish.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: ods-pipeline-finish diff --git a/deploy/chart/templates/task-start.yaml b/deploy/chart/templates/task-start.yaml index 4fbe25ea..78a1407c 100644 --- a/deploy/chart/templates/task-start.yaml +++ b/deploy/chart/templates/task-start.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: ods-pipeline-start diff --git a/docs/authoring-tasks.adoc b/docs/authoring-tasks.adoc index 0d29e1f8..4c544a80 100644 --- a/docs/authoring-tasks.adoc +++ b/docs/authoring-tasks.adoc @@ -47,7 +47,7 @@ The simplest YAML definition of a task looks like this: [source] ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: hello-world @@ -118,7 +118,7 @@ For this example, we will consider a very basic application like this link:https [source,yaml] ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: build-ruby @@ -161,7 +161,7 @@ As a first step, copy the YAML from link:https://github.com/opendevstack/ods-pip [source,yaml] ---- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Task metadata: name: build-go diff --git a/internal/manager/pipeline.go b/internal/manager/pipeline.go index 482c9560..be0fa9c1 100644 --- a/internal/manager/pipeline.go +++ b/internal/manager/pipeline.go @@ -11,7 +11,7 @@ import ( tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/config" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -26,7 +26,7 @@ const ( // Label specifying the Git ref (e.g. branch) related to the pipeline. gitRefLabel = labelPrefix + "git-ref" // tektonAPIVersion specifies the Tekton API version in use - tektonAPIVersion = "tekton.dev/v1beta1" + tektonAPIVersion = "tekton.dev/v1" // sharedWorkspaceName is the name of the workspace shared by all tasks sharedWorkspaceName = "shared-workspace" ) @@ -55,12 +55,10 @@ func createPipelineRun( Kind: "PipelineRun", }, Spec: tekton.PipelineRunSpec{ - PipelineSpec: assemblePipelineSpec(cfg), - Params: extractPipelineParams(cfg.Params), - ServiceAccountName: "pipeline", // TODO - PodTemplate: cfg.PipelineSpec.PodTemplate, - TaskRunSpecs: cfg.PipelineSpec.TaskRunSpecs, - Timeouts: cfg.PipelineSpec.Timeouts, + PipelineSpec: assemblePipelineSpec(cfg), + Params: extractPipelineParams(cfg.Params), + TaskRunSpecs: cfg.PipelineSpec.TaskRunSpecs, + Timeouts: cfg.PipelineSpec.Timeouts, Workspaces: []tekton.WorkspaceBinding{ { Name: sharedWorkspaceName, @@ -188,17 +186,19 @@ func pipelineRunIsProgressing(pr tekton.PipelineRun) bool { // tektonStringParam returns a Tekton task parameter. func tektonStringParam(name, val string) tekton.Param { - return tekton.Param{Name: name, Value: tekton.ArrayOrString{Type: "string", StringVal: val}} + return tekton.Param{ + Name: name, + Value: tekton.ParamValue{Type: tekton.ParamTypeString, StringVal: val}, + } } // tektonStringParam returns a Tekton task parameter spec. func tektonStringParamSpec(name, defaultVal string) tekton.ParamSpec { return tekton.ParamSpec{ - Name: name, - Type: "string", - Default: &tekton.ArrayOrString{ - Type: tekton.ParamTypeString, StringVal: defaultVal, - }} + Name: name, + Type: tekton.ParamTypeString, + Default: &tekton.ParamValue{Type: tekton.ParamTypeString, StringVal: defaultVal}, + } } // tektonDefaultWorkspaceBindings returns the default workspace bindings for a task. diff --git a/internal/manager/pipeline_test.go b/internal/manager/pipeline_test.go index 3345114e..cd1b9aeb 100644 --- a/internal/manager/pipeline_test.go +++ b/internal/manager/pipeline_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/go-cmp/cmp" tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/config" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" ) func TestShortenString(t *testing.T) { @@ -128,7 +128,7 @@ func TestCreatePipelineRun(t *testing.T) { if err != nil { t.Fatal(err) } - wantParams := []tekton.Param{ + wantParams := tekton.Params{ {Name: "hello", Value: tekton.ParamValue{Type: "string", StringVal: "world"}}, } if diff := cmp.Diff(wantParams, pr.Spec.Params); diff != "" { @@ -370,7 +370,7 @@ func TestAppendTriggerBasedParams(t *testing.T) { }, }) got := mergeTriggerBasedParams(tasks, params) - want := []tekton.Param{ + want := tekton.Params{ tektonStringParam("zero", "0"), tektonStringParam("two", "b"), tektonStringParam("four", "d"), diff --git a/internal/manager/prune.go b/internal/manager/prune.go index 3d238f03..a193bf78 100644 --- a/internal/manager/prune.go +++ b/internal/manager/prune.go @@ -6,7 +6,7 @@ import ( tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/internal/manager/prune_test.go b/internal/manager/prune_test.go index b4558271..38bba82c 100644 --- a/internal/manager/prune_test.go +++ b/internal/manager/prune_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/internal/manager/receive_test.go b/internal/manager/receive_test.go index b2e9802f..1b161dd8 100644 --- a/internal/manager/receive_test.go +++ b/internal/manager/receive_test.go @@ -22,7 +22,7 @@ import ( "github.com/opendevstack/ods-pipeline/pkg/bitbucket" "github.com/opendevstack/ods-pipeline/pkg/config" "github.com/opendevstack/ods-pipeline/pkg/logging" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" ) func TestIsCiSkipInCommitMessage(t *testing.T) { @@ -84,7 +84,7 @@ func TestFetchODSConfig(t *testing.T) { "ods.yml": []byte("pipelines: [{tasks: [{name: yml}]}]"), }, wantErr: "", - wantODS: &config.ODS{Pipelines: []config.Pipeline{{Tasks: []v1beta1.PipelineTask{{Name: "yaml"}}}}}, + wantODS: &config.ODS{Pipelines: []config.Pipeline{{Tasks: []tekton.PipelineTask{{Name: "yaml"}}}}}, }, } @@ -728,11 +728,11 @@ func verifyMatchingPipelineInfo(pInfo *PipelineInfo, odsConfig *config.ODS, want // Annotate wanted pipeline/trigger so that // we can check later if it was selected. // no matching pipeline, as wanted by the test case. - odsConfig.Pipelines[wantPipelineIndex].Tasks = []v1beta1.PipelineTask{ + odsConfig.Pipelines[wantPipelineIndex].Tasks = []tekton.PipelineTask{ {Name: "match this"}, } if wantTriggerIndex > -1 { - odsConfig.Pipelines[wantPipelineIndex].Triggers[wantTriggerIndex].Params = []v1beta1.Param{ + odsConfig.Pipelines[wantPipelineIndex].Triggers[wantTriggerIndex].Params = []tekton.Param{ tektonStringParam("match", "this"), } } diff --git a/internal/manager/schedule.go b/internal/manager/schedule.go index 611434a0..9ba663a3 100644 --- a/internal/manager/schedule.go +++ b/internal/manager/schedule.go @@ -7,7 +7,7 @@ import ( kubernetesClient "github.com/opendevstack/ods-pipeline/internal/kubernetes" tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" ) type StorageConfig struct { diff --git a/internal/manager/schedule_test.go b/internal/manager/schedule_test.go index 37376e4a..b2dcfdd5 100644 --- a/internal/manager/schedule_test.go +++ b/internal/manager/schedule_test.go @@ -8,7 +8,7 @@ import ( kubernetesClient "github.com/opendevstack/ods-pipeline/internal/kubernetes" tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/internal/manager/watch.go b/internal/manager/watch.go index 55c5f625..a009fe60 100644 --- a/internal/manager/watch.go +++ b/internal/manager/watch.go @@ -7,7 +7,7 @@ import ( tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/internal/manager/watch_test.go b/internal/manager/watch_test.go index d53c01f1..3317cfaa 100644 --- a/internal/manager/watch_test.go +++ b/internal/manager/watch_test.go @@ -7,7 +7,7 @@ import ( tektonClient "github.com/opendevstack/ods-pipeline/internal/tekton" "github.com/opendevstack/ods-pipeline/pkg/logging" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/clock" ) @@ -145,7 +145,9 @@ func timedOutPipelineRun(t *testing.T, name string, creationTime time.Time) *tek CreationTimestamp: metav1.Time{Time: creationTime}, }, Spec: tekton.PipelineRunSpec{ - Timeout: &metav1.Duration{Duration: time.Second}, + Timeouts: &tekton.TimeoutFields{ + Pipeline: &metav1.Duration{Duration: time.Second}, + }, }, Status: tekton.PipelineRunStatus{ PipelineRunStatusFields: tekton.PipelineRunStatusFields{ diff --git a/internal/tekton/client.go b/internal/tekton/client.go index d0920311..212a93b2 100644 --- a/internal/tekton/client.go +++ b/internal/tekton/client.go @@ -5,7 +5,7 @@ import ( "github.com/opendevstack/ods-pipeline/pkg/logging" tektonClient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" - v1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1" + tektonv1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1" "k8s.io/client-go/rest" ) @@ -72,10 +72,10 @@ func (c *Client) namespace() string { return c.clientConfig.Namespace } -func (c *Client) tektonV1beta1Client() v1beta1.TektonV1beta1Interface { - return c.clientConfig.TektonClient.TektonV1beta1() +func (c *Client) tektonV1Client() tektonv1.TektonV1Interface { + return c.clientConfig.TektonClient.TektonV1() } -func (c *Client) pipelineRunsClient() v1beta1.PipelineRunInterface { - return c.tektonV1beta1Client().PipelineRuns(c.namespace()) +func (c *Client) pipelineRunsClient() tektonv1.PipelineRunInterface { + return c.tektonV1Client().PipelineRuns(c.namespace()) } diff --git a/internal/tekton/pipelinerun.go b/internal/tekton/pipelinerun.go index e425edbb..20d7cdd2 100644 --- a/internal/tekton/pipelinerun.go +++ b/internal/tekton/pipelinerun.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -49,7 +49,7 @@ func PipelineRunURL(consoleURL, namespace, name string) (string, error) { return "", fmt.Errorf("parse base URL: %w", err) } cPath := fmt.Sprintf( - "/k8s/ns/%s/tekton.dev~v1beta1~PipelineRun/%s/", + "/k8s/ns/%s/tekton.dev~v1~PipelineRun/%s/", namespace, name, ) diff --git a/internal/tekton/pipelinerun_test.go b/internal/tekton/pipelinerun_test.go index 8d122441..ee067325 100644 --- a/internal/tekton/pipelinerun_test.go +++ b/internal/tekton/pipelinerun_test.go @@ -19,7 +19,7 @@ func TestPipelineRunURL(t *testing.T) { if err != nil { t.Fatal(err) } - want := "https://console.example.com/k8s/ns/foo/tekton.dev~v1beta1~PipelineRun/bar-ab12c/" + want := "https://console.example.com/k8s/ns/foo/tekton.dev~v1~PipelineRun/bar-ab12c/" if u != want { t.Fatalf("want: %s, got: %s", want, u) } diff --git a/internal/tekton/test_client.go b/internal/tekton/test_client.go index a7656eca..080af05b 100644 --- a/internal/tekton/test_client.go +++ b/internal/tekton/test_client.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/config/ods.go b/pkg/config/ods.go index 3f5cfcb2..f0b19f88 100644 --- a/pkg/config/ods.go +++ b/pkg/config/ods.go @@ -8,8 +8,7 @@ import ( "path/filepath" "strings" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "sigs.k8s.io/yaml" ) @@ -55,7 +54,6 @@ type Pipeline struct { Tasks []tekton.PipelineTask `json:"tasks,omitempty"` Finally []tekton.PipelineTask `json:"finally,omitempty"` Timeouts *tekton.TimeoutFields `json:"timeouts,omitempty"` - PodTemplate *pod.PodTemplate `json:"podTemplate,omitempty"` TaskRunSpecs []tekton.PipelineTaskRunSpec `json:"taskRunSpecs,omitempty"` } diff --git a/pkg/taskdoc/taskdoc.go b/pkg/taskdoc/taskdoc.go index 2c06cadd..d8efbf7e 100644 --- a/pkg/taskdoc/taskdoc.go +++ b/pkg/taskdoc/taskdoc.go @@ -5,7 +5,7 @@ import ( "io" "text/template" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "sigs.k8s.io/yaml" ) diff --git a/pkg/tektontaskrun/task.go b/pkg/tektontaskrun/task.go index cc068ee8..455dfc10 100644 --- a/pkg/tektontaskrun/task.go +++ b/pkg/tektontaskrun/task.go @@ -8,7 +8,7 @@ import ( k "github.com/opendevstack/ods-pipeline/internal/kubernetes" "github.com/opendevstack/ods-pipeline/pkg/taskmanifest" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" ) @@ -30,7 +30,7 @@ func installTask(path, namespace string, data map[string]string) (*tekton.Task, } clients := k.NewClients() tc := clients.TektonClientSet - it, err := tc.TektonV1beta1().Tasks(namespace).Create(context.TODO(), &t, metav1.CreateOptions{}) + it, err := tc.TektonV1().Tasks(namespace).Create(context.TODO(), &t, metav1.CreateOptions{}) if err != nil { return nil, fmt.Errorf("create task: %w", err) } diff --git a/pkg/tektontaskrun/taskrun.go b/pkg/tektontaskrun/taskrun.go index a681ac8e..453a0df3 100644 --- a/pkg/tektontaskrun/taskrun.go +++ b/pkg/tektontaskrun/taskrun.go @@ -10,7 +10,7 @@ import ( "time" k "github.com/opendevstack/ods-pipeline/internal/kubernetes" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" pipelineclientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -71,7 +71,7 @@ func createTaskRunWithParams(tknClient *pipelineclientset.Clientset, tc *TaskRun }) } - tr, err := tknClient.TektonV1beta1().TaskRuns(tc.Namespace).Create(context.TODO(), + tr, err := tknClient.TektonV1().TaskRuns(tc.Namespace).Create(context.TODO(), &tekton.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Name: makeRandomTaskrunName(tc.Name), @@ -103,7 +103,7 @@ func waitForTaskRunDone( timeout := time.Until(deadline) log.Printf("Waiting up to %v seconds for task %s in namespace %s to be done...\n", timeout.Round(time.Second).Seconds(), name, ns) - w, err := c.TektonV1beta1().TaskRuns(ns).Watch(ctx, metav1.SingleObject(metav1.ObjectMeta{ + w, err := c.TektonV1().TaskRuns(ns).Watch(ctx, metav1.SingleObject(metav1.ObjectMeta{ Name: name, Namespace: ns, })) @@ -143,7 +143,7 @@ func waitForTaskRunPod( var taskRunPod *corev1.Pod - podsInformer.AddEventHandler( + _, err := podsInformer.AddEventHandler( cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { // when a new task is created, watch its events @@ -156,6 +156,9 @@ func waitForTaskRunPod( }, }) + if err != nil { + log.Printf("Unable to install the event handler: %s", err) + } defer close(stop) kubeInformerFactory.Start(stop) diff --git a/pkg/tektontaskrun/taskrun_opt.go b/pkg/tektontaskrun/taskrun_opt.go index c82ca1e9..9f2a7167 100644 --- a/pkg/tektontaskrun/taskrun_opt.go +++ b/pkg/tektontaskrun/taskrun_opt.go @@ -8,7 +8,7 @@ import ( "time" "github.com/opendevstack/ods-pipeline/internal/directory" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" ) const ( diff --git a/test/e2e/pipeline_run_test.go b/test/e2e/pipeline_run_test.go index 5a811f73..746cbad3 100644 --- a/test/e2e/pipeline_run_test.go +++ b/test/e2e/pipeline_run_test.go @@ -18,7 +18,7 @@ import ( "github.com/opendevstack/ods-pipeline/internal/tasktesting" "github.com/opendevstack/ods-pipeline/pkg/bitbucket" "github.com/opendevstack/ods-pipeline/pkg/tektontaskrun" - tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tektonv1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" tekton "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -176,14 +176,14 @@ func waitForServiceToBeReady(t *testing.T, clientset *k8s.Clientset, ns, name st return nil } -func waitForPipelineRunToBeTriggered(clientset *tekton.Clientset, ns string, timeout time.Duration) (*tektonv1beta1.PipelineRun, error) { +func waitForPipelineRunToBeTriggered(clientset *tekton.Clientset, ns string, timeout time.Duration) (*tektonv1.PipelineRun, error) { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - var pipelineRunList *tektonv1beta1.PipelineRunList + var pipelineRunList *tektonv1.PipelineRunList for { time.Sleep(2 * time.Second) - prs, err := clientset.TektonV1beta1().PipelineRuns(ns).List(ctx, metav1.ListOptions{}) + prs, err := clientset.TektonV1().PipelineRuns(ns).List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } @@ -208,7 +208,7 @@ func waitForPipelineRunToBeDone(clientset *tekton.Clientset, ns, pr string, time var reason string for { time.Sleep(2 * time.Second) - pr, err := clientset.TektonV1beta1().PipelineRuns(ns).Get(ctx, pr, metav1.GetOptions{}) + pr, err := clientset.TektonV1().PipelineRuns(ns).Get(ctx, pr, metav1.GetOptions{}) if err != nil { return "", err } diff --git a/test/e2e/task_finish_test.go b/test/e2e/task_finish_test.go index 2769185e..d322c81b 100644 --- a/test/e2e/task_finish_test.go +++ b/test/e2e/task_finish_test.go @@ -13,7 +13,7 @@ import ( "github.com/opendevstack/ods-pipeline/pkg/bitbucket" "github.com/opendevstack/ods-pipeline/pkg/nexus" "github.com/opendevstack/ods-pipeline/pkg/pipelinectxt" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "k8s.io/client-go/kubernetes" ott "github.com/opendevstack/ods-pipeline/pkg/odstasktest" diff --git a/test/e2e/task_start_test.go b/test/e2e/task_start_test.go index 91b08f48..87e35de6 100644 --- a/test/e2e/task_start_test.go +++ b/test/e2e/task_start_test.go @@ -16,7 +16,7 @@ import ( "github.com/opendevstack/ods-pipeline/pkg/config" "github.com/opendevstack/ods-pipeline/pkg/nexus" "github.com/opendevstack/ods-pipeline/pkg/pipelinectxt" - tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" "k8s.io/client-go/kubernetes" "sigs.k8s.io/yaml"