From 2bdfd1843a5caaf81a35d4e505a514ba891582f8 Mon Sep 17 00:00:00 2001 From: Dibyo Mukherjee Date: Thu, 19 Mar 2020 17:19:10 -0400 Subject: [PATCH] Allow creating v1beta1 resources - Update examples to use v1beta1 by default. - Add an explicit v1alpha1 example. - Use v1beta1 Pipeline types for Params and tests. Fixes #481 Signed-off-by: Dibyo Mukherjee --- docs/getting-started/ingress-run.yaml | 3 +- docs/getting-started/pipeline.yaml | 38 +++-- docs/getting-started/webhook-run.yaml | 3 +- docs/triggertemplates.md | 2 +- examples/example-pipeline.yaml | 44 +++--- .../triggertemplates/triggertemplate.yaml | 2 +- examples/v1alpha1-task/README.md | 47 +++++++ .../v1alpha1-task/v1alpha1-task-listener.yaml | 29 ++++ .../triggers/v1alpha1/event_listener_types.go | 2 +- .../v1alpha1/event_listener_validation.go | 2 +- .../v1alpha1/trigger_binding_types.go | 2 +- .../v1alpha1/trigger_binding_validation.go | 4 +- .../v1alpha1/trigger_template_types.go | 15 +- .../v1alpha1/trigger_template_validation.go | 2 +- .../trigger_template_validation_test.go | 9 ++ pkg/client/dynamic/clientset/tekton/tekton.go | 1 + pkg/interceptors/webhook/webhook.go | 2 +- pkg/interceptors/webhook/webhook_test.go | 2 +- pkg/sink/sink_test.go | 54 ++++---- pkg/template/event.go | 2 +- pkg/template/event_test.go | 2 +- pkg/template/resource.go | 2 +- pkg/template/resource_test.go | 130 +++++++++--------- test/builder/clustertriggerbinding_test.go | 2 +- test/builder/eventlistener.go | 2 +- test/builder/eventlistener_test.go | 2 +- test/builder/param.go | 10 +- test/builder/param_test.go | 8 +- test/builder/triggerbinding.go | 2 +- test/builder/triggerbinding_test.go | 2 +- test/builder/triggertemplate.go | 2 +- test/builder/triggertemplate_test.go | 2 +- test/params.go | 2 +- 33 files changed, 260 insertions(+), 173 deletions(-) create mode 100644 examples/v1alpha1-task/README.md create mode 100644 examples/v1alpha1-task/v1alpha1-task-listener.yaml diff --git a/docs/getting-started/ingress-run.yaml b/docs/getting-started/ingress-run.yaml index 0f5d77833..e4b217273 100644 --- a/docs/getting-started/ingress-run.yaml +++ b/docs/getting-started/ingress-run.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: create-ingress-run @@ -6,7 +6,6 @@ metadata: spec: taskRef: name: create-ingress - inputs: params: - name: CreateCertificate value: "true" diff --git a/docs/getting-started/pipeline.yaml b/docs/getting-started/pipeline.yaml index 0c992babb..d1cfef76d 100644 --- a/docs/getting-started/pipeline.yaml +++ b/docs/getting-started/pipeline.yaml @@ -5,7 +5,7 @@ # - source is built into an image by img # - image output is pushed to ECR # - cloudevent emitted -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: getting-started-pipeline @@ -50,18 +50,17 @@ spec: - name: event-to-sink resource: event-to-sink --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: deploy-locally namespace: getting-started spec: - inputs: - resources: + resources: + inputs: - name: image-source type: image - outputs: - resources: + outputs: - name: event-to-sink type: cloudEvent steps: @@ -72,26 +71,25 @@ spec: - "run" - "tekton-triggers-built-me" - "--image" - - "${inputs.resources.image-source.url}" + - "${resources.inputs.image-source.url}" - "--env=PORT=8080" --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-docker-image namespace: getting-started spec: - inputs: - resources: + params: + - name: pathToContext + description: + The build directory used by img + default: /workspace/source-repo + resources: + inputs: - name: source-repo type: git - params: - - name: pathToContext - description: - The build directory used by img - default: /workspace/source-repo - outputs: - resources: + outputs: - name: builtImage type: image steps: @@ -102,9 +100,9 @@ spec: args: - build - -t - - "${outputs.resources.builtImage.url}" + - "$(resources.outputs.builtImage.url)" - --no-cache - - "${inputs.params.pathToContext}" + - "$(params.pathToContext)" --- apiVersion: tekton.dev/v1alpha1 kind: Condition @@ -118,7 +116,7 @@ spec: check: image: golang command: ["go"] - args: ['test', "$(inputs.resources.source-repo.path)/..."] + args: ['test', "$(resources.source-repo.path)/..."] --- # Finally, we need something to receive our cloudevent announcing success! # That is this services only purpose diff --git a/docs/getting-started/webhook-run.yaml b/docs/getting-started/webhook-run.yaml index f0e52659e..ac0b92447 100644 --- a/docs/getting-started/webhook-run.yaml +++ b/docs/getting-started/webhook-run.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: create-webhook-run @@ -6,7 +6,6 @@ metadata: spec: taskRef: name: create-webhook - inputs: params: - name: GitHubOrg value: "iancoffey" diff --git a/docs/triggertemplates.md b/docs/triggertemplates.md index 1a0d3ef01..9bddf3904 100644 --- a/docs/triggertemplates.md +++ b/docs/triggertemplates.md @@ -24,7 +24,7 @@ spec: - name: contenttype description: The Content-Type of the event resourcetemplates: - - apiVersion: tekton.dev/v1alpha1 + - apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: simple-pipeline-run- diff --git a/examples/example-pipeline.yaml b/examples/example-pipeline.yaml index 2090bef17..0022c598d 100644 --- a/examples/example-pipeline.yaml +++ b/examples/example-pipeline.yaml @@ -1,14 +1,14 @@ -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: say-hello spec: - inputs: - params: - - name: contenttype - description: The Content-Type of the event - type: string - resources: + params: + - name: contenttype + description: The Content-Type of the event + type: string + resources: + inputs: - name: git-source type: git steps: @@ -16,20 +16,20 @@ spec: image: bash command: ["bash", "-c"] args: - - echo -e 'Hello Triggers!\nContent-Type is $(inputs.params.contenttype)' + - echo -e 'Hello Triggers!\nContent-Type is $(params.contenttype)' --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: say-message spec: - inputs: - params: - - name: message - description: The message to print - default: This is the default message - type: string - resources: + params: + - name: message + description: The message to print + default: This is the default message + type: string + resources: + inputs: - name: git-source type: git steps: @@ -37,15 +37,15 @@ spec: image: bash command: ["bash", "-c"] args: - - echo '$(inputs.params.message)' + - echo '$(params.message)' --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: say-bye spec: - inputs: - resources: + resources: + inputs: - name: git-source type: git steps: @@ -55,7 +55,7 @@ spec: args: - echo 'Goodbye Triggers!' --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: simple-pipeline @@ -100,4 +100,4 @@ spec: resources: inputs: - name: git-source - resource: git-source \ No newline at end of file + resource: git-source diff --git a/examples/triggertemplates/triggertemplate.yaml b/examples/triggertemplates/triggertemplate.yaml index fc5250965..009532572 100644 --- a/examples/triggertemplates/triggertemplate.yaml +++ b/examples/triggertemplates/triggertemplate.yaml @@ -15,7 +15,7 @@ spec: - name: contenttype description: The Content-Type of the event resourcetemplates: - - apiVersion: tekton.dev/v1alpha1 + - apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: simple-pipeline-run- diff --git a/examples/v1alpha1-task/README.md b/examples/v1alpha1-task/README.md new file mode 100644 index 000000000..85714d82c --- /dev/null +++ b/examples/v1alpha1-task/README.md @@ -0,0 +1,47 @@ +## v1alpha1 Task EventListener + +Creates an EventListener that creates a v1alpha1 TaskRun. + +### Try it out locally: + +1. Create the service account: + + ```shell script + kubectl apply -f examples/role-resources/triggerbinding-roles + kubectl apply -f examples/role-resources/ + ``` + +1. Create the v1alpha1 EventListener: + + ```shell script + kubectl apply -f examples/v1alpha1-task/v1alpha1-task-listener.yaml + ``` + +1. Port forward: + + ```shell script + kubectl port-forward \ + "$(kubectl get pod --selector=eventlistener=v1alpha1-task-listener -oname)" \ + 8080 + ``` + + **Note**: Instead of port forwarding, you can set the + [`serviceType`](https://github.com/tektoncd/triggers/blob/master/docs/eventlisteners.md#serviceType) + to `LoadBalancer` to expose the EventListener with a public IP. + +1. Test by sending the sample payload. + + ```shell script + curl -v \ + -H 'Content-Type: application/json' \ + --data "{}" \ + http://localhost:8080 + ``` + + The response status code should be `201 Created` + +1. You should see a new TaskRun that got created: + + ```shell script + kubectl get taskruns | grep v1alpha1-task-run- + ``` diff --git a/examples/v1alpha1-task/v1alpha1-task-listener.yaml b/examples/v1alpha1-task/v1alpha1-task-listener.yaml new file mode 100644 index 000000000..f45336177 --- /dev/null +++ b/examples/v1alpha1-task/v1alpha1-task-listener.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: tekton.dev/v1alpha1 +kind: TriggerTemplate +metadata: + name: v1alpha1-task-template +spec: + resourcetemplates: + - apiVersion: tekton.dev/v1alpha1 + kind: TaskRun + metadata: + generateName: v1alpha1-task-run- + spec: + taskSpec: + steps: + - name: "hellothere" + image: ubuntu + script: echo "hello there" +--- +apiVersion: tekton.dev/v1alpha1 +kind: EventListener +metadata: + name: v1alpha1-task-listener +spec: + # from examples/role-resources/servicaccount.yaml + serviceAccountName: tekton-triggers-example-sa + triggers: + - name: v1alpha1-task-trigger + template: + name: v1alpha1-task-template diff --git a/pkg/apis/triggers/v1alpha1/event_listener_types.go b/pkg/apis/triggers/v1alpha1/event_listener_types.go index d9e0a00d2..e181e657c 100644 --- a/pkg/apis/triggers/v1alpha1/event_listener_types.go +++ b/pkg/apis/triggers/v1alpha1/event_listener_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( "fmt" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/triggers/v1alpha1/event_listener_validation.go b/pkg/apis/triggers/v1alpha1/event_listener_validation.go index 90adc6bad..c001d6924 100644 --- a/pkg/apis/triggers/v1alpha1/event_listener_validation.go +++ b/pkg/apis/triggers/v1alpha1/event_listener_validation.go @@ -21,7 +21,7 @@ import ( "fmt" "net/http" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/util/validation" "knative.dev/pkg/apis" ) diff --git a/pkg/apis/triggers/v1alpha1/trigger_binding_types.go b/pkg/apis/triggers/v1alpha1/trigger_binding_types.go index 2f8b1627f..f674d934c 100644 --- a/pkg/apis/triggers/v1alpha1/trigger_binding_types.go +++ b/pkg/apis/triggers/v1alpha1/trigger_binding_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" ) diff --git a/pkg/apis/triggers/v1alpha1/trigger_binding_validation.go b/pkg/apis/triggers/v1alpha1/trigger_binding_validation.go index 6371d3283..d5d055a92 100644 --- a/pkg/apis/triggers/v1alpha1/trigger_binding_validation.go +++ b/pkg/apis/triggers/v1alpha1/trigger_binding_validation.go @@ -19,7 +19,7 @@ package v1alpha1 import ( "context" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -36,7 +36,7 @@ func (s *TriggerBindingSpec) Validate(ctx context.Context) *apis.FieldError { return nil } -func validateParams(params []v1alpha1.Param) *apis.FieldError { +func validateParams(params []v1beta1.Param) *apis.FieldError { // Ensure there aren't multiple params with the same name. seen := map[string]struct{}{} for _, param := range params { diff --git a/pkg/apis/triggers/v1alpha1/trigger_template_types.go b/pkg/apis/triggers/v1alpha1/trigger_template_types.go index 54165cab8..333602448 100644 --- a/pkg/apis/triggers/v1alpha1/trigger_template_types.go +++ b/pkg/apis/triggers/v1alpha1/trigger_template_types.go @@ -17,7 +17,8 @@ limitations under the License. package v1alpha1 import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" @@ -33,15 +34,19 @@ var Decoder runtime.Decoder func init() { scheme := runtime.NewScheme() - utilruntime.Must(pipelinev1.AddToScheme(scheme)) + utilruntime.Must(pipelinev1alpha1.AddToScheme(scheme)) + utilruntime.Must(pipelinev1beta1.AddToScheme(scheme)) codec := serializer.NewCodecFactory(scheme) - Decoder = codec.UniversalDecoder(pipelinev1.SchemeGroupVersion) + Decoder = codec.UniversalDecoder( + pipelinev1alpha1.SchemeGroupVersion, + pipelinev1beta1.SchemeGroupVersion, + ) } // TriggerTemplateSpec holds the desired state of TriggerTemplate type TriggerTemplateSpec struct { - Params []pipelinev1.ParamSpec `json:"params,omitempty"` - ResourceTemplates []TriggerResourceTemplate `json:"resourcetemplates,omitempty"` + Params []pipelinev1beta1.ParamSpec `json:"params,omitempty"` + ResourceTemplates []TriggerResourceTemplate `json:"resourcetemplates,omitempty"` } // TriggerResourceTemplate describes a resource to create diff --git a/pkg/apis/triggers/v1alpha1/trigger_template_validation.go b/pkg/apis/triggers/v1alpha1/trigger_template_validation.go index ab511754b..53a631693 100644 --- a/pkg/apis/triggers/v1alpha1/trigger_template_validation.go +++ b/pkg/apis/triggers/v1alpha1/trigger_template_validation.go @@ -22,7 +22,7 @@ import ( "regexp" "strings" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/validate" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/apis/triggers/v1alpha1/trigger_template_validation_test.go b/pkg/apis/triggers/v1alpha1/trigger_template_validation_test.go index 0626fa66b..7c4a80f89 100644 --- a/pkg/apis/triggers/v1alpha1/trigger_template_validation_test.go +++ b/pkg/apis/triggers/v1alpha1/trigger_template_validation_test.go @@ -32,6 +32,9 @@ import ( var simpleResourceTemplate = runtime.RawExtension{ Raw: []byte(`{"kind":"PipelineRun","apiVersion":"tekton.dev/v1alpha1","metadata":{"creationTimestamp":null},"spec":{},"status":{}}`), } +var v1beta1ResourceTemplate = runtime.RawExtension{ + Raw: []byte(`{"kind":"PipelineRun","apiVersion":"tekton.dev/v1beta1","metadata":{"creationTimestamp":null},"spec":{},"status":{}}`), +} var paramResourceTemplate = runtime.RawExtension{ Raw: []byte(`{"kind":"PipelineRun","apiVersion":"tekton.dev/v1alpha1","metadata":{"creationTimestamp":null},"spec": "$(params.foo)","status":{}}`), } @@ -70,6 +73,12 @@ func TestTriggerTemplate_Validate(t *testing.T) { b.TriggerTemplateParam("foo", "desc", "val"), b.TriggerResourceTemplate(simpleResourceTemplate))), want: nil, + }, { + name: "valid v1beta1 template", + template: b.TriggerTemplate("tt", "foo", b.TriggerTemplateSpec( + b.TriggerTemplateParam("foo", "desc", "val"), + b.TriggerResourceTemplate(v1beta1ResourceTemplate))), + want: nil, }, { name: "missing resource template", template: b.TriggerTemplate("tt", "foo", b.TriggerTemplateSpec( diff --git a/pkg/client/dynamic/clientset/tekton/tekton.go b/pkg/client/dynamic/clientset/tekton/tekton.go index b8c6414f0..09d7cc700 100644 --- a/pkg/client/dynamic/clientset/tekton/tekton.go +++ b/pkg/client/dynamic/clientset/tekton/tekton.go @@ -9,6 +9,7 @@ import ( var allowedTektonTypes = map[string][]string{ "v1alpha1": {"pipelineresources", "pipelineruns", "taskruns", "pipelines", "clustertasks", "tasks", "conditions"}, + "v1beta1": {"pipelineruns", "taskruns", "pipelines", "clustertasks", "tasks"}, } // WithClient adds Tekton related clients to the Dynamic client. diff --git a/pkg/interceptors/webhook/webhook.go b/pkg/interceptors/webhook/webhook.go index 0928ef517..a0bf957eb 100644 --- a/pkg/interceptors/webhook/webhook.go +++ b/pkg/interceptors/webhook/webhook.go @@ -24,7 +24,7 @@ import ( "net/url" "time" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/interceptors" corev1 "k8s.io/api/core/v1" diff --git a/pkg/interceptors/webhook/webhook_test.go b/pkg/interceptors/webhook/webhook_test.go index 15aed671a..6e749d0a5 100644 --- a/pkg/interceptors/webhook/webhook_test.go +++ b/pkg/interceptors/webhook/webhook_test.go @@ -27,7 +27,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" corev1 "k8s.io/api/core/v1" ) diff --git a/pkg/sink/sink_test.go b/pkg/sink/sink_test.go index eebe4eb73..5b1ecac9c 100644 --- a/pkg/sink/sink_test.go +++ b/pkg/sink/sink_test.go @@ -31,7 +31,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/gorilla/mux" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/pkg/logging" triggersv1 "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" dynamicclientset "github.com/tektoncd/triggers/pkg/client/dynamic/clientset" @@ -63,7 +63,7 @@ func init() { } // Compare two PipelineResources for sorting purposes -func comparePR(x, y pipelinev1.PipelineResource) bool { +func comparePR(x, y pipelinev1alpha1.PipelineResource) bool { return x.GetName() < y.GetName() } @@ -93,14 +93,14 @@ func getSinkAssets(t *testing.T, resources test.Resources, elName string) (Sink, } // getCreatedPipelineResources returns the pipeline resources that were created from the given actions -func getCreatedPipelineResources(t *testing.T, actions []ktesting.Action) []pipelinev1.PipelineResource { +func getCreatedPipelineResources(t *testing.T, actions []ktesting.Action) []pipelinev1alpha1.PipelineResource { t.Helper() - prs := []pipelinev1.PipelineResource{} + prs := []pipelinev1alpha1.PipelineResource{} for i := range actions { obj := actions[i].(ktesting.CreateAction).GetObject() // Since we use dynamic client, we cannot directly get the concrete type uns := obj.(*unstructured.Unstructured).Object - pr := pipelinev1.PipelineResource{} + pr := pipelinev1alpha1.PipelineResource{} if err := runtime.DefaultUnstructuredConverter.FromUnstructured(uns, &pr); err != nil { t.Errorf("failed to get created pipeline resource: %v", err) } @@ -134,7 +134,7 @@ func TestHandleEvent(t *testing.T) { eventBody := json.RawMessage(`{"head_commit": {"id": "testrevision"}, "repository": {"url": "testurl"}, "foo": "bar\t\r\nbaz昨"}`) numTriggers := 10 - pipelineResource := pipelinev1.PipelineResource{ + pipelineResource := pipelinev1alpha1.PipelineResource{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1alpha1", Kind: "PipelineResource", @@ -147,9 +147,9 @@ func TestHandleEvent(t *testing.T) { "type": "$(params.type)", }, }, - Spec: pipelinev1.PipelineResourceSpec{ - Type: pipelinev1.PipelineResourceTypeGit, - Params: []pipelinev1.ResourceParam{ + Spec: pipelinev1alpha1.PipelineResourceSpec{ + Type: pipelinev1alpha1.PipelineResourceTypeGit, + Params: []pipelinev1alpha1.ResourceParam{ {Name: "url", Value: "$(params.url)"}, {Name: "revision", Value: "$(params.revision)"}, }, @@ -209,9 +209,9 @@ func TestHandleEvent(t *testing.T) { checkSinkResponse(t, resp, el.Name) // Check right resources were created. - var wantPrs []pipelinev1.PipelineResource + var wantPrs []pipelinev1alpha1.PipelineResource for i := 0; i < numTriggers; i++ { - wantResource := pipelinev1.PipelineResource{ + wantResource := pipelinev1alpha1.PipelineResource{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1alpha1", Kind: "PipelineResource", @@ -227,9 +227,9 @@ func TestHandleEvent(t *testing.T) { eventIDLabel: eventID, }, }, - Spec: pipelinev1.PipelineResourceSpec{ - Type: pipelinev1.PipelineResourceTypeGit, - Params: []pipelinev1.ResourceParam{ + Spec: pipelinev1alpha1.PipelineResourceSpec{ + Type: pipelinev1alpha1.PipelineResourceTypeGit, + Params: []pipelinev1alpha1.ResourceParam{ {Name: "url", Value: "testurl"}, {Name: "revision", Value: "testrevision"}, }, @@ -247,7 +247,7 @@ func TestHandleEvent(t *testing.T) { func TestHandleEventWithInterceptors(t *testing.T) { eventBody := json.RawMessage(`{"head_commit": {"id": "testrevision"}, "repository": {"url": "testurl"}, "foo": "bar\t\r\nbaz昨"}`) - pipelineResource := pipelinev1.PipelineResource{ + pipelineResource := pipelinev1alpha1.PipelineResource{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1alpha1", Kind: "PipelineResource", @@ -256,9 +256,9 @@ func TestHandleEventWithInterceptors(t *testing.T) { Name: "my-pipelineresource", Namespace: namespace, }, - Spec: pipelinev1.PipelineResourceSpec{ - Type: pipelinev1.PipelineResourceTypeGit, - Params: []pipelinev1.ResourceParam{{ + Spec: pipelinev1alpha1.PipelineResourceSpec{ + Type: pipelinev1alpha1.PipelineResourceTypeGit, + Params: []pipelinev1alpha1.ResourceParam{{ Name: "url", Value: "$(params.url)", }}, @@ -339,7 +339,7 @@ func TestHandleEventWithInterceptors(t *testing.T) { } checkSinkResponse(t, resp, el.Name) - wantResource := []pipelinev1.PipelineResource{{ + wantResource := []pipelinev1alpha1.PipelineResource{{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1alpha1", Kind: "PipelineResource", @@ -353,9 +353,9 @@ func TestHandleEventWithInterceptors(t *testing.T) { eventIDLabel: eventID, }, }, - Spec: pipelinev1.PipelineResourceSpec{ - Type: pipelinev1.PipelineResourceTypeGit, - Params: []pipelinev1.ResourceParam{ + Spec: pipelinev1alpha1.PipelineResourceSpec{ + Type: pipelinev1alpha1.PipelineResourceTypeGit, + Params: []pipelinev1alpha1.ResourceParam{ {Name: "url", Value: "testurl"}, }, }, @@ -394,7 +394,7 @@ func TestHandleEventWithWebhookInterceptors(t *testing.T) { eventBody := json.RawMessage(`{}`) numTriggers := 10 - resourceTemplate := pipelinev1.PipelineResource{ + resourceTemplate := pipelinev1alpha1.PipelineResource{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1alpha1", Kind: "PipelineResource", @@ -403,8 +403,8 @@ func TestHandleEventWithWebhookInterceptors(t *testing.T) { Name: "$(params.name)", Namespace: namespace, }, - Spec: pipelinev1.PipelineResourceSpec{ - Type: pipelinev1.PipelineResourceTypeGit, + Spec: pipelinev1alpha1.PipelineResourceSpec{ + Type: pipelinev1alpha1.PipelineResourceTypeGit, }, } resourceTemplateBytes, err := json.Marshal(resourceTemplate) @@ -435,7 +435,7 @@ func TestHandleEventWithWebhookInterceptors(t *testing.T) { Interceptors: []*triggersv1.EventInterceptor{{ Webhook: &triggersv1.WebhookInterceptor{ ObjectRef: interceptorObjectRef, - Header: []pipelinev1.Param{bldr.Param("Name", fmt.Sprintf("my-resource-%d", i))}, + Header: []pipelinev1alpha1.Param{bldr.Param("Name", fmt.Sprintf("my-resource-%d", i))}, }, }}, } @@ -478,7 +478,7 @@ func TestHandleEventWithWebhookInterceptors(t *testing.T) { } checkSinkResponse(t, resp, el.Name) - var wantPRs []pipelinev1.PipelineResource + var wantPRs []pipelinev1alpha1.PipelineResource for i := 0; i < numTriggers; i++ { wantResource := resourceTemplate.DeepCopy() wantResource.ObjectMeta.Name = fmt.Sprintf("my-resource-%d", i) diff --git a/pkg/template/event.go b/pkg/template/event.go index 3867af3b1..115730535 100644 --- a/pkg/template/event.go +++ b/pkg/template/event.go @@ -22,7 +22,7 @@ import ( "net/http" "strings" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" triggersv1 "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" ) diff --git a/pkg/template/event_test.go b/pkg/template/event_test.go index c13f3f2bd..e97a9d49e 100644 --- a/pkg/template/event_test.go +++ b/pkg/template/event_test.go @@ -24,7 +24,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" triggersv1 "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" "github.com/tektoncd/triggers/test" bldr "github.com/tektoncd/triggers/test/builder" diff --git a/pkg/template/resource.go b/pkg/template/resource.go index 9570c3097..66068c3d2 100644 --- a/pkg/template/resource.go +++ b/pkg/template/resource.go @@ -22,7 +22,7 @@ import ( "fmt" "strings" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" triggersv1 "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/template/resource_test.go b/pkg/template/resource_test.go index 639b71306..14c565c2b 100644 --- a/pkg/template/resource_test.go +++ b/pkg/template/resource_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" triggersv1 "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" "github.com/tektoncd/triggers/test" bldr "github.com/tektoncd/triggers/test/builder" @@ -32,78 +32,78 @@ import ( func Test_MergeInDefaultParams(t *testing.T) { var ( - oneParam = pipelinev1.Param{ + oneParam = pipelinev1beta1.Param{ Name: "oneid", - Value: pipelinev1.ArrayOrString{StringVal: "onevalue"}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "onevalue"}, } - oneParamSpec = pipelinev1.ParamSpec{ + oneParamSpec = pipelinev1beta1.ParamSpec{ Name: "oneid", - Default: &pipelinev1.ArrayOrString{StringVal: "onedefault"}, + Default: &pipelinev1beta1.ArrayOrString{StringVal: "onedefault"}, } - wantDefaultOneParam = pipelinev1.Param{ + wantDefaultOneParam = pipelinev1beta1.Param{ Name: "oneid", - Value: pipelinev1.ArrayOrString{StringVal: "onedefault"}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "onedefault"}, } - twoParamSpec = pipelinev1.ParamSpec{ + twoParamSpec = pipelinev1beta1.ParamSpec{ Name: "twoid", - Default: &pipelinev1.ArrayOrString{StringVal: "twodefault"}, + Default: &pipelinev1beta1.ArrayOrString{StringVal: "twodefault"}, } - wantDefaultTwoParam = pipelinev1.Param{ + wantDefaultTwoParam = pipelinev1beta1.Param{ Name: "twoid", - Value: pipelinev1.ArrayOrString{StringVal: "twodefault"}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "twodefault"}, } - threeParamSpec = pipelinev1.ParamSpec{ + threeParamSpec = pipelinev1beta1.ParamSpec{ Name: "threeid", - Default: &pipelinev1.ArrayOrString{StringVal: "threedefault"}, + Default: &pipelinev1beta1.ArrayOrString{StringVal: "threedefault"}, } - wantDefaultThreeParam = pipelinev1.Param{ + wantDefaultThreeParam = pipelinev1beta1.Param{ Name: "threeid", - Value: pipelinev1.ArrayOrString{StringVal: "threedefault"}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "threedefault"}, } - noDefaultParamSpec = pipelinev1.ParamSpec{ + noDefaultParamSpec = pipelinev1beta1.ParamSpec{ Name: "nodefault", } ) type args struct { - params []pipelinev1.Param - paramSpecs []pipelinev1.ParamSpec + params []pipelinev1beta1.Param + paramSpecs []pipelinev1beta1.ParamSpec } tests := []struct { name string args args - want []pipelinev1.Param + want []pipelinev1beta1.Param }{ { name: "add one default param", args: args{ - params: []pipelinev1.Param{}, - paramSpecs: []pipelinev1.ParamSpec{oneParamSpec}, + params: []pipelinev1beta1.Param{}, + paramSpecs: []pipelinev1beta1.ParamSpec{oneParamSpec}, }, - want: []pipelinev1.Param{wantDefaultOneParam}, + want: []pipelinev1beta1.Param{wantDefaultOneParam}, }, { name: "add multiple default params", args: args{ - params: []pipelinev1.Param{}, - paramSpecs: []pipelinev1.ParamSpec{oneParamSpec, twoParamSpec, threeParamSpec}, + params: []pipelinev1beta1.Param{}, + paramSpecs: []pipelinev1beta1.ParamSpec{oneParamSpec, twoParamSpec, threeParamSpec}, }, - want: []pipelinev1.Param{wantDefaultOneParam, wantDefaultTwoParam, wantDefaultThreeParam}, + want: []pipelinev1beta1.Param{wantDefaultOneParam, wantDefaultTwoParam, wantDefaultThreeParam}, }, { name: "do not override existing value", args: args{ - params: []pipelinev1.Param{oneParam}, - paramSpecs: []pipelinev1.ParamSpec{oneParamSpec}, + params: []pipelinev1beta1.Param{oneParam}, + paramSpecs: []pipelinev1beta1.ParamSpec{oneParamSpec}, }, - want: []pipelinev1.Param{oneParam}, + want: []pipelinev1beta1.Param{oneParam}, }, { name: "add no default params", args: args{ - params: []pipelinev1.Param{}, - paramSpecs: []pipelinev1.ParamSpec{noDefaultParamSpec}, + params: []pipelinev1beta1.Param{}, + paramSpecs: []pipelinev1beta1.ParamSpec{noDefaultParamSpec}, }, - want: []pipelinev1.Param{}, + want: []pipelinev1beta1.Param{}, }, } for _, tt := range tests { @@ -118,9 +118,9 @@ func Test_MergeInDefaultParams(t *testing.T) { func Test_applyParamToResourceTemplate(t *testing.T) { var ( - oneParam = pipelinev1.Param{ + oneParam = pipelinev1beta1.Param{ Name: "oneid", - Value: pipelinev1.ArrayOrString{StringVal: "onevalue"}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "onevalue"}, } rtNoParamVars = json.RawMessage(`{"foo": "bar"}`) wantRtNoParamVars = json.RawMessage(`{"foo": "bar"}`) @@ -132,7 +132,7 @@ func Test_applyParamToResourceTemplate(t *testing.T) { wantRtMultipleParamVars = json.RawMessage(`{"onevalue": "bar-onevalue-onevalueonevalueonevalue-onevalue-bar"}`) ) type args struct { - param pipelinev1.Param + param pipelinev1beta1.Param rt json.RawMessage } tests := []struct { @@ -174,9 +174,9 @@ func Test_applyParamToResourceTemplate(t *testing.T) { }, { name: "espcae quotes in param val", args: args{ - param: pipelinev1.Param{ + param: pipelinev1beta1.Param{ Name: "p1", - Value: pipelinev1.ArrayOrString{ + Value: pipelinev1beta1.ArrayOrString{ StringVal: `{"a":"b"}`, }, }, @@ -198,7 +198,7 @@ func Test_applyParamToResourceTemplate(t *testing.T) { func Test_ApplyParamsToResourceTemplate(t *testing.T) { rt := json.RawMessage(`{"oneparam": "$(params.oneid)", "twoparam": "$(params.twoid)", "threeparam": "$(params.threeid)"`) type args struct { - params []pipelinev1.Param + params []pipelinev1beta1.Param rt json.RawMessage } tests := []struct { @@ -209,7 +209,7 @@ func Test_ApplyParamsToResourceTemplate(t *testing.T) { { name: "no params", args: args{ - params: []pipelinev1.Param{}, + params: []pipelinev1beta1.Param{}, rt: rt, }, want: rt, @@ -217,8 +217,8 @@ func Test_ApplyParamsToResourceTemplate(t *testing.T) { { name: "one param", args: args{ - params: []pipelinev1.Param{ - {Name: "oneid", Value: pipelinev1.ArrayOrString{StringVal: "onevalue"}}, + params: []pipelinev1beta1.Param{ + {Name: "oneid", Value: pipelinev1beta1.ArrayOrString{StringVal: "onevalue"}}, }, rt: rt, }, @@ -227,10 +227,10 @@ func Test_ApplyParamsToResourceTemplate(t *testing.T) { { name: "multiple params", args: args{ - params: []pipelinev1.Param{ - {Name: "oneid", Value: pipelinev1.ArrayOrString{StringVal: "onevalue"}}, - {Name: "twoid", Value: pipelinev1.ArrayOrString{StringVal: "twovalue"}}, - {Name: "threeid", Value: pipelinev1.ArrayOrString{StringVal: "threevalue"}}, + params: []pipelinev1beta1.Param{ + {Name: "oneid", Value: pipelinev1beta1.ArrayOrString{StringVal: "onevalue"}}, + {Name: "twoid", Value: pipelinev1beta1.ArrayOrString{StringVal: "twovalue"}}, + {Name: "threeid", Value: pipelinev1beta1.ArrayOrString{StringVal: "threevalue"}}, }, rt: rt, }, @@ -255,10 +255,10 @@ var ( "tb-params": { ObjectMeta: metav1.ObjectMeta{Name: "tb-params"}, Spec: triggersv1.TriggerBindingSpec{ - Params: []pipelinev1.Param{{ + Params: []pipelinev1beta1.Param{{ Name: "foo", - Value: pipelinev1.ArrayOrString{ - Type: pipelinev1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "bar", }, }}, @@ -276,10 +276,10 @@ var ( "ctb-params": { ObjectMeta: metav1.ObjectMeta{Name: "ctb-params"}, Spec: triggersv1.TriggerBindingSpec{ - Params: []pipelinev1.Param{{ + Params: []pipelinev1beta1.Param{{ Name: "foo-ctb", - Value: pipelinev1.ArrayOrString{ - Type: pipelinev1.ParamTypeString, + Value: pipelinev1beta1.ArrayOrString{ + Type: pipelinev1beta1.ParamTypeString, StringVal: "bar-ctb", }, }}, @@ -525,7 +525,7 @@ func TestMergeBindingParams(t *testing.T) { name string bindings []*triggersv1.TriggerBinding clusterBindings []*triggersv1.ClusterTriggerBinding - want []pipelinev1.Param + want []pipelinev1beta1.Param wantErr bool }{{ name: "empty bindings", @@ -534,7 +534,7 @@ func TestMergeBindingParams(t *testing.T) { bldr.TriggerBinding("", "", bldr.TriggerBindingSpec()), bldr.TriggerBinding("", "", bldr.TriggerBindingSpec()), }, - want: []pipelinev1.Param{}, + want: []pipelinev1beta1.Param{}, }, { name: "single binding with multiple params", clusterBindings: []*triggersv1.ClusterTriggerBinding{}, @@ -544,12 +544,12 @@ func TestMergeBindingParams(t *testing.T) { bldr.TriggerBindingParam("param2", "value2"), )), }, - want: []pipelinev1.Param{{ + want: []pipelinev1beta1.Param{{ Name: "param1", - Value: pipelinev1.ArrayOrString{StringVal: "value1", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value1", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param2", - Value: pipelinev1.ArrayOrString{StringVal: "value2", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value2", Type: pipelinev1beta1.ParamTypeString}, }}, }, { name: "single cluster type binding with multiple params", @@ -560,12 +560,12 @@ func TestMergeBindingParams(t *testing.T) { )), }, bindings: []*triggersv1.TriggerBinding{}, - want: []pipelinev1.Param{{ + want: []pipelinev1beta1.Param{{ Name: "param1", - Value: pipelinev1.ArrayOrString{StringVal: "value1", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value1", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param2", - Value: pipelinev1.ArrayOrString{StringVal: "value2", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value2", Type: pipelinev1beta1.ParamTypeString}, }}, }, { name: "multiple bindings each with multiple params", @@ -585,24 +585,24 @@ func TestMergeBindingParams(t *testing.T) { bldr.TriggerBindingParam("param4", "value4"), )), }, - want: []pipelinev1.Param{{ + want: []pipelinev1beta1.Param{{ Name: "param1", - Value: pipelinev1.ArrayOrString{StringVal: "value1", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value1", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param2", - Value: pipelinev1.ArrayOrString{StringVal: "value2", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value2", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param3", - Value: pipelinev1.ArrayOrString{StringVal: "value3", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value3", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param4", - Value: pipelinev1.ArrayOrString{StringVal: "value4", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value4", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param5", - Value: pipelinev1.ArrayOrString{StringVal: "value1", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value1", Type: pipelinev1beta1.ParamTypeString}, }, { Name: "param6", - Value: pipelinev1.ArrayOrString{StringVal: "value2", Type: pipelinev1.ParamTypeString}, + Value: pipelinev1beta1.ArrayOrString{StringVal: "value2", Type: pipelinev1beta1.ParamTypeString}, }}, }, { name: "multiple bindings with duplicate params", diff --git a/test/builder/clustertriggerbinding_test.go b/test/builder/clustertriggerbinding_test.go index d526307f0..429f73838 100644 --- a/test/builder/clustertriggerbinding_test.go +++ b/test/builder/clustertriggerbinding_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/builder/eventlistener.go b/test/builder/eventlistener.go index 67f587455..f4ec03038 100644 --- a/test/builder/eventlistener.go +++ b/test/builder/eventlistener.go @@ -1,7 +1,7 @@ package builder import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/builder/eventlistener_test.go b/test/builder/eventlistener_test.go index 69b7ec809..3e1e3d741 100644 --- a/test/builder/eventlistener_test.go +++ b/test/builder/eventlistener_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/builder/param.go b/test/builder/param.go index 39e69cee7..f4bec1f82 100644 --- a/test/builder/param.go +++ b/test/builder/param.go @@ -1,12 +1,12 @@ package builder -import "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" +import "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" -func Param(name, value string) v1alpha1.Param { - return v1alpha1.Param{ +func Param(name, value string) v1beta1.Param { + return v1beta1.Param{ Name: name, - Value: v1alpha1.ArrayOrString{ - Type: v1alpha1.ParamTypeString, + Value: v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeString, StringVal: value, }, } diff --git a/test/builder/param_test.go b/test/builder/param_test.go index 4236fd934..a936f5bc7 100644 --- a/test/builder/param_test.go +++ b/test/builder/param_test.go @@ -4,16 +4,16 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) func TestParam(t *testing.T) { got := Param("foo", "bar") - want := v1alpha1.Param{ + want := v1beta1.Param{ Name: "foo", - Value: v1alpha1.ArrayOrString{ - Type: v1alpha1.ParamTypeString, + Value: v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeString, StringVal: "bar", }, } diff --git a/test/builder/triggerbinding.go b/test/builder/triggerbinding.go index 3c50a2e01..2723e796e 100644 --- a/test/builder/triggerbinding.go +++ b/test/builder/triggerbinding.go @@ -1,7 +1,7 @@ package builder import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/builder/triggerbinding_test.go b/test/builder/triggerbinding_test.go index 4bd3e63ed..3f8772df0 100644 --- a/test/builder/triggerbinding_test.go +++ b/test/builder/triggerbinding_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/builder/triggertemplate.go b/test/builder/triggertemplate.go index a11a0e48e..e9be82120 100644 --- a/test/builder/triggertemplate.go +++ b/test/builder/triggertemplate.go @@ -1,7 +1,7 @@ package builder import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/test/builder/triggertemplate_test.go b/test/builder/triggertemplate_test.go index ddfd7a266..cfcacd8de 100644 --- a/test/builder/triggertemplate_test.go +++ b/test/builder/triggertemplate_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/triggers/pkg/apis/triggers/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/test/params.go b/test/params.go index c9e5d1348..403698cda 100644 --- a/test/params.go +++ b/test/params.go @@ -17,7 +17,7 @@ limitations under the License. package test import ( - pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" + pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // CompareParams can be used with comparison options such as `cmpopts.SortSlices`