diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 551cf3f4a6e..619fb2e194f 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -22,7 +22,7 @@ import ( defaultconfig "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" "k8s.io/apimachinery/pkg/runtime/schema" "knative.dev/pkg/configmap" @@ -47,12 +47,12 @@ var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{ v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{}, v1alpha1.SchemeGroupVersion.WithKind("Condition"): &v1alpha1.Condition{}, v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{}, - // v1alpha2 - v1alpha2.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha2.Pipeline{}, - v1alpha2.SchemeGroupVersion.WithKind("Task"): &v1alpha2.Task{}, - v1alpha2.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha2.ClusterTask{}, - v1alpha2.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha2.TaskRun{}, - v1alpha2.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha2.PipelineRun{}, + // v1beta1 + v1beta1.SchemeGroupVersion.WithKind("Pipeline"): &v1beta1.Pipeline{}, + v1beta1.SchemeGroupVersion.WithKind("Task"): &v1beta1.Task{}, + v1beta1.SchemeGroupVersion.WithKind("ClusterTask"): &v1beta1.ClusterTask{}, + v1beta1.SchemeGroupVersion.WithKind("TaskRun"): &v1beta1.TaskRun{}, + v1beta1.SchemeGroupVersion.WithKind("PipelineRun"): &v1beta1.PipelineRun{}, } func NewDefaultingAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl { diff --git a/codecov.yml b/codecov.yml index 3a52d809b18..f2511b21bd1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,3 @@ ignore: - "pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go" -- "pkg/apis/pipeline/v1alpha2/zz_generated.deepcopy.go" +- "pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go" diff --git a/config/300-clustertask.yaml b/config/300-clustertask.yaml index 8a58f066642..d51db7ed32e 100644 --- a/config/300-clustertask.yaml +++ b/config/300-clustertask.yaml @@ -21,7 +21,7 @@ spec: - name: v1alpha1 served: true storage: true - - name: v1alpha2 + - name: v1beta1 served: true storage: false names: diff --git a/config/300-pipeline.yaml b/config/300-pipeline.yaml index 025aff50645..8c8b45cc8d5 100644 --- a/config/300-pipeline.yaml +++ b/config/300-pipeline.yaml @@ -21,7 +21,7 @@ spec: - name: v1alpha1 served: true storage: true - - name: v1alpha2 + - name: v1beta1 served: true storage: false names: diff --git a/config/300-pipelinerun.yaml b/config/300-pipelinerun.yaml index 6402ee01bea..f5967048015 100644 --- a/config/300-pipelinerun.yaml +++ b/config/300-pipelinerun.yaml @@ -21,7 +21,7 @@ spec: - name: v1alpha1 served: true storage: true - - name: v1alpha2 + - name: v1beta1 served: true storage: false names: diff --git a/config/300-task.yaml b/config/300-task.yaml index e5f01bdf2e3..53dcc1fdb86 100644 --- a/config/300-task.yaml +++ b/config/300-task.yaml @@ -21,7 +21,7 @@ spec: - name: v1alpha1 served: true storage: true - - name: v1alpha2 + - name: v1beta1 served: true storage: false names: diff --git a/config/300-taskrun.yaml b/config/300-taskrun.yaml index a26188829d4..ba6bb1892f2 100644 --- a/config/300-taskrun.yaml +++ b/config/300-taskrun.yaml @@ -21,7 +21,7 @@ spec: - name: v1alpha1 served: true storage: true - - name: v1alpha2 + - name: v1beta1 served: true storage: false names: diff --git a/examples/v1alpha2/pipelineruns/clustertask-pipelinerun.yaml b/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml similarity index 84% rename from examples/v1alpha2/pipelineruns/clustertask-pipelinerun.yaml rename to examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml index 0fda9c8be35..d70960dbb12 100644 --- a/examples/v1alpha2/pipelineruns/clustertask-pipelinerun.yaml +++ b/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: name: cluster-task-pipeline-4 @@ -9,7 +9,7 @@ spec: command: ["/bin/bash"] args: ['-c', 'echo success'] --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: sample-pipeline-cluster-task-4 @@ -20,7 +20,7 @@ spec: name: cluster-task-pipeline-4 kind: ClusterTask --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-pipeline-run-4 diff --git a/examples/v1alpha2/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml b/examples/v1beta1/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml similarity index 95% rename from examples/v1alpha2/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml rename to examples/v1beta1/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml index 9638d00f6f1..2f7913fa884 100644 --- a/examples/v1alpha2/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml +++ b/examples/v1beta1/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml @@ -25,7 +25,7 @@ spec: - name: url value: https://github.com/tektoncd/pipeline --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: list-pipeline-repo-files @@ -40,7 +40,7 @@ spec: image: ubuntu script: 'ls -al $(inputs.resources.optional-workspace.path)' --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: pipeline-list-pipeline-repo-files @@ -71,7 +71,7 @@ spec: - name: optional-workspace resource: pipeline-source-repo --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-condtional-pr-without-condition-resource diff --git a/examples/v1alpha2/pipelineruns/conditional-pipelinerun.yaml b/examples/v1beta1/pipelineruns/conditional-pipelinerun.yaml similarity index 93% rename from examples/v1alpha2/pipelineruns/conditional-pipelinerun.yaml rename to examples/v1beta1/pipelineruns/conditional-pipelinerun.yaml index 9ac6f92f50e..cb67198440f 100644 --- a/examples/v1alpha2/pipelineruns/conditional-pipelinerun.yaml +++ b/examples/v1beta1/pipelineruns/conditional-pipelinerun.yaml @@ -24,7 +24,7 @@ spec: - name: url value: https://github.com/tektoncd/pipeline --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: create-readme-file @@ -38,7 +38,7 @@ spec: image: ubuntu script: 'touch $(resources.outputs.workspace.path)/README.md' --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: echo-hello @@ -48,7 +48,7 @@ spec: image: ubuntu script: 'echo hello' --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: conditional-pipeline @@ -80,7 +80,7 @@ spec: taskRef: name: echo-hello --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: condtional-pr diff --git a/examples/v1alpha2/pipelineruns/demo-optional-resources.yaml b/examples/v1beta1/pipelineruns/demo-optional-resources.yaml similarity index 95% rename from examples/v1alpha2/pipelineruns/demo-optional-resources.yaml rename to examples/v1beta1/pipelineruns/demo-optional-resources.yaml index 450a25b3585..ea26fde0c9f 100644 --- a/examples/v1alpha2/pipelineruns/demo-optional-resources.yaml +++ b/examples/v1beta1/pipelineruns/demo-optional-resources.yaml @@ -28,7 +28,7 @@ spec: script: 'test ! -z $(resources.built-image.url)' --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-an-image @@ -56,7 +56,7 @@ spec: - --destination=$(resources.outputs.built-image.url) --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: demo-pipeline-to-build-an-image @@ -97,7 +97,7 @@ spec: --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-pipeline-to-build-an-image-without-resources @@ -107,7 +107,7 @@ spec: serviceAccountName: 'default' --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-pipeline-to-build-an-image-without-image-resource diff --git a/examples/v1alpha2/pipelineruns/no-ci/.keep b/examples/v1beta1/pipelineruns/no-ci/.keep similarity index 100% rename from examples/v1alpha2/pipelineruns/no-ci/.keep rename to examples/v1beta1/pipelineruns/no-ci/.keep diff --git a/examples/v1alpha2/pipelineruns/no-ci/limitrange.yaml b/examples/v1beta1/pipelineruns/no-ci/limitrange.yaml similarity index 90% rename from examples/v1alpha2/pipelineruns/no-ci/limitrange.yaml rename to examples/v1beta1/pipelineruns/no-ci/limitrange.yaml index face542a97e..0b8f6dfdce9 100644 --- a/examples/v1alpha2/pipelineruns/no-ci/limitrange.yaml +++ b/examples/v1beta1/pipelineruns/no-ci/limitrange.yaml @@ -18,7 +18,7 @@ spec: memory: "111Mi" type: Container --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: echo-hello-world @@ -31,7 +31,7 @@ spec: args: - "hello world" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: pipeline-hello @@ -46,7 +46,7 @@ spec: runAfter: - hello-world-1 --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: pipeline-hello-run- diff --git a/examples/v1alpha2/pipelineruns/no-ci/pipeline-timeout.yaml b/examples/v1beta1/pipelineruns/no-ci/pipeline-timeout.yaml similarity index 95% rename from examples/v1alpha2/pipelineruns/no-ci/pipeline-timeout.yaml rename to examples/v1beta1/pipelineruns/no-ci/pipeline-timeout.yaml index dd8483d24f0..2a22ce01719 100644 --- a/examples/v1alpha2/pipelineruns/no-ci/pipeline-timeout.yaml +++ b/examples/v1beta1/pipelineruns/no-ci/pipeline-timeout.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: task-echo-message @@ -16,7 +16,7 @@ spec: - "$(inputs.params.MESSAGE)" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: pipelinerun-timeout diff --git a/examples/v1alpha2/pipelineruns/output-pipelinerun.yaml b/examples/v1beta1/pipelineruns/output-pipelinerun.yaml similarity index 91% rename from examples/v1alpha2/pipelineruns/output-pipelinerun.yaml rename to examples/v1beta1/pipelineruns/output-pipelinerun.yaml index b48eed397f1..41e2cb7b7bd 100644 --- a/examples/v1alpha2/pipelineruns/output-pipelinerun.yaml +++ b/examples/v1beta1/pipelineruns/output-pipelinerun.yaml @@ -11,7 +11,7 @@ spec: value: https://github.com/GoogleContainerTools/skaffold --- # Task writes "some stuff" to a predefined path in the workspace git PipelineResource -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: create-file @@ -35,7 +35,7 @@ spec: args: ['-c', 'ln -s /workspace/damnworkspace /workspace/output/workspace && echo some stuff > /workspace/output/workspace/stuff'] --- # Reads a file from a predefined path in the workspace git PipelineResource -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: check-stuff-file-exists @@ -52,12 +52,12 @@ spec: - name: read image: ubuntu command: ["/bin/bash"] - args: ['$(params.args)'] # tests that new targetpath and previous task output is dumped + args: ['$(inputs.params.args[*])'] # tests that new targetpath and previous task output is dumped --- # The Output of the first Task (git resource) create-file is given as an `Input` # to the next `Task` check-stuff-file-exists using`from` clause. -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: output-pipeline @@ -90,7 +90,7 @@ spec: resource: source-repo from: [first-create-file] --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: output-pipeline-run diff --git a/examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml b/examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml similarity index 94% rename from examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml rename to examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml index 568be978a9d..652c18db13b 100644 --- a/examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml +++ b/examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec-and-taskspec.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: pipelinerun-with-taskspec-to-echo-good-morning @@ -15,7 +15,7 @@ spec: echo "Good Morning!" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: pipelinerun-with-taskspec-to-echo-message @@ -47,7 +47,7 @@ spec: value: "Good Morning!" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: pipelinerun-with-taskspec-to-echo-greetings diff --git a/examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec.yaml b/examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec.yaml similarity index 94% rename from examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec.yaml rename to examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec.yaml index 5cd0da41e31..d0b4b5e1d6e 100644 --- a/examples/v1alpha2/pipelineruns/pipelinerun-with-pipelinespec.yaml +++ b/examples/v1beta1/pipelineruns/pipelinerun-with-pipelinespec.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: task-echo-message @@ -16,7 +16,7 @@ spec: - "$(params.MESSAGE)" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: pipelinerun-echo-greetings diff --git a/examples/v1alpha2/pipelineruns/pipelinerun-with-resourcespec.yaml b/examples/v1beta1/pipelineruns/pipelinerun-with-resourcespec.yaml similarity index 95% rename from examples/v1alpha2/pipelineruns/pipelinerun-with-resourcespec.yaml rename to examples/v1beta1/pipelineruns/pipelinerun-with-resourcespec.yaml index 1471f09a357..85f4c7a7af4 100644 --- a/examples/v1alpha2/pipelineruns/pipelinerun-with-resourcespec.yaml +++ b/examples/v1beta1/pipelineruns/pipelinerun-with-resourcespec.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: task-to-list-files @@ -39,7 +39,7 @@ spec: echo "Hello from Tekton Pipeline!" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: pipeline-to-list-files @@ -78,7 +78,7 @@ spec: resource: pipeline-git --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-pipelinerun-with-resourcespec diff --git a/examples/v1alpha2/pipelineruns/pipelinerun.yaml b/examples/v1beta1/pipelineruns/pipelinerun.yaml similarity index 97% rename from examples/v1alpha2/pipelineruns/pipelinerun.yaml rename to examples/v1beta1/pipelineruns/pipelinerun.yaml index 5ae420bcf13..ee6da1b863e 100644 --- a/examples/v1alpha2/pipelineruns/pipelinerun.yaml +++ b/examples/v1beta1/pipelineruns/pipelinerun.yaml @@ -48,7 +48,7 @@ spec: - name: url value: https://github.com/GoogleContainerTools/skaffold --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: unit-tests @@ -70,7 +70,7 @@ spec: args: - "pass" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-push @@ -104,7 +104,7 @@ spec: - --context=$(params.pathToContext) --- # This task deploys with kubectl apply -f -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: demo-deploy-kubectl @@ -149,7 +149,7 @@ spec: # pushed are the ones that are deployed (that would require using the digest of # the built image, see https://github.com/tektoncd/pipeline/issues/216). -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: demo-pipeline @@ -238,7 +238,7 @@ spec: - name: yamlPathToImage value: "spec.template.spec.containers[0].image" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: demo-pipeline-run-1 diff --git a/examples/v1alpha2/pipelineruns/workspaces.yaml b/examples/v1beta1/pipelineruns/workspaces.yaml similarity index 96% rename from examples/v1alpha2/pipelineruns/workspaces.yaml rename to examples/v1beta1/pipelineruns/workspaces.yaml index f7dca7a78d6..18ee2757067 100644 --- a/examples/v1alpha2/pipelineruns/workspaces.yaml +++ b/examples/v1beta1/pipelineruns/workspaces.yaml @@ -45,7 +45,7 @@ spec: accessModes: - ReadWriteOnce --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: fetch-secure-data @@ -65,7 +65,7 @@ spec: exit 1 fi --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: print-data @@ -80,7 +80,7 @@ spec: image: ubuntu script: cat $(workspaces.storage.path)/$(params.filename) --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: fetch-and-print-recipe @@ -113,7 +113,7 @@ spec: - name: storage workspace: shared-data --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: recipe-time- diff --git a/examples/v1alpha2/taskruns/build-gcs-targz.yaml b/examples/v1beta1/taskruns/build-gcs-targz.yaml similarity index 94% rename from examples/v1alpha2/taskruns/build-gcs-targz.yaml rename to examples/v1beta1/taskruns/build-gcs-targz.yaml index 78a82ab1b73..f5a88edfce9 100644 --- a/examples/v1alpha2/taskruns/build-gcs-targz.yaml +++ b/examples/v1beta1/taskruns/build-gcs-targz.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: build-gcs-targz- diff --git a/examples/v1alpha2/taskruns/build-gcs-zip.yaml b/examples/v1beta1/taskruns/build-gcs-zip.yaml similarity index 94% rename from examples/v1alpha2/taskruns/build-gcs-zip.yaml rename to examples/v1beta1/taskruns/build-gcs-zip.yaml index fd721f7a8b3..c6807f481f0 100644 --- a/examples/v1alpha2/taskruns/build-gcs-zip.yaml +++ b/examples/v1beta1/taskruns/build-gcs-zip.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: build-gcs-zip- diff --git a/examples/v1alpha2/taskruns/build-push-kaniko.yaml b/examples/v1beta1/taskruns/build-push-kaniko.yaml similarity index 96% rename from examples/v1alpha2/taskruns/build-push-kaniko.yaml rename to examples/v1beta1/taskruns/build-push-kaniko.yaml index 3e511ab670d..f873c7412af 100644 --- a/examples/v1alpha2/taskruns/build-push-kaniko.yaml +++ b/examples/v1beta1/taskruns/build-push-kaniko.yaml @@ -21,7 +21,7 @@ spec: value: https://github.com/GoogleContainerTools/skaffold --- # Builds an image via kaniko and pushes it to registry. -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-push-kaniko @@ -58,7 +58,7 @@ spec: - image: registry name: registry --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: build-push-kaniko diff --git a/examples/v1alpha2/taskruns/cloud-event.yaml b/examples/v1beta1/taskruns/cloud-event.yaml similarity index 97% rename from examples/v1alpha2/taskruns/cloud-event.yaml rename to examples/v1beta1/taskruns/cloud-event.yaml index ab0073d8d59..230dcce4ee0 100644 --- a/examples/v1alpha2/taskruns/cloud-event.yaml +++ b/examples/v1beta1/taskruns/cloud-event.yaml @@ -61,7 +61,7 @@ spec: name: user-port protocol: TCP --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: send-cloud-event-task @@ -110,7 +110,7 @@ spec: ] } --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: poll-for-content-task @@ -151,7 +151,7 @@ spec: print("Not yet...") time.sleep(10) --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: send-cloud-event @@ -173,7 +173,7 @@ spec: taskRef: name: send-cloud-event-task --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: poll-for-content-run diff --git a/examples/v1alpha2/taskruns/clustertask.yaml b/examples/v1beta1/taskruns/clustertask.yaml similarity index 77% rename from examples/v1alpha2/taskruns/clustertask.yaml rename to examples/v1beta1/taskruns/clustertask.yaml index b31eed920d4..10972427dab 100644 --- a/examples/v1alpha2/taskruns/clustertask.yaml +++ b/examples/v1beta1/taskruns/clustertask.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: name: clustertask @@ -7,7 +7,7 @@ spec: - image: ubuntu script: echo hello --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: clustertask- diff --git a/examples/v1alpha2/taskruns/configmap.yaml b/examples/v1beta1/taskruns/configmap.yaml similarity index 95% rename from examples/v1alpha2/taskruns/configmap.yaml rename to examples/v1beta1/taskruns/configmap.yaml index cd0c80ea2cb..4e19a02d695 100644 --- a/examples/v1alpha2/taskruns/configmap.yaml +++ b/examples/v1beta1/taskruns/configmap.yaml @@ -5,7 +5,7 @@ metadata: data: test.data: tasks are my jam --- -apiVersion: tekton.dev/v1alpha1 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: configmap- diff --git a/examples/v1alpha2/taskruns/custom-env.yaml b/examples/v1beta1/taskruns/custom-env.yaml similarity index 87% rename from examples/v1alpha2/taskruns/custom-env.yaml rename to examples/v1beta1/taskruns/custom-env.yaml index 0636ffaffe8..6789d6f63a9 100644 --- a/examples/v1alpha2/taskruns/custom-env.yaml +++ b/examples/v1beta1/taskruns/custom-env.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: custom-env- diff --git a/examples/v1alpha2/taskruns/custom-volume.yaml b/examples/v1beta1/taskruns/custom-volume.yaml similarity index 94% rename from examples/v1alpha2/taskruns/custom-volume.yaml rename to examples/v1beta1/taskruns/custom-volume.yaml index 6f560d893f8..a8651693fba 100644 --- a/examples/v1alpha2/taskruns/custom-volume.yaml +++ b/examples/v1beta1/taskruns/custom-volume.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: custom-volume- diff --git a/examples/v1alpha2/taskruns/dind-sidecar.yaml b/examples/v1beta1/taskruns/dind-sidecar.yaml similarity index 97% rename from examples/v1alpha2/taskruns/dind-sidecar.yaml rename to examples/v1beta1/taskruns/dind-sidecar.yaml index aea99e26646..648e506dc73 100644 --- a/examples/v1alpha2/taskruns/dind-sidecar.yaml +++ b/examples/v1beta1/taskruns/dind-sidecar.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: dind-sidecar- diff --git a/examples/v1alpha2/taskruns/docker-creds.yaml b/examples/v1beta1/taskruns/docker-creds.yaml similarity index 99% rename from examples/v1alpha2/taskruns/docker-creds.yaml rename to examples/v1beta1/taskruns/docker-creds.yaml index 65f793372a1..6dccd514b9e 100644 --- a/examples/v1alpha2/taskruns/docker-creds.yaml +++ b/examples/v1beta1/taskruns/docker-creds.yaml @@ -28,7 +28,7 @@ secrets: imagePullSecrets: - name: docker-basic --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: docker-creds diff --git a/examples/v1alpha2/taskruns/gcs-resource.yaml b/examples/v1beta1/taskruns/gcs-resource.yaml similarity index 93% rename from examples/v1alpha2/taskruns/gcs-resource.yaml rename to examples/v1beta1/taskruns/gcs-resource.yaml index 0927ce4e4be..401ebfb753c 100644 --- a/examples/v1alpha2/taskruns/gcs-resource.yaml +++ b/examples/v1beta1/taskruns/gcs-resource.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: gcs-resource- diff --git a/examples/v1alpha2/taskruns/git-resource.yaml b/examples/v1beta1/taskruns/git-resource.yaml similarity index 93% rename from examples/v1alpha2/taskruns/git-resource.yaml rename to examples/v1beta1/taskruns/git-resource.yaml index e0a2f10b6fa..40602dddf44 100644 --- a/examples/v1alpha2/taskruns/git-resource.yaml +++ b/examples/v1beta1/taskruns/git-resource.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: git-resource-tag- @@ -22,7 +22,7 @@ spec: - name: url value: https://github.com/GoogleContainerTools/skaffold --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: git-resource-branch- @@ -46,7 +46,7 @@ spec: - name: url value: https://github.com/GoogleContainerTools/skaffold --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: git-resource-ref- diff --git a/examples/v1alpha2/taskruns/git-ssh-creds.yaml b/examples/v1beta1/taskruns/git-ssh-creds.yaml similarity index 99% rename from examples/v1alpha2/taskruns/git-ssh-creds.yaml rename to examples/v1beta1/taskruns/git-ssh-creds.yaml index ea0acedebcc..c3db19b96d5 100644 --- a/examples/v1alpha2/taskruns/git-ssh-creds.yaml +++ b/examples/v1beta1/taskruns/git-ssh-creds.yaml @@ -21,7 +21,7 @@ metadata: secrets: - name: git-ssh --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: git-ssh-creds diff --git a/examples/v1alpha2/taskruns/git-volume.yaml b/examples/v1beta1/taskruns/git-volume.yaml similarity index 94% rename from examples/v1alpha2/taskruns/git-volume.yaml rename to examples/v1beta1/taskruns/git-volume.yaml index 792aa32161a..bdd607701a6 100644 --- a/examples/v1alpha2/taskruns/git-volume.yaml +++ b/examples/v1beta1/taskruns/git-volume.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: git-volume- diff --git a/examples/v1alpha2/taskruns/home-is-set.yaml b/examples/v1beta1/taskruns/home-is-set.yaml similarity index 85% rename from examples/v1alpha2/taskruns/home-is-set.yaml rename to examples/v1beta1/taskruns/home-is-set.yaml index 54d6509317a..7a6c94d8cbe 100644 --- a/examples/v1alpha2/taskruns/home-is-set.yaml +++ b/examples/v1beta1/taskruns/home-is-set.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: home-is-set- diff --git a/examples/v1alpha2/taskruns/home-volume.yaml b/examples/v1beta1/taskruns/home-volume.yaml similarity index 95% rename from examples/v1alpha2/taskruns/home-volume.yaml rename to examples/v1beta1/taskruns/home-volume.yaml index bd8ede7d878..dcf881c29f0 100644 --- a/examples/v1alpha2/taskruns/home-volume.yaml +++ b/examples/v1beta1/taskruns/home-volume.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: home-volume- diff --git a/examples/v1alpha2/taskruns/no-ci/.keep b/examples/v1beta1/taskruns/no-ci/.keep similarity index 100% rename from examples/v1alpha2/taskruns/no-ci/.keep rename to examples/v1beta1/taskruns/no-ci/.keep diff --git a/examples/v1alpha2/taskruns/no-ci/limitrange.yaml b/examples/v1beta1/taskruns/no-ci/limitrange.yaml similarity index 92% rename from examples/v1alpha2/taskruns/no-ci/limitrange.yaml rename to examples/v1beta1/taskruns/no-ci/limitrange.yaml index 0c94e246cd5..69cd449c941 100644 --- a/examples/v1alpha2/taskruns/no-ci/limitrange.yaml +++ b/examples/v1beta1/taskruns/no-ci/limitrange.yaml @@ -18,7 +18,7 @@ spec: memory: "111Mi" type: Container --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: echo-hello-world @@ -31,7 +31,7 @@ spec: args: - "hello world" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: echo-hello-world-run- diff --git a/examples/v1alpha2/taskruns/optional-resources-with-clustertask.yaml b/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml similarity index 90% rename from examples/v1alpha2/taskruns/optional-resources-with-clustertask.yaml rename to examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml index b13793aa60c..1ecae87cf8d 100644 --- a/examples/v1alpha2/taskruns/optional-resources-with-clustertask.yaml +++ b/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: name: clustertask-with-optional-resources @@ -24,7 +24,7 @@ spec: echo "success" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: clustertask-without-resources diff --git a/examples/v1alpha2/taskruns/optional-resources.yaml b/examples/v1beta1/taskruns/optional-resources.yaml similarity index 94% rename from examples/v1alpha2/taskruns/optional-resources.yaml rename to examples/v1beta1/taskruns/optional-resources.yaml index de59343c202..78f564d3c2b 100644 --- a/examples/v1alpha2/taskruns/optional-resources.yaml +++ b/examples/v1beta1/taskruns/optional-resources.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: task-check-optional-resources @@ -41,7 +41,7 @@ spec: echo "Yay, Input and Output Resources can be Optional!" --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: demo-optional-inputs-resources-with-resources @@ -68,7 +68,7 @@ spec: name: task-check-optional-resources --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: demo-optional-inputs-resources-invalid-filename @@ -88,7 +88,7 @@ spec: name: task-check-optional-resources --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: demo-optional-inputs-resources-without-resources @@ -100,7 +100,7 @@ spec: name: task-check-optional-resources --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: demo-optional-inputs-resources-without-resources-and-params @@ -109,7 +109,7 @@ spec: name: task-check-optional-resources --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: demo-optional-outputs-resources-with-input-resources diff --git a/examples/v1alpha2/taskruns/pull-private-image.yaml b/examples/v1beta1/taskruns/pull-private-image.yaml similarity index 99% rename from examples/v1alpha2/taskruns/pull-private-image.yaml rename to examples/v1beta1/taskruns/pull-private-image.yaml index f28ee46a87e..9e09f89ca2b 100644 --- a/examples/v1alpha2/taskruns/pull-private-image.yaml +++ b/examples/v1beta1/taskruns/pull-private-image.yaml @@ -36,7 +36,7 @@ imagePullSecrets: --- # This example contains embedded taskSpec. This taskrun requires the secrets and service accounts to be able to pull the # private image. Required secret and service account for this run is configured in test-build-robot SA and test-readonly-credentials secret. -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: pull-private-image- diff --git a/examples/v1alpha2/taskruns/pullrequest.yaml b/examples/v1beta1/taskruns/pullrequest.yaml similarity index 96% rename from examples/v1alpha2/taskruns/pullrequest.yaml rename to examples/v1beta1/taskruns/pullrequest.yaml index 465e7656453..c380d01997a 100644 --- a/examples/v1alpha2/taskruns/pullrequest.yaml +++ b/examples/v1beta1/taskruns/pullrequest.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: pullrequest- diff --git a/examples/v1alpha2/taskruns/secret-env.yaml b/examples/v1beta1/taskruns/secret-env.yaml similarity index 93% rename from examples/v1alpha2/taskruns/secret-env.yaml rename to examples/v1beta1/taskruns/secret-env.yaml index f0360e3ab95..70849d5705d 100644 --- a/examples/v1alpha2/taskruns/secret-env.yaml +++ b/examples/v1beta1/taskruns/secret-env.yaml @@ -5,7 +5,7 @@ metadata: stringData: ninja: SECRET_PASSWORD --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: secret-env diff --git a/examples/v1alpha2/taskruns/secret-volume-params.yaml b/examples/v1beta1/taskruns/secret-volume-params.yaml similarity index 95% rename from examples/v1alpha2/taskruns/secret-volume-params.yaml rename to examples/v1beta1/taskruns/secret-volume-params.yaml index 6052ee8644e..07c9e6b74d0 100644 --- a/examples/v1alpha2/taskruns/secret-volume-params.yaml +++ b/examples/v1beta1/taskruns/secret-volume-params.yaml @@ -5,7 +5,7 @@ metadata: stringData: ninja: SECRET_PASSWORD --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: secret-volume-params diff --git a/examples/v1alpha2/taskruns/secret-volume.yaml b/examples/v1beta1/taskruns/secret-volume.yaml similarity index 94% rename from examples/v1alpha2/taskruns/secret-volume.yaml rename to examples/v1beta1/taskruns/secret-volume.yaml index 14d0984e677..7dbf23be356 100644 --- a/examples/v1alpha2/taskruns/secret-volume.yaml +++ b/examples/v1beta1/taskruns/secret-volume.yaml @@ -5,7 +5,7 @@ metadata: stringData: ninja: SECRET_PASSWORD --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: secret-volume diff --git a/examples/v1alpha2/taskruns/sidecar-interp.yaml b/examples/v1beta1/taskruns/sidecar-interp.yaml similarity index 95% rename from examples/v1alpha2/taskruns/sidecar-interp.yaml rename to examples/v1beta1/taskruns/sidecar-interp.yaml index 6aa642cbf04..885966f8875 100644 --- a/examples/v1alpha2/taskruns/sidecar-interp.yaml +++ b/examples/v1beta1/taskruns/sidecar-interp.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: sidecar-interp- diff --git a/examples/v1alpha2/taskruns/sidecar-ready-script.yaml b/examples/v1beta1/taskruns/sidecar-ready-script.yaml similarity index 94% rename from examples/v1alpha2/taskruns/sidecar-ready-script.yaml rename to examples/v1beta1/taskruns/sidecar-ready-script.yaml index e36e7548af8..4256469d36e 100644 --- a/examples/v1alpha2/taskruns/sidecar-ready-script.yaml +++ b/examples/v1beta1/taskruns/sidecar-ready-script.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: sidecar-ready- diff --git a/examples/v1alpha2/taskruns/sidecar-ready.yaml b/examples/v1beta1/taskruns/sidecar-ready.yaml similarity index 96% rename from examples/v1alpha2/taskruns/sidecar-ready.yaml rename to examples/v1beta1/taskruns/sidecar-ready.yaml index 11869605b0d..eaa0406f91b 100644 --- a/examples/v1alpha2/taskruns/sidecar-ready.yaml +++ b/examples/v1beta1/taskruns/sidecar-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: sidecar-ready- diff --git a/examples/v1alpha2/taskruns/step-by-digest.yaml b/examples/v1beta1/taskruns/step-by-digest.yaml similarity index 91% rename from examples/v1alpha2/taskruns/step-by-digest.yaml rename to examples/v1beta1/taskruns/step-by-digest.yaml index 33d64fc3201..c81d8b32f37 100644 --- a/examples/v1alpha2/taskruns/step-by-digest.yaml +++ b/examples/v1beta1/taskruns/step-by-digest.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: step-by-digest- diff --git a/examples/v1alpha2/taskruns/step-script.yaml b/examples/v1beta1/taskruns/step-script.yaml similarity index 98% rename from examples/v1alpha2/taskruns/step-script.yaml rename to examples/v1beta1/taskruns/step-script.yaml index cfd77f6150e..c45cb9f3cf4 100644 --- a/examples/v1alpha2/taskruns/step-script.yaml +++ b/examples/v1beta1/taskruns/step-script.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: step-script- diff --git a/examples/v1alpha2/taskruns/steps-run-in-order.yaml b/examples/v1beta1/taskruns/steps-run-in-order.yaml similarity index 89% rename from examples/v1alpha2/taskruns/steps-run-in-order.yaml rename to examples/v1beta1/taskruns/steps-run-in-order.yaml index 6f7082bb67c..a30dc90f3c6 100644 --- a/examples/v1alpha2/taskruns/steps-run-in-order.yaml +++ b/examples/v1beta1/taskruns/steps-run-in-order.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: steps-run-in-order- diff --git a/examples/v1alpha2/taskruns/steptemplate-env-merge.yaml b/examples/v1beta1/taskruns/steptemplate-env-merge.yaml similarity index 97% rename from examples/v1alpha2/taskruns/steptemplate-env-merge.yaml rename to examples/v1beta1/taskruns/steptemplate-env-merge.yaml index bf393ae2d4a..e8cd40df04a 100644 --- a/examples/v1alpha2/taskruns/steptemplate-env-merge.yaml +++ b/examples/v1beta1/taskruns/steptemplate-env-merge.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: steptemplate-env-merge- diff --git a/examples/v1alpha2/taskruns/task-multiple-output-image.yaml b/examples/v1beta1/taskruns/task-multiple-output-image.yaml similarity index 97% rename from examples/v1alpha2/taskruns/task-multiple-output-image.yaml rename to examples/v1beta1/taskruns/task-multiple-output-image.yaml index 796a4eaa008..49eaba09e4f 100644 --- a/examples/v1alpha2/taskruns/task-multiple-output-image.yaml +++ b/examples/v1beta1/taskruns/task-multiple-output-image.yaml @@ -49,7 +49,7 @@ spec: # This task is currently hardcoding a index.json file instead of # building an image since kaniko and other easy to use tools don't # support exporting this file yet -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: multiple-build-push-kaniko @@ -97,7 +97,7 @@ spec: ] } --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: multiple-build-push-kaniko-run diff --git a/examples/v1alpha2/taskruns/task-output-image.yaml b/examples/v1beta1/taskruns/task-output-image.yaml similarity index 97% rename from examples/v1alpha2/taskruns/task-output-image.yaml rename to examples/v1beta1/taskruns/task-output-image.yaml index 95adeb88970..02fac1fb8b5 100644 --- a/examples/v1alpha2/taskruns/task-output-image.yaml +++ b/examples/v1beta1/taskruns/task-output-image.yaml @@ -39,7 +39,7 @@ spec: # This task is currently hardcoding a index.json file instead of # building an image since kaniko and other easy to use tools don't # support exporting this file yet -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-push-kaniko-output-image @@ -72,7 +72,7 @@ spec: image: busybox script: cat $(resources.inputs.sourcerepo.path)/index.json --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: build-push-run-output-image diff --git a/examples/v1alpha2/taskruns/task-result.yaml b/examples/v1beta1/taskruns/task-result.yaml similarity index 95% rename from examples/v1alpha2/taskruns/task-result.yaml rename to examples/v1beta1/taskruns/task-result.yaml index b33110bec64..e8e528cf8dd 100644 --- a/examples/v1alpha2/taskruns/task-result.yaml +++ b/examples/v1beta1/taskruns/task-result.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: print-date diff --git a/examples/v1alpha2/taskruns/task-volume-args.yaml b/examples/v1beta1/taskruns/task-volume-args.yaml similarity index 95% rename from examples/v1alpha2/taskruns/task-volume-args.yaml rename to examples/v1beta1/taskruns/task-volume-args.yaml index fe33840537c..746824e5d92 100644 --- a/examples/v1alpha2/taskruns/task-volume-args.yaml +++ b/examples/v1beta1/taskruns/task-volume-args.yaml @@ -5,7 +5,7 @@ metadata: data: test.data: tasks are my jam --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: task-volume-args- diff --git a/examples/v1alpha2/taskruns/template-volume.yaml b/examples/v1beta1/taskruns/template-volume.yaml similarity index 94% rename from examples/v1alpha2/taskruns/template-volume.yaml rename to examples/v1beta1/taskruns/template-volume.yaml index f588aeeabd1..929f8ad3639 100644 --- a/examples/v1alpha2/taskruns/template-volume.yaml +++ b/examples/v1beta1/taskruns/template-volume.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: template-volume- diff --git a/examples/v1alpha2/taskruns/unnamed-steps.yaml b/examples/v1beta1/taskruns/unnamed-steps.yaml similarity index 86% rename from examples/v1alpha2/taskruns/unnamed-steps.yaml rename to examples/v1beta1/taskruns/unnamed-steps.yaml index b81a59aa1db..1afd50b6251 100644 --- a/examples/v1alpha2/taskruns/unnamed-steps.yaml +++ b/examples/v1beta1/taskruns/unnamed-steps.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: unnamed-steps- diff --git a/examples/v1alpha2/taskruns/workingdir.yaml b/examples/v1beta1/taskruns/workingdir.yaml similarity index 91% rename from examples/v1alpha2/taskruns/workingdir.yaml rename to examples/v1beta1/taskruns/workingdir.yaml index 9795aa721b2..c60618b1509 100644 --- a/examples/v1alpha2/taskruns/workingdir.yaml +++ b/examples/v1beta1/taskruns/workingdir.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: workingdir- diff --git a/examples/v1alpha2/taskruns/workspace-readonly.yaml b/examples/v1beta1/taskruns/workspace-readonly.yaml similarity index 97% rename from examples/v1alpha2/taskruns/workspace-readonly.yaml rename to examples/v1beta1/taskruns/workspace-readonly.yaml index 3dabb0fa9cc..bd06b1df0bc 100644 --- a/examples/v1alpha2/taskruns/workspace-readonly.yaml +++ b/examples/v1beta1/taskruns/workspace-readonly.yaml @@ -10,7 +10,7 @@ spec: accessModes: - ReadWriteOnce --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: workspaces-readonly- diff --git a/examples/v1alpha2/taskruns/workspace-volume.yaml b/examples/v1beta1/taskruns/workspace-volume.yaml similarity index 94% rename from examples/v1alpha2/taskruns/workspace-volume.yaml rename to examples/v1beta1/taskruns/workspace-volume.yaml index f756030daea..47f172a9651 100644 --- a/examples/v1alpha2/taskruns/workspace-volume.yaml +++ b/examples/v1beta1/taskruns/workspace-volume.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: workspace-volume- diff --git a/examples/v1alpha2/taskruns/workspace.yaml b/examples/v1beta1/taskruns/workspace.yaml similarity index 98% rename from examples/v1alpha2/taskruns/workspace.yaml rename to examples/v1beta1/taskruns/workspace.yaml index 3ca1d9bcaca..f13a2d9eea3 100644 --- a/examples/v1alpha2/taskruns/workspace.yaml +++ b/examples/v1beta1/taskruns/workspace.yaml @@ -27,7 +27,7 @@ stringData: data: message: aGVsbG8gc2VjcmV0 --- -apiVersion: tekton.dev/v1alpha2 +apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: generateName: custom-volume- diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 1069d6b06bb..b7de3ee0380 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -34,10 +34,10 @@ bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister" github.com/tektoncd/pipeline/pkg/client/resource github.com/tektoncd/pipeline/pkg/apis \ "resource:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt -# This generates deepcopy,client,informer and lister for the pipeline package (v1alpha1 and v1alpha2) +# This generates deepcopy,client,informer and lister for the pipeline package (v1alpha1 and v1beta1) bash ${REPO_ROOT_DIR}/hack/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ - "pipeline:v1alpha1,v1alpha2" \ + "pipeline:v1alpha1,v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt # Depends on generate-groups.sh to install bin/deepcopy-gen @@ -63,10 +63,10 @@ bash ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ github.com/tektoncd/pipeline/pkg/client/resource github.com/tektoncd/pipeline/pkg/apis \ "resource:v1alpha1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt -# This generates the knative inject packages for the pipeline package (v1alpha1, v1alpha2). +# This generates the knative inject packages for the pipeline package (v1alpha1, v1beta1). bash ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ - "pipeline:v1alpha1,v1alpha2" \ + "pipeline:v1alpha1,v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt GOFLAGS="${OLDGOFLAGS}" diff --git a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go index cc08819fd10..8d725ef2cbf 100644 --- a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go @@ -21,7 +21,7 @@ import ( "context" "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -30,7 +30,7 @@ var _ apis.Convertible = (*ClusterTask)(nil) // ConvertUp implements api.Convertible func (source *ClusterTask) ConvertUp(ctx context.Context, obj apis.Convertible) error { switch sink := obj.(type) { - case *v1alpha2.ClusterTask: + case *v1beta1.ClusterTask: sink.ObjectMeta = source.ObjectMeta return source.Spec.ConvertUp(ctx, &sink.Spec) default: @@ -41,7 +41,7 @@ func (source *ClusterTask) ConvertUp(ctx context.Context, obj apis.Convertible) // ConvertDown implements api.Convertible func (sink *ClusterTask) ConvertDown(ctx context.Context, obj apis.Convertible) error { switch source := obj.(type) { - case *v1alpha2.ClusterTask: + case *v1beta1.ClusterTask: sink.ObjectMeta = source.ObjectMeta return sink.Spec.ConvertDown(ctx, &source.Spec) default: diff --git a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go index 287897a6f2a..bdb16e2606b 100644 --- a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,7 +41,7 @@ func TestClusterTaskConversionBadType(t *testing.T) { } func TestClusterTaskConversion(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.ClusterTask{}} + versions := []apis.Convertible{&v1beta1.ClusterTask{}} tests := []struct { name string @@ -56,22 +56,22 @@ func TestClusterTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, Volumes: []corev1.Volume{{}}, - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -88,9 +88,9 @@ func TestClusterTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -114,17 +114,17 @@ func TestClusterTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + TaskSpec: v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, Inputs: &Inputs{ Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -140,9 +140,9 @@ func TestClusterTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -184,7 +184,7 @@ func TestClusterTaskConversion(t *testing.T) { } func TestClusterTaskConversionFromDeprecated(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.ClusterTask{}} + versions := []apis.Convertible{&v1beta1.ClusterTask{}} tests := []struct { name string in *ClusterTask @@ -202,7 +202,7 @@ func TestClusterTaskConversionFromDeprecated(t *testing.T) { Inputs: &Inputs{ Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -215,10 +215,10 @@ func TestClusterTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + TaskSpec: v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -248,9 +248,9 @@ func TestClusterTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -282,9 +282,9 @@ func TestClusterTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, diff --git a/pkg/apis/pipeline/v1alpha1/condition_types.go b/pkg/apis/pipeline/v1alpha1/condition_types.go index 21c34f73198..8705c146a89 100644 --- a/pkg/apis/pipeline/v1alpha1/condition_types.go +++ b/pkg/apis/pipeline/v1alpha1/condition_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" ) @@ -40,12 +40,12 @@ type Condition struct { } // ConditionCheckStatus defines the observed state of ConditionCheck -type ConditionCheckStatus = v1alpha2.ConditionCheckStatus +type ConditionCheckStatus = v1beta1.ConditionCheckStatus // ConditionCheckStatusFields holds the fields of ConfigurationCheck's status. // This is defined separately and inlined so that other types can readily // consume these fields via duck typing. -type ConditionCheckStatusFields = v1alpha2.ConditionCheckStatusFields +type ConditionCheckStatusFields = v1beta1.ConditionCheckStatusFields // ConditionSpec defines the desired state of the Condition type ConditionSpec struct { diff --git a/pkg/apis/pipeline/v1alpha1/conversion_error.go b/pkg/apis/pipeline/v1alpha1/conversion_error.go index c2ab76388a8..990b34d9b95 100644 --- a/pkg/apis/pipeline/v1alpha1/conversion_error.go +++ b/pkg/apis/pipeline/v1alpha1/conversion_error.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -25,13 +25,13 @@ const ( // ConditionTypeConvertible is a Warning condition that is set on // resources when they cannot be converted to warn of a forthcoming // breakage. - ConditionTypeConvertible apis.ConditionType = v1alpha2.ConditionTypeConvertible + ConditionTypeConvertible apis.ConditionType = v1beta1.ConditionTypeConvertible ) // CannotConvertError is returned when a field cannot be converted. -type CannotConvertError = v1alpha2.CannotConvertError +type CannotConvertError = v1beta1.CannotConvertError var _ error = (*CannotConvertError)(nil) // ConvertErrorf creates a CannotConvertError from the field name and format string. -var ConvertErrorf = v1alpha2.ConvertErrorf +var ConvertErrorf = v1beta1.ConvertErrorf diff --git a/pkg/apis/pipeline/v1alpha1/param_types.go b/pkg/apis/pipeline/v1alpha1/param_types.go index dde36221e4a..69b21947c6a 100644 --- a/pkg/apis/pipeline/v1alpha1/param_types.go +++ b/pkg/apis/pipeline/v1alpha1/param_types.go @@ -17,33 +17,33 @@ limitations under the License. package v1alpha1 import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // ParamSpec defines arbitrary parameters needed beyond typed inputs (such as // resources). Parameter values are provided by users as inputs on a TaskRun // or PipelineRun. -type ParamSpec = v1alpha2.ParamSpec +type ParamSpec = v1beta1.ParamSpec // Param declares an ArrayOrString to use for the parameter called name. -type Param = v1alpha2.Param +type Param = v1beta1.Param // ParamType indicates the type of an input parameter; // Used to distinguish between a single string and an array of strings. -type ParamType = v1alpha2.ParamType +type ParamType = v1beta1.ParamType // Valid ParamTypes: const ( - ParamTypeString ParamType = v1alpha2.ParamTypeString - ParamTypeArray ParamType = v1alpha2.ParamTypeArray + ParamTypeString ParamType = v1beta1.ParamTypeString + ParamTypeArray ParamType = v1beta1.ParamTypeArray ) // AllParamTypes can be used for ParamType validation. -var AllParamTypes = v1alpha2.AllParamTypes +var AllParamTypes = v1beta1.AllParamTypes // ArrayOrString is modeled after IntOrString in kubernetes/apimachinery: // ArrayOrString is a type that can hold a single string or string array. // Used in JSON unmarshalling so that a single JSON field can accept // either an individual string or an array of strings. -type ArrayOrString = v1alpha2.ArrayOrString +type ArrayOrString = v1beta1.ArrayOrString diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go b/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go index ea1f0491bf1..3bdab97fc12 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go @@ -21,7 +21,7 @@ import ( "context" "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -30,7 +30,7 @@ var _ apis.Convertible = (*Pipeline)(nil) // ConvertUp implements api.Convertible func (source *Pipeline) ConvertUp(ctx context.Context, obj apis.Convertible) error { switch sink := obj.(type) { - case *v1alpha2.Pipeline: + case *v1beta1.Pipeline: sink.ObjectMeta = source.ObjectMeta return source.Spec.ConvertUp(ctx, &sink.Spec) default: @@ -38,12 +38,12 @@ func (source *Pipeline) ConvertUp(ctx context.Context, obj apis.Convertible) err } } -func (source *PipelineSpec) ConvertUp(ctx context.Context, sink *v1alpha2.PipelineSpec) error { +func (source *PipelineSpec) ConvertUp(ctx context.Context, sink *v1beta1.PipelineSpec) error { sink.Resources = source.Resources sink.Params = source.Params sink.Workspaces = source.Workspaces if len(source.Tasks) > 0 { - sink.Tasks = make([]v1alpha2.PipelineTask, len(source.Tasks)) + sink.Tasks = make([]v1beta1.PipelineTask, len(source.Tasks)) for i := range source.Tasks { if err := source.Tasks[i].ConvertUp(ctx, &sink.Tasks[i]); err != nil { return err @@ -53,11 +53,11 @@ func (source *PipelineSpec) ConvertUp(ctx context.Context, sink *v1alpha2.Pipeli return nil } -func (source *PipelineTask) ConvertUp(ctx context.Context, sink *v1alpha2.PipelineTask) error { +func (source *PipelineTask) ConvertUp(ctx context.Context, sink *v1beta1.PipelineTask) error { sink.Name = source.Name sink.TaskRef = source.TaskRef if source.TaskSpec != nil { - sink.TaskSpec = &v1alpha2.TaskSpec{} + sink.TaskSpec = &v1beta1.TaskSpec{} if err := source.TaskSpec.ConvertUp(ctx, sink.TaskSpec); err != nil { return err } @@ -74,7 +74,7 @@ func (source *PipelineTask) ConvertUp(ctx context.Context, sink *v1alpha2.Pipeli // ConvertDown implements api.Convertible func (sink *Pipeline) ConvertDown(ctx context.Context, obj apis.Convertible) error { switch source := obj.(type) { - case *v1alpha2.Pipeline: + case *v1beta1.Pipeline: sink.ObjectMeta = source.ObjectMeta return sink.Spec.ConvertDown(ctx, source.Spec) default: @@ -82,7 +82,7 @@ func (sink *Pipeline) ConvertDown(ctx context.Context, obj apis.Convertible) err } } -func (sink *PipelineSpec) ConvertDown(ctx context.Context, source v1alpha2.PipelineSpec) error { +func (sink *PipelineSpec) ConvertDown(ctx context.Context, source v1beta1.PipelineSpec) error { sink.Resources = source.Resources sink.Params = source.Params sink.Workspaces = source.Workspaces @@ -97,7 +97,7 @@ func (sink *PipelineSpec) ConvertDown(ctx context.Context, source v1alpha2.Pipel return nil } -func (sink *PipelineTask) ConvertDown(ctx context.Context, source v1alpha2.PipelineTask) error { +func (sink *PipelineTask) ConvertDown(ctx context.Context, source v1beta1.PipelineTask) error { sink.Name = source.Name sink.TaskRef = source.TaskRef if source.TaskSpec != nil { diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go b/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go index cb23f42a84c..7f3f78de020 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,7 +41,7 @@ func TestPipelineConversionBadType(t *testing.T) { } func TestPipelineConversion(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.Pipeline{}} + versions := []apis.Convertible{&v1beta1.Pipeline{}} tests := []struct { name string @@ -65,7 +65,7 @@ func TestPipelineConversion(t *testing.T) { }}, Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, Workspaces: []WorkspacePipelineDeclaration{{ @@ -82,18 +82,18 @@ func TestPipelineConversion(t *testing.T) { Retries: 10, RunAfter: []string{"task1"}, Resources: &PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ + Inputs: []v1beta1.PipelineTaskInputResource{{ Name: "input1", Resource: "resource1", }}, - Outputs: []v1alpha2.PipelineTaskOutputResource{{ + Outputs: []v1beta1.PipelineTaskOutputResource{{ Name: "output1", Resource: "resource2", }}, }, Params: []Param{{ Name: "param1", - Value: v1alpha2.ArrayOrString{StringVal: "str", Type: v1alpha2.ParamTypeString}, + Value: v1beta1.ArrayOrString{StringVal: "str", Type: v1beta1.ParamTypeString}, }}, Workspaces: []WorkspacePipelineTaskBinding{{ Name: "w1", @@ -101,8 +101,8 @@ func TestPipelineConversion(t *testing.T) { }}, }, { Name: "task2", - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -121,18 +121,18 @@ func TestPipelineConversion(t *testing.T) { Spec: PipelineSpec{ Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, Tasks: []PipelineTask{{ Name: "task2", TaskSpec: &TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_types.go b/pkg/apis/pipeline/v1alpha1/pipeline_types.go index 03b6888f4a3..dae4d65dba4 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_types.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_types.go @@ -17,7 +17,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -40,13 +40,13 @@ type PipelineSpec struct { // Check that Pipeline may be validated and defaulted. // TaskKind defines the type of Task used by the pipeline. -type TaskKind = v1alpha2.TaskKind +type TaskKind = v1beta1.TaskKind const ( // NamespacedTaskKind indicates that the task type has a namepace scope. - NamespacedTaskKind TaskKind = v1alpha2.NamespacedTaskKind + NamespacedTaskKind TaskKind = v1beta1.NamespacedTaskKind // ClusterTaskKind indicates that task type has a cluster scope. - ClusterTaskKind TaskKind = v1alpha2.ClusterTaskKind + ClusterTaskKind TaskKind = v1beta1.ClusterTaskKind ) // +genclient @@ -172,34 +172,34 @@ func (l PipelineTaskList) Items() []dag.Task { } // PipelineTaskParam is used to provide arbitrary string parameters to a Task. -type PipelineTaskParam = v1alpha2.PipelineTaskParam +type PipelineTaskParam = v1beta1.PipelineTaskParam // PipelineTaskCondition allows a PipelineTask to declare a Condition to be evaluated before // the Task is run. -type PipelineTaskCondition = v1alpha2.PipelineTaskCondition +type PipelineTaskCondition = v1beta1.PipelineTaskCondition // PipelineDeclaredResource is used by a Pipeline to declare the types of the // PipelineResources that it will required to run and names which can be used to // refer to these PipelineResources in PipelineTaskResourceBindings. -type PipelineDeclaredResource = v1alpha2.PipelineDeclaredResource +type PipelineDeclaredResource = v1beta1.PipelineDeclaredResource // PipelineTaskResources allows a Pipeline to declare how its DeclaredPipelineResources // should be provided to a Task as its inputs and outputs. -type PipelineTaskResources = v1alpha2.PipelineTaskResources +type PipelineTaskResources = v1beta1.PipelineTaskResources // PipelineTaskInputResource maps the name of a declared PipelineResource input // dependency in a Task to the resource in the Pipeline's DeclaredPipelineResources // that should be used. This input may come from a previous task. -type PipelineTaskInputResource = v1alpha2.PipelineTaskInputResource +type PipelineTaskInputResource = v1beta1.PipelineTaskInputResource // PipelineTaskOutputResource maps the name of a declared PipelineResource output // dependency in a Task to the resource in the Pipeline's DeclaredPipelineResources // that should be used. -type PipelineTaskOutputResource = v1alpha2.PipelineTaskOutputResource +type PipelineTaskOutputResource = v1beta1.PipelineTaskOutputResource // TaskRef can be used to refer to a specific instance of a task. // Copied from CrossVersionObjectReference: https://github.com/kubernetes/kubernetes/blob/169df7434155cbbc22f1532cba8e0a9588e29ad8/pkg/apis/autoscaling/types.go#L64 -type TaskRef = v1alpha2.TaskRef +type TaskRef = v1beta1.TaskRef // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go b/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go index cbadb97a53d..86525794e4f 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" tb "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" ) @@ -85,7 +85,7 @@ func TestPipeline_Validate(t *testing.T) { name: "pipeline spec with taskref and taskspec", p: tb.Pipeline("pipeline", "namespace", tb.PipelineSpec( tb.PipelineTask("foo", "foo-task", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "foo", Image: "bar", @@ -104,7 +104,7 @@ func TestPipeline_Validate(t *testing.T) { name: "pipeline spec valid taskspec", p: tb.Pipeline("pipeline", "namespace", tb.PipelineSpec( tb.PipelineTask("", "", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "foo", Image: "bar", diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go index 83544af1db8..63e604474a9 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go @@ -21,7 +21,7 @@ import ( "context" "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -30,7 +30,7 @@ var _ apis.Convertible = (*PipelineRun)(nil) // ConvertUp implements api.Convertible func (source *PipelineRun) ConvertUp(ctx context.Context, obj apis.Convertible) error { switch sink := obj.(type) { - case *v1alpha2.PipelineRun: + case *v1beta1.PipelineRun: sink.ObjectMeta = source.ObjectMeta if err := source.Spec.ConvertUp(ctx, &sink.Spec); err != nil { return err @@ -42,10 +42,10 @@ func (source *PipelineRun) ConvertUp(ctx context.Context, obj apis.Convertible) } } -func (source *PipelineRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.PipelineRunSpec) error { +func (source *PipelineRunSpec) ConvertUp(ctx context.Context, sink *v1beta1.PipelineRunSpec) error { sink.PipelineRef = source.PipelineRef if source.PipelineSpec != nil { - sink.PipelineSpec = &v1alpha2.PipelineSpec{} + sink.PipelineSpec = &v1beta1.PipelineSpec{} if err := source.PipelineSpec.ConvertUp(ctx, sink.PipelineSpec); err != nil { return err } @@ -64,7 +64,7 @@ func (source *PipelineRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.Pip // ConvertDown implements api.Convertible func (sink *PipelineRun) ConvertDown(ctx context.Context, obj apis.Convertible) error { switch source := obj.(type) { - case *v1alpha2.PipelineRun: + case *v1beta1.PipelineRun: sink.ObjectMeta = source.ObjectMeta if err := sink.Spec.ConvertDown(ctx, &source.Spec); err != nil { return err @@ -76,7 +76,7 @@ func (sink *PipelineRun) ConvertDown(ctx context.Context, obj apis.Convertible) } } -func (sink *PipelineRunSpec) ConvertDown(ctx context.Context, source *v1alpha2.PipelineRunSpec) error { +func (sink *PipelineRunSpec) ConvertDown(ctx context.Context, source *v1beta1.PipelineRunSpec) error { sink.PipelineRef = source.PipelineRef if source.PipelineSpec != nil { sink.PipelineSpec = &PipelineSpec{} diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go index 90d089dd875..6c37e3c4828 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go @@ -22,7 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -41,7 +41,7 @@ func TestPipelineRunConversionBadType(t *testing.T) { } func TestPipelineRunConversion(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.PipelineRun{}} + versions := []apis.Convertible{&v1beta1.PipelineRun{}} tests := []struct { name string @@ -75,11 +75,11 @@ func TestPipelineRunConversion(t *testing.T) { }}, Params: []Param{{ Name: "p1", - Value: v1alpha2.ArrayOrString{StringVal: "baz"}, + Value: v1beta1.ArrayOrString{StringVal: "baz"}, }}, Resources: []PipelineResourceBinding{{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }}, }, Status: PipelineRunStatus{ @@ -111,8 +111,8 @@ func TestPipelineRunConversion(t *testing.T) { }, }, { Name: "task2", - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -135,11 +135,11 @@ func TestPipelineRunConversion(t *testing.T) { }}, Params: []Param{{ Name: "p1", - Value: v1alpha2.ArrayOrString{StringVal: "baz"}, + Value: v1beta1.ArrayOrString{StringVal: "baz"}, }}, Resources: []PipelineResourceBinding{{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }}, }, Status: PipelineRunStatus{ diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go index 60326548119..963f6ea5d13 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_types.go @@ -22,7 +22,7 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -90,37 +90,37 @@ type PipelineRunSpec struct { } // PipelineRunSpecStatus defines the pipelinerun spec status the user can provide -type PipelineRunSpecStatus = v1alpha2.PipelineRunSpecStatus +type PipelineRunSpecStatus = v1beta1.PipelineRunSpecStatus const ( // PipelineRunSpecStatusCancelled indicates that the user wants to cancel the task, // if not already cancelled or terminated - PipelineRunSpecStatusCancelled = v1alpha2.PipelineRunSpecStatusCancelled + PipelineRunSpecStatusCancelled = v1beta1.PipelineRunSpecStatusCancelled ) // PipelineResourceRef can be used to refer to a specific instance of a Resource -type PipelineResourceRef = v1alpha2.PipelineResourceRef +type PipelineResourceRef = v1beta1.PipelineResourceRef // PipelineRef can be used to refer to a specific instance of a Pipeline. // Copied from CrossVersionObjectReference: https://github.com/kubernetes/kubernetes/blob/169df7434155cbbc22f1532cba8e0a9588e29ad8/pkg/apis/autoscaling/types.go#L64 -type PipelineRef = v1alpha2.PipelineRef +type PipelineRef = v1beta1.PipelineRef // PipelineRunStatus defines the observed state of PipelineRun -type PipelineRunStatus = v1alpha2.PipelineRunStatus +type PipelineRunStatus = v1beta1.PipelineRunStatus // PipelineRunStatusFields holds the fields of PipelineRunStatus' status. // This is defined separately and inlined so that other types can readily // consume these fields via duck typing. -type PipelineRunStatusFields = v1alpha2.PipelineRunStatusFields +type PipelineRunStatusFields = v1beta1.PipelineRunStatusFields // PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun's Status -type PipelineRunTaskRunStatus = v1alpha2.PipelineRunTaskRunStatus +type PipelineRunTaskRunStatus = v1beta1.PipelineRunTaskRunStatus -type PipelineRunConditionCheckStatus = v1alpha2.PipelineRunConditionCheckStatus +type PipelineRunConditionCheckStatus = v1beta1.PipelineRunConditionCheckStatus // PipelineRunSpecServiceAccountName can be used to configure specific // ServiceAccountName for a concrete Task -type PipelineRunSpecServiceAccountName = v1alpha2.PipelineRunSpecServiceAccountName +type PipelineRunSpecServiceAccountName = v1beta1.PipelineRunSpecServiceAccountName // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -135,7 +135,7 @@ type PipelineRunList struct { // PipelineTaskRun reports the results of running a step in the Task. Each // task has the potential to succeed or fail (based on the exit code) // and produces logs. -type PipelineTaskRun = v1alpha2.PipelineTaskRun +type PipelineTaskRun = v1beta1.PipelineTaskRun // GetTaskRunRef for pipelinerun func (pr *PipelineRun) GetTaskRunRef() corev1.ObjectReference { diff --git a/pkg/apis/pipeline/v1alpha1/resource_types.go b/pkg/apis/pipeline/v1alpha1/resource_types.go index a725022c103..d987494e173 100644 --- a/pkg/apis/pipeline/v1alpha1/resource_types.go +++ b/pkg/apis/pipeline/v1alpha1/resource_types.go @@ -20,7 +20,7 @@ import ( "fmt" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // PipelineResourceInterface interface to be implemented by different PipelineResource types @@ -41,10 +41,10 @@ type PipelineResourceInterface interface { } // TaskModifier is an interface to be implemented by different PipelineResources -type TaskModifier = v1alpha2.TaskModifier +type TaskModifier = v1beta1.TaskModifier // InternalTaskModifier implements TaskModifier for resources that are built-in to Tekton Pipelines. -type InternalTaskModifier = v1alpha2.InternalTaskModifier +type InternalTaskModifier = v1beta1.InternalTaskModifier func checkStepNotAlreadyAdded(s Step, steps []Step) error { for _, step := range steps { @@ -100,10 +100,10 @@ func ApplyTaskModifier(ts *TaskSpec, tm TaskModifier) error { // PipelineResourceBinding connects a reference to an instance of a PipelineResource // with a PipelineResource dependency that the Pipeline has declared -type PipelineResourceBinding = v1alpha2.PipelineResourceBinding +type PipelineResourceBinding = v1beta1.PipelineResourceBinding // PipelineResourceResult used to export the image name and digest as json -type PipelineResourceResult = v1alpha2.PipelineResourceResult +type PipelineResourceResult = v1beta1.PipelineResourceResult // ResultType used to find out whether a PipelineResourceResult is from a task result or not -type ResultType = v1alpha2.ResultType +type ResultType = v1beta1.ResultType diff --git a/pkg/apis/pipeline/v1alpha1/resource_types_test.go b/pkg/apis/pipeline/v1alpha1/resource_types_test.go index 1623e30ea65..c16b94a55d4 100644 --- a/pkg/apis/pipeline/v1alpha1/resource_types_test.go +++ b/pkg/apis/pipeline/v1alpha1/resource_types_test.go @@ -18,7 +18,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" ) @@ -70,7 +70,7 @@ func TestApplyTaskModifier(t *testing.T) { ts: v1alpha1.TaskSpec{}, }, { name: "identical volume already added", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ // Trying to add the same Volume that has already been added shouldn't be an error // and it should not be added twice Volumes: []corev1.Volume{volume}, @@ -82,7 +82,7 @@ func TestApplyTaskModifier(t *testing.T) { t.Fatalf("Did not expect error modifying TaskSpec but got %v", err) } - expectedTaskSpec := v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec := v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ Container: prependStep, }, { @@ -106,27 +106,27 @@ func TestApplyTaskModifier_AlreadyAdded(t *testing.T) { ts v1alpha1.TaskSpec }{{ name: "prepend already added", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: prependStep}}, }}, }, { name: "append already added", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: appendStep}}, }}, }, { name: "both steps already added", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: prependStep}, {Container: appendStep}}, }}, }, { name: "both steps already added reverse order", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: appendStep}, {Container: prependStep}}, }}, }, { name: "volume with same name but diff content already added", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Volumes: []corev1.Volume{{ Name: "magic-volume", VolumeSource: corev1.VolumeSource{ diff --git a/pkg/apis/pipeline/v1alpha1/task_conversion.go b/pkg/apis/pipeline/v1alpha1/task_conversion.go index f614b75938b..7e4f925bf1c 100644 --- a/pkg/apis/pipeline/v1alpha1/task_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/task_conversion.go @@ -21,7 +21,7 @@ import ( "context" "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -30,7 +30,7 @@ var _ apis.Convertible = (*Task)(nil) // ConvertUp implements api.Convertible func (source *Task) ConvertUp(ctx context.Context, obj apis.Convertible) error { switch sink := obj.(type) { - case *v1alpha2.Task: + case *v1beta1.Task: sink.ObjectMeta = source.ObjectMeta return source.Spec.ConvertUp(ctx, &sink.Spec) default: @@ -38,7 +38,7 @@ func (source *Task) ConvertUp(ctx context.Context, obj apis.Convertible) error { } } -func (source *TaskSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskSpec) error { +func (source *TaskSpec) ConvertUp(ctx context.Context, sink *v1beta1.TaskSpec) error { sink.Steps = source.Steps sink.Volumes = source.Volumes sink.StepTemplate = source.StepTemplate @@ -53,22 +53,22 @@ func (source *TaskSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskSpec) return apis.ErrMultipleOneOf("inputs.params", "params") } if len(source.Inputs.Params) > 0 { - sink.Params = make([]v1alpha2.ParamSpec, len(source.Inputs.Params)) + sink.Params = make([]v1beta1.ParamSpec, len(source.Inputs.Params)) for i, param := range source.Inputs.Params { sink.Params[i] = *param.DeepCopy() } } if len(source.Inputs.Resources) > 0 { if sink.Resources == nil { - sink.Resources = &v1alpha2.TaskResources{} + sink.Resources = &v1beta1.TaskResources{} } if len(source.Inputs.Resources) > 0 && source.Resources != nil && len(source.Resources.Inputs) > 0 { // This shouldn't happen as it shouldn't pass validation but just in case return apis.ErrMultipleOneOf("inputs.resources", "resources.inputs") } - sink.Resources.Inputs = make([]v1alpha2.TaskResource, len(source.Inputs.Resources)) + sink.Resources.Inputs = make([]v1beta1.TaskResource, len(source.Inputs.Resources)) for i, resource := range source.Inputs.Resources { - sink.Resources.Inputs[i] = v1alpha2.TaskResource{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + sink.Resources.Inputs[i] = v1beta1.TaskResource{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: resource.Name, Type: resource.Type, Description: resource.Description, @@ -80,15 +80,15 @@ func (source *TaskSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskSpec) } if source.Outputs != nil && len(source.Outputs.Resources) > 0 { if sink.Resources == nil { - sink.Resources = &v1alpha2.TaskResources{} + sink.Resources = &v1beta1.TaskResources{} } if len(source.Outputs.Resources) > 0 && source.Resources != nil && len(source.Resources.Outputs) > 0 { // This shouldn't happen as it shouldn't pass validation but just in case return apis.ErrMultipleOneOf("outputs.resources", "resources.outputs") } - sink.Resources.Outputs = make([]v1alpha2.TaskResource, len(source.Outputs.Resources)) + sink.Resources.Outputs = make([]v1beta1.TaskResource, len(source.Outputs.Resources)) for i, resource := range source.Outputs.Resources { - sink.Resources.Outputs[i] = v1alpha2.TaskResource{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + sink.Resources.Outputs[i] = v1beta1.TaskResource{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: resource.Name, Type: resource.Type, Description: resource.Description, @@ -103,7 +103,7 @@ func (source *TaskSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskSpec) // ConvertDown implements api.Convertible func (sink *Task) ConvertDown(ctx context.Context, obj apis.Convertible) error { switch source := obj.(type) { - case *v1alpha2.Task: + case *v1beta1.Task: sink.ObjectMeta = source.ObjectMeta return sink.Spec.ConvertDown(ctx, &source.Spec) default: @@ -111,7 +111,7 @@ func (sink *Task) ConvertDown(ctx context.Context, obj apis.Convertible) error { } } -func (sink *TaskSpec) ConvertDown(ctx context.Context, source *v1alpha2.TaskSpec) error { +func (sink *TaskSpec) ConvertDown(ctx context.Context, source *v1beta1.TaskSpec) error { sink.Steps = source.Steps sink.Volumes = source.Volumes sink.StepTemplate = source.StepTemplate diff --git a/pkg/apis/pipeline/v1alpha1/task_conversion_test.go b/pkg/apis/pipeline/v1alpha1/task_conversion_test.go index 17a1937bf69..2e6b6ff6200 100644 --- a/pkg/apis/pipeline/v1alpha1/task_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/task_conversion_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,7 +41,7 @@ func TestTaskConversionBadType(t *testing.T) { } func TestTaskConversion(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.Task{}} + versions := []apis.Convertible{&v1beta1.Task{}} tests := []struct { name string @@ -56,22 +56,22 @@ func TestTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, Volumes: []corev1.Volume{{}}, - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -88,9 +88,9 @@ func TestTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -114,17 +114,17 @@ func TestTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + TaskSpec: v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, Inputs: &Inputs{ Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -140,9 +140,9 @@ func TestTaskConversion(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -184,7 +184,7 @@ func TestTaskConversion(t *testing.T) { } func TestTaskConversionFromDeprecated(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.Task{}} + versions := []apis.Convertible{&v1beta1.Task{}} tests := []struct { name string in *Task @@ -202,7 +202,7 @@ func TestTaskConversionFromDeprecated(t *testing.T) { Inputs: &Inputs{ Params: []ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -215,10 +215,10 @@ func TestTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + TaskSpec: v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "My first param", }}, }, @@ -248,9 +248,9 @@ func TestTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -282,9 +282,9 @@ func TestTaskConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, diff --git a/pkg/apis/pipeline/v1alpha1/task_defaults.go b/pkg/apis/pipeline/v1alpha1/task_defaults.go index 2baa6bfd3e6..969ab34986e 100644 --- a/pkg/apis/pipeline/v1alpha1/task_defaults.go +++ b/pkg/apis/pipeline/v1alpha1/task_defaults.go @@ -19,7 +19,7 @@ package v1alpha1 import ( "context" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" "knative.dev/pkg/apis" ) @@ -33,7 +33,7 @@ func (t *Task) SetDefaults(ctx context.Context) { // SetDefaults set any defaults for the task spec func (ts *TaskSpec) SetDefaults(ctx context.Context) { if contexts.IsUpgradeViaDefaulting(ctx) { - v := v1alpha2.TaskSpec{} + v := v1beta1.TaskSpec{} if ts.ConvertUp(ctx, &v) == nil { alpha := TaskSpec{} if alpha.ConvertDown(ctx, &v) == nil { diff --git a/pkg/apis/pipeline/v1alpha1/task_types.go b/pkg/apis/pipeline/v1alpha1/task_types.go index 2fdb63e488c..71f891e8865 100644 --- a/pkg/apis/pipeline/v1alpha1/task_types.go +++ b/pkg/apis/pipeline/v1alpha1/task_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) const ( @@ -45,7 +45,7 @@ func (t *Task) Copy() TaskInterface { // TaskSpec defines the desired state of Task. type TaskSpec struct { - v1alpha2.TaskSpec `json:",inline"` + v1beta1.TaskSpec `json:",inline"` // Inputs is an optional set of parameters and resources which must be // supplied by the user when a Task is executed by a TaskRun. @@ -58,13 +58,13 @@ type TaskSpec struct { } // TaskResult used to describe the results of a task -type TaskResult = v1alpha2.TaskResult +type TaskResult = v1beta1.TaskResult // Step embeds the Container type, which allows it to include fields not // provided by Container. -type Step = v1alpha2.Step +type Step = v1beta1.Step -type Sidecar = v1alpha2.Sidecar +type Sidecar = v1beta1.Sidecar // +genclient // +genclient:noStatus @@ -105,7 +105,7 @@ type Inputs struct { // the Task definition, and when provided as an Input, the Name will be the // path to the volume mounted containing this Resource as an input (e.g. // an input Resource named `workspace` will be mounted at `/workspace`). -type TaskResource = v1alpha2.TaskResource +type TaskResource = v1beta1.TaskResource // Outputs allow a task to declare what data the Build/Task will be producing, // i.e. results such as logs and artifacts such as images. diff --git a/pkg/apis/pipeline/v1alpha1/task_validation.go b/pkg/apis/pipeline/v1alpha1/task_validation.go index ec5f00276db..c1602d71c62 100644 --- a/pkg/apis/pipeline/v1alpha1/task_validation.go +++ b/pkg/apis/pipeline/v1alpha1/task_validation.go @@ -22,7 +22,7 @@ import ( "path/filepath" "strings" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/validate" "github.com/tektoncd/pipeline/pkg/substitution" corev1 "k8s.io/api/core/v1" @@ -85,7 +85,7 @@ func (ts *TaskSpec) Validate(ctx context.Context) *apis.FieldError { return err } // Validate that the parameters type are correct - if err := v1alpha2.ValidateParameterTypes(ts.Params); err != nil { + if err := v1beta1.ValidateParameterTypes(ts.Params); err != nil { return err } @@ -128,7 +128,7 @@ func (ts *TaskSpec) Validate(ctx context.Context) *apis.FieldError { } } - if err := v1alpha2.ValidateParameterVariables(ts.Steps, ts.Params); err != nil { + if err := v1beta1.ValidateParameterVariables(ts.Steps, ts.Params); err != nil { return err } // Deprecated @@ -136,7 +136,7 @@ func (ts *TaskSpec) Validate(ctx context.Context) *apis.FieldError { return err } - if err := v1alpha2.ValidateResourcesVariables(ts.Steps, ts.Resources); err != nil { + if err := v1beta1.ValidateResourcesVariables(ts.Steps, ts.Resources); err != nil { return err } // Deprecated @@ -271,7 +271,7 @@ func validateInputParameterTypes(inputs *Inputs) *apis.FieldError { return nil } -func validateInputParameterVariables(steps []Step, inputs *Inputs, params []v1alpha2.ParamSpec) *apis.FieldError { +func validateInputParameterVariables(steps []Step, inputs *Inputs, params []v1beta1.ParamSpec) *apis.FieldError { parameterNames := map[string]struct{}{} arrayParameterNames := map[string]struct{}{} @@ -297,7 +297,7 @@ func validateInputParameterVariables(steps []Step, inputs *Inputs, params []v1al return validateArrayUsage(steps, "params", arrayParameterNames) } -func validateResourceVariables(steps []Step, inputs *Inputs, outputs *Outputs, resources *v1alpha2.TaskResources) *apis.FieldError { +func validateResourceVariables(steps []Step, inputs *Inputs, outputs *Outputs, resources *v1beta1.TaskResources) *apis.FieldError { resourceNames := map[string]struct{}{} if resources != nil { for _, r := range resources.Inputs { diff --git a/pkg/apis/pipeline/v1alpha1/task_validation_test.go b/pkg/apis/pipeline/v1alpha1/task_validation_test.go index 7c3adb346e7..e847f95d8ed 100644 --- a/pkg/apis/pipeline/v1alpha1/task_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/task_validation_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" @@ -322,7 +322,7 @@ func TestTaskSpecValidate(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ts := &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: tt.fields.Steps, StepTemplate: tt.fields.StepTemplate, Workspaces: tt.fields.Workspaces, @@ -347,9 +347,9 @@ func TestTaskSpecValidateError(t *testing.T) { Volumes []corev1.Volume StepTemplate *corev1.Container Workspaces []v1alpha1.WorkspaceDeclaration - // v1alpha2 - Params []v1alpha2.ParamSpec - Resources *v1alpha2.TaskResources + // v1beta1 + Params []v1beta1.ParamSpec + Resources *v1beta1.TaskResources } tests := []struct { name string @@ -924,17 +924,17 @@ func TestTaskSpecValidateError(t *testing.T) { Paths: []string{"workspaces.mountpath"}, }, }, { - name: "v1alpha2: params and deprecated inputs.params", + name: "v1beta1: params and deprecated inputs.params", fields: fields{ Steps: validSteps, - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "param1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, }}, Inputs: &v1alpha1.Inputs{ Params: []v1alpha1.ParamSpec{{ Name: "param1", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, }}, }, }, @@ -943,11 +943,11 @@ func TestTaskSpecValidateError(t *testing.T) { Paths: []string{"inputs.params", "params"}, }, }, { - name: "v1alpha2: resources.inputs and deprecated inputs.resource", + name: "v1beta1: resources.inputs and deprecated inputs.resource", fields: fields{ Steps: validSteps, - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "input-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -964,11 +964,11 @@ func TestTaskSpecValidateError(t *testing.T) { Paths: []string{"inputs.resources", "resources.inputs"}, }, }, { - name: "v1alpha2: resources.outputs and deprecated outputs.resource", + name: "v1beta1: resources.outputs and deprecated outputs.resource", fields: fields{ Steps: validSteps, - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha2.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "output-1", Type: resource.PipelineResourceTypeGit, }}}, @@ -988,7 +988,7 @@ func TestTaskSpecValidateError(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { ts := &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: tt.fields.Steps, Volumes: tt.fields.Volumes, StepTemplate: tt.fields.StepTemplate, diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go b/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go index 3cbeddd214e..d295e9deee8 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go @@ -21,7 +21,7 @@ import ( "context" "fmt" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/apis" ) @@ -30,7 +30,7 @@ var _ apis.Convertible = (*TaskRun)(nil) // ConvertUp implements api.Convertible func (source *TaskRun) ConvertUp(ctx context.Context, obj apis.Convertible) error { switch sink := obj.(type) { - case *v1alpha2.TaskRun: + case *v1beta1.TaskRun: sink.ObjectMeta = source.ObjectMeta if err := source.Spec.ConvertUp(ctx, &sink.Spec); err != nil { return err @@ -42,11 +42,11 @@ func (source *TaskRun) ConvertUp(ctx context.Context, obj apis.Convertible) erro } } -func (source *TaskRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskRunSpec) error { +func (source *TaskRunSpec) ConvertUp(ctx context.Context, sink *v1beta1.TaskRunSpec) error { sink.ServiceAccountName = source.ServiceAccountName sink.TaskRef = source.TaskRef if source.TaskSpec != nil { - sink.TaskSpec = &v1alpha2.TaskSpec{} + sink.TaskSpec = &v1beta1.TaskSpec{} if err := source.TaskSpec.ConvertUp(ctx, sink.TaskSpec); err != nil { return err } @@ -63,23 +63,23 @@ func (source *TaskRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskRun return apis.ErrMultipleOneOf("inputs.params", "params") } if len(source.Inputs.Params) > 0 { - sink.Params = make([]v1alpha2.Param, len(source.Inputs.Params)) + sink.Params = make([]v1beta1.Param, len(source.Inputs.Params)) for i, param := range source.Inputs.Params { sink.Params[i] = *param.DeepCopy() } } if len(source.Inputs.Resources) > 0 { if sink.Resources == nil { - sink.Resources = &v1alpha2.TaskRunResources{} + sink.Resources = &v1beta1.TaskRunResources{} } if len(source.Inputs.Resources) > 0 && source.Resources != nil && len(source.Resources.Inputs) > 0 { // This shouldn't happen as it shouldn't pass validation but just in case return apis.ErrMultipleOneOf("inputs.resources", "resources.inputs") } - sink.Resources.Inputs = make([]v1alpha2.TaskResourceBinding, len(source.Inputs.Resources)) + sink.Resources.Inputs = make([]v1beta1.TaskResourceBinding, len(source.Inputs.Resources)) for i, resource := range source.Inputs.Resources { - sink.Resources.Inputs[i] = v1alpha2.TaskResourceBinding{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + sink.Resources.Inputs[i] = v1beta1.TaskResourceBinding{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: resource.Name, ResourceRef: resource.ResourceRef, ResourceSpec: resource.ResourceSpec, @@ -90,16 +90,16 @@ func (source *TaskRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskRun } if len(source.Outputs.Resources) > 0 { if sink.Resources == nil { - sink.Resources = &v1alpha2.TaskRunResources{} + sink.Resources = &v1beta1.TaskRunResources{} } if len(source.Outputs.Resources) > 0 && source.Resources != nil && len(source.Resources.Outputs) > 0 { // This shouldn't happen as it shouldn't pass validation but just in case return apis.ErrMultipleOneOf("outputs.resources", "resources.outputs") } - sink.Resources.Outputs = make([]v1alpha2.TaskResourceBinding, len(source.Outputs.Resources)) + sink.Resources.Outputs = make([]v1beta1.TaskResourceBinding, len(source.Outputs.Resources)) for i, resource := range source.Outputs.Resources { - sink.Resources.Outputs[i] = v1alpha2.TaskResourceBinding{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + sink.Resources.Outputs[i] = v1beta1.TaskResourceBinding{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: resource.Name, ResourceRef: resource.ResourceRef, ResourceSpec: resource.ResourceSpec, @@ -114,7 +114,7 @@ func (source *TaskRunSpec) ConvertUp(ctx context.Context, sink *v1alpha2.TaskRun // ConvertDown implements api.Convertible func (sink *TaskRun) ConvertDown(ctx context.Context, obj apis.Convertible) error { switch source := obj.(type) { - case *v1alpha2.TaskRun: + case *v1beta1.TaskRun: sink.ObjectMeta = source.ObjectMeta if err := sink.Spec.ConvertDown(ctx, &source.Spec); err != nil { return err @@ -126,7 +126,7 @@ func (sink *TaskRun) ConvertDown(ctx context.Context, obj apis.Convertible) erro } } -func (sink *TaskRunSpec) ConvertDown(ctx context.Context, source *v1alpha2.TaskRunSpec) error { +func (sink *TaskRunSpec) ConvertDown(ctx context.Context, source *v1beta1.TaskRunSpec) error { sink.ServiceAccountName = source.ServiceAccountName sink.TaskRef = source.TaskRef if source.TaskSpec != nil { diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go b/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go index 371ac2d2052..6d093175b07 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go @@ -22,7 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -41,7 +41,7 @@ func TestTaskRunConversionBadType(t *testing.T) { } func TestTaskRunConversion(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.TaskRun{}} + versions := []apis.Convertible{&v1beta1.TaskRun{}} tests := []struct { name string @@ -71,20 +71,20 @@ func TestTaskRunConversion(t *testing.T) { }}, Params: []Param{{ Name: "p1", - Value: v1alpha2.ArrayOrString{StringVal: "baz"}, + Value: v1beta1.ArrayOrString{StringVal: "baz"}, }}, - Resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r2"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r2"}, }, }}, }, @@ -109,8 +109,8 @@ func TestTaskRunConversion(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -126,20 +126,20 @@ func TestTaskRunConversion(t *testing.T) { }}, Params: []Param{{ Name: "p1", - Value: v1alpha2.ArrayOrString{StringVal: "baz"}, + Value: v1beta1.ArrayOrString{StringVal: "baz"}, }}, - Resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r2"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r2"}, }, }}, }, @@ -154,8 +154,8 @@ func TestTaskRunConversion(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -171,12 +171,12 @@ func TestTaskRunConversion(t *testing.T) { }}, Params: []Param{{ Name: "p1", - Value: v1alpha2.ArrayOrString{StringVal: "baz"}, + Value: v1beta1.ArrayOrString{StringVal: "baz"}, }}, Inputs: TaskRunInputs{ Params: []Param{{ Name: "p2", - Value: v1alpha2.ArrayOrString{StringVal: "bar"}}, + Value: v1beta1.ArrayOrString{StringVal: "bar"}}, }, }, }, @@ -191,8 +191,8 @@ func TestTaskRunConversion(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -206,11 +206,11 @@ func TestTaskRunConversion(t *testing.T) { SubPath: "foo", EmptyDir: &corev1.EmptyDirVolumeSource{}, }}, - Resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -219,7 +219,7 @@ func TestTaskRunConversion(t *testing.T) { Resources: []TaskResourceBinding{{ PipelineResourceBinding: PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -236,8 +236,8 @@ func TestTaskRunConversion(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - TaskSpec: &TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "foo", }}}, }}, @@ -251,11 +251,11 @@ func TestTaskRunConversion(t *testing.T) { SubPath: "foo", EmptyDir: &corev1.EmptyDirVolumeSource{}, }}, - Resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -264,7 +264,7 @@ func TestTaskRunConversion(t *testing.T) { Resources: []TaskResourceBinding{{ PipelineResourceBinding: PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -299,7 +299,7 @@ func TestTaskRunConversion(t *testing.T) { } func TestTaskRunConversionFromDeprecated(t *testing.T) { - versions := []apis.Convertible{&v1alpha2.TaskRun{}} + versions := []apis.Convertible{&v1beta1.TaskRun{}} tests := []struct { name string in *TaskRun @@ -317,7 +317,7 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Inputs: TaskRunInputs{ Params: []Param{{ Name: "p2", - Value: v1alpha2.ArrayOrString{StringVal: "bar"}}, + Value: v1beta1.ArrayOrString{StringVal: "bar"}}, }, }, }, @@ -331,7 +331,7 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Spec: TaskRunSpec{ Params: []Param{{ Name: "p2", - Value: v1alpha2.ArrayOrString{StringVal: "bar"}}, + Value: v1beta1.ArrayOrString{StringVal: "bar"}}, }, }, }, @@ -348,7 +348,7 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Resources: []TaskResourceBinding{{ PipelineResourceBinding: PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -362,11 +362,11 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "i1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -386,7 +386,7 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Resources: []TaskResourceBinding{{ PipelineResourceBinding: PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, @@ -400,11 +400,11 @@ func TestTaskRunConversionFromDeprecated(t *testing.T) { Generation: 1, }, Spec: TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + Resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "o1", - ResourceRef: &v1alpha2.PipelineResourceRef{Name: "r1"}, + ResourceRef: &v1beta1.PipelineResourceRef{Name: "r1"}, }, Paths: []string{"foo", "bar"}, }}, diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go b/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go index d3415d6d603..db65548b5ba 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go @@ -21,7 +21,7 @@ import ( "time" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -48,7 +48,7 @@ func (tr *TaskRun) SetDefaults(ctx context.Context) { func (trs *TaskRunSpec) SetDefaults(ctx context.Context) { if contexts.IsUpgradeViaDefaulting(ctx) { - v := v1alpha2.TaskRunSpec{} + v := v1beta1.TaskRunSpec{} if trs.ConvertUp(ctx, &v) == nil { alpha := TaskRunSpec{} if alpha.ConvertDown(ctx, &v) == nil { diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_types.go b/pkg/apis/pipeline/v1alpha1/taskrun_types.go index b34f099b61d..365d52606d2 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_types.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_types.go @@ -20,7 +20,7 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -49,11 +49,11 @@ type TaskRunSpec struct { // Workspaces is a list of WorkspaceBindings from volumes to workspaces. // +optional Workspaces []WorkspaceBinding `json:"workspaces,omitempty"` - // From v1alpha2 + // From v1beta1 // +optional Params []Param `json:"params,omitempty"` // +optional - Resources *v1alpha2.TaskRunResources `json:"resources,omitempty"` + Resources *v1beta1.TaskRunResources `json:"resources,omitempty"` // Deprecated // +optional Inputs TaskRunInputs `json:"inputs,omitempty"` @@ -62,12 +62,12 @@ type TaskRunSpec struct { } // TaskRunSpecStatus defines the taskrun spec status the user can provide -type TaskRunSpecStatus = v1alpha2.TaskRunSpecStatus +type TaskRunSpecStatus = v1beta1.TaskRunSpecStatus const ( // TaskRunSpecStatusCancelled indicates that the user wants to cancel the task, // if not already cancelled or terminated - TaskRunSpecStatusCancelled = v1alpha2.TaskRunSpecStatusCancelled + TaskRunSpecStatusCancelled = v1beta1.TaskRunSpecStatusCancelled ) // TaskRunInputs holds the input values that this task was invoked with. @@ -80,7 +80,7 @@ type TaskRunInputs struct { // TaskResourceBinding points to the PipelineResource that // will be used for the Task input or output called Name. -type TaskResourceBinding = v1alpha2.TaskResourceBinding +type TaskResourceBinding = v1beta1.TaskResourceBinding // TaskRunOutputs holds the output values that this task was invoked with. type TaskRunOutputs struct { @@ -89,42 +89,42 @@ type TaskRunOutputs struct { } // TaskRunStatus defines the observed state of TaskRun -type TaskRunStatus = v1alpha2.TaskRunStatus +type TaskRunStatus = v1beta1.TaskRunStatus // TaskRunStatusFields holds the fields of TaskRun's status. This is defined // separately and inlined so that other types can readily consume these fields // via duck typing. -type TaskRunStatusFields = v1alpha2.TaskRunStatusFields +type TaskRunStatusFields = v1beta1.TaskRunStatusFields // TaskRunResult used to describe the results of a task -type TaskRunResult = v1alpha2.TaskRunResult +type TaskRunResult = v1beta1.TaskRunResult // StepState reports the results of running a step in the Task. -type StepState = v1alpha2.StepState +type StepState = v1beta1.StepState // SidecarState reports the results of sidecar in the Task. -type SidecarState = v1alpha2.SidecarState +type SidecarState = v1beta1.SidecarState // CloudEventDelivery is the target of a cloud event along with the state of // delivery. -type CloudEventDelivery = v1alpha2.CloudEventDelivery +type CloudEventDelivery = v1beta1.CloudEventDelivery // CloudEventCondition is a string that represents the condition of the event. -type CloudEventCondition = v1alpha2.CloudEventCondition +type CloudEventCondition = v1beta1.CloudEventCondition const ( // CloudEventConditionUnknown means that the condition for the event to be // triggered was not met yet, or we don't know the state yet. - CloudEventConditionUnknown CloudEventCondition = v1alpha2.CloudEventConditionUnknown + CloudEventConditionUnknown CloudEventCondition = v1beta1.CloudEventConditionUnknown // CloudEventConditionSent means that the event was sent successfully - CloudEventConditionSent CloudEventCondition = v1alpha2.CloudEventConditionSent + CloudEventConditionSent CloudEventCondition = v1beta1.CloudEventConditionSent // CloudEventConditionFailed means that there was one or more attempts to // send the event, and none was successful so far. - CloudEventConditionFailed CloudEventCondition = v1alpha2.CloudEventConditionFailed + CloudEventConditionFailed CloudEventCondition = v1beta1.CloudEventConditionFailed ) // CloudEventDeliveryState reports the state of a cloud event to be sent. -type CloudEventDeliveryState = v1alpha2.CloudEventDeliveryState +type CloudEventDeliveryState = v1beta1.CloudEventDeliveryState // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go b/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go index 7ca24ce0739..3b8e50e9194 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/builder" tb "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" @@ -123,7 +123,7 @@ func TestTaskRunSpec_Invalid(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "taskrefname", }, - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", @@ -143,7 +143,7 @@ func TestTaskRunSpec_Invalid(t *testing.T) { }, { name: "invalid taskspec", spec: v1alpha1.TaskRunSpec{ - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "invalid-name-with-$weird-char*/%", Image: "myimage", @@ -173,7 +173,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { }{{ name: "taskspec without a taskRef", spec: v1alpha1.TaskRunSpec{ - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", @@ -184,7 +184,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { name: "no timeout", spec: v1alpha1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: 0}, - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", diff --git a/pkg/apis/pipeline/v1alpha1/workspace_types.go b/pkg/apis/pipeline/v1alpha1/workspace_types.go index 09b68d4ab05..1d9650c45b4 100644 --- a/pkg/apis/pipeline/v1alpha1/workspace_types.go +++ b/pkg/apis/pipeline/v1alpha1/workspace_types.go @@ -17,19 +17,19 @@ limitations under the License. package v1alpha1 import ( - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // WorkspaceDeclaration is a declaration of a volume that a Task requires. -type WorkspaceDeclaration = v1alpha2.WorkspaceDeclaration +type WorkspaceDeclaration = v1beta1.WorkspaceDeclaration // WorkspaceBinding maps a Task's declared workspace to a Volume. -type WorkspaceBinding = v1alpha2.WorkspaceBinding +type WorkspaceBinding = v1beta1.WorkspaceBinding // WorkspacePipelineDeclaration creates a named slot in a Pipeline that a PipelineRun // is expected to populate with a workspace binding. -type WorkspacePipelineDeclaration = v1alpha2.WorkspacePipelineDeclaration +type WorkspacePipelineDeclaration = v1beta1.WorkspacePipelineDeclaration // WorkspacePipelineTaskBinding describes how a workspace passed into the pipeline should be // mapped to a task's declared workspace. -type WorkspacePipelineTaskBinding = v1alpha2.WorkspacePipelineTaskBinding +type WorkspacePipelineTaskBinding = v1beta1.WorkspacePipelineTaskBinding diff --git a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go index 7cd2bc85249..343abca21e8 100644 --- a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go @@ -22,7 +22,7 @@ package v1alpha1 import ( pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -174,7 +174,7 @@ func (in *ConditionSpec) DeepCopyInto(out *ConditionSpec) { in.Check.DeepCopyInto(&out.Check) if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.ParamSpec, len(*in)) + *out = make([]v1beta1.ParamSpec, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -202,12 +202,12 @@ func (in *Inputs) DeepCopyInto(out *Inputs) { *out = *in if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.TaskResource, len(*in)) + *out = make([]v1beta1.TaskResource, len(*in)) copy(*out, *in) } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.ParamSpec, len(*in)) + *out = make([]v1beta1.ParamSpec, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -235,7 +235,7 @@ func (in *Outputs) DeepCopyInto(out *Outputs) { } if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.TaskResource, len(*in)) + *out = make([]v1beta1.TaskResource, len(*in)) copy(*out, *in) } return @@ -382,7 +382,7 @@ func (in *PipelineRunSpec) DeepCopyInto(out *PipelineRunSpec) { *out = *in if in.PipelineRef != nil { in, out := &in.PipelineRef, &out.PipelineRef - *out = new(v1alpha2.PipelineRef) + *out = new(v1beta1.PipelineRef) **out = **in } if in.PipelineSpec != nil { @@ -392,21 +392,21 @@ func (in *PipelineRunSpec) DeepCopyInto(out *PipelineRunSpec) { } if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.PipelineResourceBinding, len(*in)) + *out = make([]v1beta1.PipelineResourceBinding, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.Param, len(*in)) + *out = make([]v1beta1.Param, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.ServiceAccountNames != nil { in, out := &in.ServiceAccountNames, &out.ServiceAccountNames - *out = make([]v1alpha2.PipelineRunSpecServiceAccountName, len(*in)) + *out = make([]v1beta1.PipelineRunSpecServiceAccountName, len(*in)) copy(*out, *in) } if in.Timeout != nil { @@ -421,7 +421,7 @@ func (in *PipelineRunSpec) DeepCopyInto(out *PipelineRunSpec) { } if in.Workspaces != nil { in, out := &in.Workspaces, &out.Workspaces - *out = make([]v1alpha2.WorkspaceBinding, len(*in)) + *out = make([]v1beta1.WorkspaceBinding, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -444,7 +444,7 @@ func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) { *out = *in if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.PipelineDeclaredResource, len(*in)) + *out = make([]v1beta1.PipelineDeclaredResource, len(*in)) copy(*out, *in) } if in.Tasks != nil { @@ -456,14 +456,14 @@ func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) { } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.ParamSpec, len(*in)) + *out = make([]v1beta1.ParamSpec, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Workspaces != nil { in, out := &in.Workspaces, &out.Workspaces - *out = make([]v1alpha2.WorkspacePipelineDeclaration, len(*in)) + *out = make([]v1beta1.WorkspacePipelineDeclaration, len(*in)) copy(*out, *in) } return @@ -500,7 +500,7 @@ func (in *PipelineTask) DeepCopyInto(out *PipelineTask) { *out = *in if in.TaskRef != nil { in, out := &in.TaskRef, &out.TaskRef - *out = new(v1alpha2.TaskRef) + *out = new(v1beta1.TaskRef) **out = **in } if in.TaskSpec != nil { @@ -510,7 +510,7 @@ func (in *PipelineTask) DeepCopyInto(out *PipelineTask) { } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make([]v1alpha2.PipelineTaskCondition, len(*in)) + *out = make([]v1beta1.PipelineTaskCondition, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -522,19 +522,19 @@ func (in *PipelineTask) DeepCopyInto(out *PipelineTask) { } if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = new(v1alpha2.PipelineTaskResources) + *out = new(v1beta1.PipelineTaskResources) (*in).DeepCopyInto(*out) } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.Param, len(*in)) + *out = make([]v1beta1.Param, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Workspaces != nil { in, out := &in.Workspaces, &out.Workspaces - *out = make([]v1alpha2.WorkspacePipelineTaskBinding, len(*in)) + *out = make([]v1beta1.WorkspacePipelineTaskBinding, len(*in)) copy(*out, *in) } if in.Timeout != nil { @@ -670,14 +670,14 @@ func (in *TaskRunInputs) DeepCopyInto(out *TaskRunInputs) { *out = *in if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.TaskResourceBinding, len(*in)) + *out = make([]v1beta1.TaskResourceBinding, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.Param, len(*in)) + *out = make([]v1beta1.Param, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -733,7 +733,7 @@ func (in *TaskRunOutputs) DeepCopyInto(out *TaskRunOutputs) { *out = *in if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]v1alpha2.TaskResourceBinding, len(*in)) + *out = make([]v1beta1.TaskResourceBinding, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -756,7 +756,7 @@ func (in *TaskRunSpec) DeepCopyInto(out *TaskRunSpec) { *out = *in if in.TaskRef != nil { in, out := &in.TaskRef, &out.TaskRef - *out = new(v1alpha2.TaskRef) + *out = new(v1beta1.TaskRef) **out = **in } if in.TaskSpec != nil { @@ -776,21 +776,21 @@ func (in *TaskRunSpec) DeepCopyInto(out *TaskRunSpec) { } if in.Workspaces != nil { in, out := &in.Workspaces, &out.Workspaces - *out = make([]v1alpha2.WorkspaceBinding, len(*in)) + *out = make([]v1beta1.WorkspaceBinding, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Params != nil { in, out := &in.Params, &out.Params - *out = make([]v1alpha2.Param, len(*in)) + *out = make([]v1beta1.Param, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = new(v1alpha2.TaskRunResources) + *out = new(v1beta1.TaskRunResources) (*in).DeepCopyInto(*out) } in.Inputs.DeepCopyInto(&out.Inputs) diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_validation_test.go b/pkg/apis/pipeline/v1alpha2/pipeline_validation_test.go deleted file mode 100644 index 6b201e42b9f..00000000000 --- a/pkg/apis/pipeline/v1alpha2/pipeline_validation_test.go +++ /dev/null @@ -1,680 +0,0 @@ -/* -Copyright 2020 The Tekton Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2_test - -import ( - "context" - "testing" - - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestPipeline_Validate(t *testing.T) { - tests := []struct { - name string - p *v1alpha2.Pipeline - failureExpected bool - }{{ - name: "valid metadata", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}}, - }, - }, - failureExpected: false, - }, { - name: "valid resource declarations and usage", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }, { - Name: "wonderful-resource", Type: v1alpha2.PipelineResourceTypeImage, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "some-workspace", Resource: "great-resource", - }}, - Outputs: []v1alpha2.PipelineTaskOutputResource{{ - Name: "some-imagee", Resource: "wonderful-resource", - }}, - }, - Conditions: []v1alpha2.PipelineTaskCondition{{ - ConditionRef: "some-condition", - Resources: []v1alpha2.PipelineTaskInputResource{{ - Name: "some-workspace", Resource: "great-resource", - }}, - }}, - }, { - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "some-imagee", Resource: "wonderful-resource", From: []string{"bar"}, - }}, - }, - Conditions: []v1alpha2.PipelineTaskCondition{{ - ConditionRef: "some-condition-2", - Resources: []v1alpha2.PipelineTaskInputResource{{ - Name: "some-image", Resource: "wonderful-resource", From: []string{"bar"}, - }}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "period in name", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipe.line"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}}, - }, - }, - failureExpected: true, - }, { - name: "pipeline name too long", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "asdf123456789012345678901234567890123456789012345678901234567890"}, - }, - failureExpected: true, - }, { - name: "pipeline spec missing taskref and taskspec", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{ - {Name: "foo"}, - }, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec with taskref and taskspec", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{ - { - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{ - Container: corev1.Container{Name: "foo", Image: "bar"}, - }}, - }, - }, - }, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec invalid taskspec", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{ - { - Name: "foo", - TaskSpec: &v1alpha2.TaskSpec{}, - }, - }, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec valid taskspec", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{ - { - Name: "foo", - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{ - Container: corev1.Container{Name: "foo", Image: "bar"}, - }}, - }, - }, - }, - }, - }, - failureExpected: false, - }, { - name: "pipeline spec invalid (duplicate tasks)", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{ - {Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}, - {Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}, - }, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec empty task name", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{Name: "", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}}, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec invalid task name", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{Name: "_foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}}}, - }, - }, - failureExpected: true, - }, { - name: "pipeline spec invalid taskref name", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "_foo-task"}}}, - }, - }, - failureExpected: true, - }, { - name: "valid condition only resource", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Conditions: []v1alpha2.PipelineTaskCondition{{ - ConditionRef: "some-condition", - Resources: []v1alpha2.PipelineTaskInputResource{{ - Name: "sowe-workspace", Resource: "great-resource", - }}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "valid parameter variables", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, - }, { - Name: "foo-is-baz", Type: v1alpha2.ParamTypeString, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{StringVal: "$(baz) and $(foo-is-baz)"}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "valid array parameter variables", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeArray, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"some", "default"}}, - }, { - Name: "foo-is-baz", Type: v1alpha2.ParamTypeArray, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{ArrayVal: []string{"$(baz)", "and", "$(foo-is-baz)"}}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "valid star array parameter variables", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeArray, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"some", "default"}}, - }, { - Name: "foo-is-baz", Type: v1alpha2.ParamTypeArray, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{ArrayVal: []string{"$(baz[*])", "and", "$(foo-is-baz[*])"}}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "pipeline parameter nested in task parameter", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{StringVal: "$(input.workspace.$(baz))"}, - }}, - }}, - }, - }, - failureExpected: false, - }, { - name: "from is on first task", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "the-resource", Resource: "great-resource", From: []string{"bar"}, - }}, - }, - }}, - }, - }, - failureExpected: true, - }, { - name: "from task doesnt exist", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "baz", TaskRef: &v1alpha2.TaskRef{Name: "baz-task"}, - }, { - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "the-resource", Resource: "great-resource", From: []string{"bar"}, - }}, - }, - }}, - }, - }, - failureExpected: true, - }, { - name: "output resources missing from declaration", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "the-resource", Resource: "great-resource", - }}, - Outputs: []v1alpha2.PipelineTaskOutputResource{{ - Name: "the-magic-resource", Resource: "missing-resource", - }}, - }, - }}, - }, - }, - failureExpected: true, - }, { - name: "input resources missing from declaration", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "the-resource", Resource: "missing-resource", - }}, - Outputs: []v1alpha2.PipelineTaskOutputResource{{ - Name: "the-magic-resource", Resource: "great-resource", - }}, - }, - }}, - }, - }, - failureExpected: true, - }, { - name: "invalid condition only resource", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Conditions: []v1alpha2.PipelineTaskCondition{{ - ConditionRef: "some-condition", - Resources: []v1alpha2.PipelineTaskInputResource{{ - Name: "sowe-workspace", Resource: "missing-resource", - }}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "invalid from in condition", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - }, { - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Conditions: []v1alpha2.PipelineTaskCondition{{ - ConditionRef: "some-condition", - Resources: []v1alpha2.PipelineTaskInputResource{{ - Name: "sowe-workspace", Resource: "missing-resource", From: []string{"foo"}, - }}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "from resource isn't output by task", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Resources: []v1alpha2.PipelineDeclaredResource{{ - Name: "great-resource", Type: v1alpha2.PipelineResourceTypeGit, - }, { - Name: "wonderful-resource", Type: v1alpha2.PipelineResourceTypeImage, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "some-resource", Resource: "great-resource", - }}, - }, - }, { - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Resources: &v1alpha2.PipelineTaskResources{ - Inputs: []v1alpha2.PipelineTaskInputResource{{ - Name: "wow-image", Resource: "wonderful-resource", From: []string{"bar"}, - }}, - }, - }}, - }, - }, - failureExpected: true, - }, { - name: "not defined parameter variable", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeString, StringVal: "$(params.does-not-exist)"}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "not defined parameter variable with defined", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "foo", Type: v1alpha2.ParamTypeString, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeString, StringVal: "$(params.foo) and $(params.does-not-exist)"}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "invalid parameter type", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "foo", Type: "invalidtype", - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - }}, - }, - }, - failureExpected: true, - }, { - name: "array parameter mismatching default type", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "foo", Type: v1alpha2.ParamTypeArray, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeString, StringVal: "astring"}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - }}, - }, - }, - failureExpected: true, - }, { - name: "string parameter mismatching default type", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "foo", Type: v1alpha2.ParamTypeString, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", - TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, - }}, - }, - }, - failureExpected: true, - }, { - name: "array parameter used as string", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeString, StringVal: "$(params.baz)"}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "star array parameter used as string", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeString, StringVal: "$(params.baz[*])"}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "array parameter string template not isolated", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"value: $(params.baz)", "last"}}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "star array parameter string template not isolated", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Params: []v1alpha2.ParamSpec{{ - Name: "baz", Type: v1alpha2.ParamTypeString, Default: &v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, - }}, - Tasks: []v1alpha2.PipelineTask{{ - Name: "bar", - TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, - Params: []v1alpha2.Param{{ - Name: "a-param", Value: v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"value: $(params.baz[*])", "last"}}, - }}, - }}, - }, - }, - failureExpected: true, - }, { - name: "invalid dependency graph between the tasks", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo-task"}, RunAfter: []string{"bar"}, - }, { - Name: "bar", TaskRef: &v1alpha2.TaskRef{Name: "bar-task"}, RunAfter: []string{"foo"}, - }}, - }, - }, - failureExpected: true, - }, { - name: "unused pipeline spec workspaces do not cause an error", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo"}, - }}, - Workspaces: []v1alpha2.WorkspacePipelineDeclaration{{ - Name: "foo", - }, { - Name: "bar", - }}, - }, - }, - failureExpected: false, - }, { - name: "workspace bindings relying on a non-existent pipeline workspace cause an error", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, - Spec: v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ - Name: "foo", TaskRef: &v1alpha2.TaskRef{Name: "foo"}, - Workspaces: []v1alpha2.WorkspacePipelineTaskBinding{{ - Name: "taskWorkspaceName", - Workspace: "pipelineWorkspaceName", - }}, - }}, - Workspaces: []v1alpha2.WorkspacePipelineDeclaration{{ - Name: "foo", - }}, - }, - }, - failureExpected: true, - }, { - name: "multiple workspaces sharing the same name are not allowed", - p: &v1alpha2.Pipeline{ - ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, Spec: v1alpha2.PipelineSpec{ - Workspaces: []v1alpha2.WorkspacePipelineDeclaration{{ - Name: "foo", - }, { - Name: "foo", - }}, - }, - }, - failureExpected: true, - }} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.p.Validate(context.Background()) - if (!tt.failureExpected) && (err != nil) { - t.Errorf("Pipeline.Validate() returned error: %v", err) - } - - if tt.failureExpected && (err == nil) { - t.Error("Pipeline.Validate() did not return error, wanted error") - } - }) - } -} diff --git a/pkg/apis/pipeline/v1alpha2/cluster_task_conversion.go b/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go similarity index 85% rename from pkg/apis/pipeline/v1alpha2/cluster_task_conversion.go rename to pkg/apis/pipeline/v1beta1/cluster_task_conversion.go index c7a96c3c725..beb3c379f92 100644 --- a/pkg/apis/pipeline/v1alpha2/cluster_task_conversion.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go @@ -15,7 +15,7 @@ limitations under the License. */ // nolint: golint -package v1alpha2 +package v1beta1 import ( "context" @@ -28,10 +28,10 @@ var _ apis.Convertible = (*ClusterTask)(nil) // ConvertUp implements api.Convertible func (source *ClusterTask) ConvertUp(ctx context.Context, sink apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest known version, got: %T", sink) + return fmt.Errorf("v1beta1 is the highest known version, got: %T", sink) } // ConvertDown implements api.Convertible func (sink *ClusterTask) ConvertDown(ctx context.Context, source apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest know version, got: %T", source) + return fmt.Errorf("v1beta1 is the highest know version, got: %T", source) } diff --git a/pkg/apis/pipeline/v1alpha2/cluster_task_conversion_test.go b/pkg/apis/pipeline/v1beta1/cluster_task_conversion_test.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/cluster_task_conversion_test.go rename to pkg/apis/pipeline/v1beta1/cluster_task_conversion_test.go index 2c7c0acfc88..a075cb579ed 100644 --- a/pkg/apis/pipeline/v1alpha2/cluster_task_conversion_test.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_conversion_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/cluster_task_defaults.go b/pkg/apis/pipeline/v1beta1/cluster_task_defaults.go similarity index 97% rename from pkg/apis/pipeline/v1alpha2/cluster_task_defaults.go rename to pkg/apis/pipeline/v1beta1/cluster_task_defaults.go index 0b4f7856660..b8a47e304f3 100644 --- a/pkg/apis/pipeline/v1alpha2/cluster_task_defaults.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/cluster_task_types.go b/pkg/apis/pipeline/v1beta1/cluster_task_types.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/cluster_task_types.go rename to pkg/apis/pipeline/v1beta1/cluster_task_types.go index 6ca9d93eb78..0f89fc3fc4d 100644 --- a/pkg/apis/pipeline/v1alpha2/cluster_task_types.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/pipeline/v1alpha2/cluster_task_validation.go b/pkg/apis/pipeline/v1beta1/cluster_task_validation.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/cluster_task_validation.go rename to pkg/apis/pipeline/v1beta1/cluster_task_validation.go index db2ce3630d6..b803b0bce91 100644 --- a/pkg/apis/pipeline/v1alpha2/cluster_task_validation.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/condition_types.go b/pkg/apis/pipeline/v1beta1/condition_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/condition_types.go rename to pkg/apis/pipeline/v1beta1/condition_types.go index f7838974eec..9b2b5717827 100644 --- a/pkg/apis/pipeline/v1alpha2/condition_types.go +++ b/pkg/apis/pipeline/v1beta1/condition_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( corev1 "k8s.io/api/core/v1" diff --git a/pkg/apis/pipeline/v1alpha2/conversion_error.go b/pkg/apis/pipeline/v1beta1/conversion_error.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/conversion_error.go rename to pkg/apis/pipeline/v1beta1/conversion_error.go index be489604de6..91c49aec479 100644 --- a/pkg/apis/pipeline/v1alpha2/conversion_error.go +++ b/pkg/apis/pipeline/v1beta1/conversion_error.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "fmt" diff --git a/pkg/apis/pipeline/v1alpha2/doc.go b/pkg/apis/pipeline/v1beta1/doc.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/doc.go rename to pkg/apis/pipeline/v1beta1/doc.go index 6627a64a5ce..7af728e16a6 100644 --- a/pkg/apis/pipeline/v1alpha2/doc.go +++ b/pkg/apis/pipeline/v1beta1/doc.go @@ -20,4 +20,4 @@ limitations under the License. // +k8s:conversion-gen=github.com/tektoncd/pipeline/pkg/apis/pipeline // +k8s:defaulter-gen=TypeMeta // +groupName=tekton.dev -package v1alpha2 +package v1beta1 diff --git a/pkg/apis/pipeline/v1alpha2/merge.go b/pkg/apis/pipeline/v1beta1/merge.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/merge.go rename to pkg/apis/pipeline/v1beta1/merge.go index 59e10ebf132..d22e4969f8e 100644 --- a/pkg/apis/pipeline/v1alpha2/merge.go +++ b/pkg/apis/pipeline/v1beta1/merge.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "encoding/json" diff --git a/pkg/apis/pipeline/v1alpha2/merge_test.go b/pkg/apis/pipeline/v1beta1/merge_test.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/merge_test.go rename to pkg/apis/pipeline/v1beta1/merge_test.go index 1f8ea6fbd4f..a2fd97ff644 100644 --- a/pkg/apis/pipeline/v1alpha2/merge_test.go +++ b/pkg/apis/pipeline/v1beta1/merge_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "testing" diff --git a/pkg/apis/pipeline/v1alpha2/param_types.go b/pkg/apis/pipeline/v1beta1/param_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/param_types.go rename to pkg/apis/pipeline/v1beta1/param_types.go index 01249a2101a..0ec2c2774f9 100644 --- a/pkg/apis/pipeline/v1alpha2/param_types.go +++ b/pkg/apis/pipeline/v1beta1/param_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/param_types_test.go b/pkg/apis/pipeline/v1beta1/param_types_test.go similarity index 83% rename from pkg/apis/pipeline/v1alpha2/param_types_test.go rename to pkg/apis/pipeline/v1beta1/param_types_test.go index b64cc2739c8..021fc0a06ed 100644 --- a/pkg/apis/pipeline/v1alpha2/param_types_test.go +++ b/pkg/apis/pipeline/v1beta1/param_types_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -23,46 +23,46 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/builder" ) func TestParamSpec_SetDefaults(t *testing.T) { tests := []struct { name string - before *v1alpha2.ParamSpec - defaultsApplied *v1alpha2.ParamSpec + before *v1beta1.ParamSpec + defaultsApplied *v1beta1.ParamSpec }{{ name: "inferred string type", - before: &v1alpha2.ParamSpec{ + before: &v1beta1.ParamSpec{ Name: "parametername", }, - defaultsApplied: &v1alpha2.ParamSpec{ + defaultsApplied: &v1beta1.ParamSpec{ Name: "parametername", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, }, }, { name: "inferred type from default value", - before: &v1alpha2.ParamSpec{ + before: &v1beta1.ParamSpec{ Name: "parametername", Default: builder.ArrayOrString("an", "array"), }, - defaultsApplied: &v1alpha2.ParamSpec{ + defaultsApplied: &v1beta1.ParamSpec{ Name: "parametername", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, Default: builder.ArrayOrString("an", "array"), }, }, { name: "fully defined ParamSpec", - before: &v1alpha2.ParamSpec{ + before: &v1beta1.ParamSpec{ Name: "parametername", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, Description: "a description", Default: builder.ArrayOrString("an", "array"), }, - defaultsApplied: &v1alpha2.ParamSpec{ + defaultsApplied: &v1beta1.ParamSpec{ Name: "parametername", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, Description: "a description", Default: builder.ArrayOrString("an", "array"), }, @@ -80,14 +80,14 @@ func TestParamSpec_SetDefaults(t *testing.T) { func TestArrayOrString_ApplyReplacements(t *testing.T) { type args struct { - input *v1alpha2.ArrayOrString + input *v1beta1.ArrayOrString stringReplacements map[string]string arrayReplacements map[string][]string } tests := []struct { name string args args - expectedOutput *v1alpha2.ArrayOrString + expectedOutput *v1beta1.ArrayOrString }{{ name: "no replacements on array", args: args{ @@ -140,19 +140,19 @@ func TestArrayOrString_ApplyReplacements(t *testing.T) { } type ArrayOrStringHolder struct { - AOrS v1alpha2.ArrayOrString `json:"val"` + AOrS v1beta1.ArrayOrString `json:"val"` } func TestArrayOrString_UnmarshalJSON(t *testing.T) { cases := []struct { input string - result v1alpha2.ArrayOrString + result v1beta1.ArrayOrString }{ {"{\"val\": \"123\"}", *builder.ArrayOrString("123")}, {"{\"val\": \"\"}", *builder.ArrayOrString("")}, - {"{\"val\":[]}", v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{}}}, - {"{\"val\":[\"oneelement\"]}", v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"oneelement"}}}, - {"{\"val\":[\"multiple\", \"elements\"]}", v1alpha2.ArrayOrString{Type: v1alpha2.ParamTypeArray, ArrayVal: []string{"multiple", "elements"}}}, + {"{\"val\":[]}", v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{}}}, + {"{\"val\":[\"oneelement\"]}", v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"oneelement"}}}, + {"{\"val\":[\"multiple\", \"elements\"]}", v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"multiple", "elements"}}}, } for _, c := range cases { @@ -168,7 +168,7 @@ func TestArrayOrString_UnmarshalJSON(t *testing.T) { func TestArrayOrString_MarshalJSON(t *testing.T) { cases := []struct { - input v1alpha2.ArrayOrString + input v1beta1.ArrayOrString result string }{ {*builder.ArrayOrString("123"), "{\"val\":\"123\"}"}, diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_conversion.go b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go similarity index 84% rename from pkg/apis/pipeline/v1alpha2/pipeline_conversion.go rename to pkg/apis/pipeline/v1beta1/pipeline_conversion.go index 658ecdb213c..66f647e85a3 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go @@ -15,7 +15,7 @@ limitations under the License. */ // nolint: golint -package v1alpha2 +package v1beta1 import ( "context" @@ -27,10 +27,10 @@ import ( var _ apis.Convertible = (*Pipeline)(nil) func (source *Pipeline) ConvertUp(ctx context.Context, sink apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest known version, got: %T", sink) + return fmt.Errorf("v1beta1 is the highest known version, got: %T", sink) } // ConvertDown implements api.Convertible func (sink *Pipeline) ConvertDown(ctx context.Context, source apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest know version, got: %T", source) + return fmt.Errorf("v1beta1 is the highest know version, got: %T", source) } diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_conversion_test.go b/pkg/apis/pipeline/v1beta1/pipeline_conversion_test.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/pipeline_conversion_test.go rename to pkg/apis/pipeline/v1beta1/pipeline_conversion_test.go index d24db7ba3a0..3ee3db9b6d9 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_conversion_test.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_conversion_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_defaults.go b/pkg/apis/pipeline/v1beta1/pipeline_defaults.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/pipeline_defaults.go rename to pkg/apis/pipeline/v1beta1/pipeline_defaults.go index 341863f54e9..64aaebd281d 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_defaults.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_interface.go b/pkg/apis/pipeline/v1beta1/pipeline_interface.go similarity index 97% rename from pkg/apis/pipeline/v1alpha2/pipeline_interface.go rename to pkg/apis/pipeline/v1beta1/pipeline_interface.go index d13c0c50ed1..f63e84d7744 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_interface.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_types.go b/pkg/apis/pipeline/v1beta1/pipeline_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/pipeline_types.go rename to pkg/apis/pipeline/v1beta1/pipeline_types.go index f8acff074fe..ba6bcc4d430 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_types.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" diff --git a/pkg/apis/pipeline/v1alpha2/pipeline_validation.go b/pkg/apis/pipeline/v1beta1/pipeline_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/pipeline_validation.go rename to pkg/apis/pipeline/v1beta1/pipeline_validation.go index e7c8e78bc83..c58de3580c0 100644 --- a/pkg/apis/pipeline/v1alpha2/pipeline_validation.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go b/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go new file mode 100644 index 00000000000..cebe662e7fb --- /dev/null +++ b/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go @@ -0,0 +1,680 @@ +/* +Copyright 2020 The Tekton Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1_test + +import ( + "context" + "testing" + + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestPipeline_Validate(t *testing.T) { + tests := []struct { + name string + p *v1beta1.Pipeline + failureExpected bool + }{{ + name: "valid metadata", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}}, + }, + }, + failureExpected: false, + }, { + name: "valid resource declarations and usage", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }, { + Name: "wonderful-resource", Type: v1beta1.PipelineResourceTypeImage, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "some-workspace", Resource: "great-resource", + }}, + Outputs: []v1beta1.PipelineTaskOutputResource{{ + Name: "some-imagee", Resource: "wonderful-resource", + }}, + }, + Conditions: []v1beta1.PipelineTaskCondition{{ + ConditionRef: "some-condition", + Resources: []v1beta1.PipelineTaskInputResource{{ + Name: "some-workspace", Resource: "great-resource", + }}, + }}, + }, { + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "some-imagee", Resource: "wonderful-resource", From: []string{"bar"}, + }}, + }, + Conditions: []v1beta1.PipelineTaskCondition{{ + ConditionRef: "some-condition-2", + Resources: []v1beta1.PipelineTaskInputResource{{ + Name: "some-image", Resource: "wonderful-resource", From: []string{"bar"}, + }}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "period in name", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipe.line"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}}, + }, + }, + failureExpected: true, + }, { + name: "pipeline name too long", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "asdf123456789012345678901234567890123456789012345678901234567890"}, + }, + failureExpected: true, + }, { + name: "pipeline spec missing taskref and taskspec", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{ + {Name: "foo"}, + }, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec with taskref and taskspec", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{ + { + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + Container: corev1.Container{Name: "foo", Image: "bar"}, + }}, + }, + }, + }, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec invalid taskspec", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{ + { + Name: "foo", + TaskSpec: &v1beta1.TaskSpec{}, + }, + }, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec valid taskspec", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{ + { + Name: "foo", + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ + Container: corev1.Container{Name: "foo", Image: "bar"}, + }}, + }, + }, + }, + }, + }, + failureExpected: false, + }, { + name: "pipeline spec invalid (duplicate tasks)", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{ + {Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}, + {Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}, + }, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec empty task name", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{Name: "", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}}, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec invalid task name", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{Name: "_foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}}}, + }, + }, + failureExpected: true, + }, { + name: "pipeline spec invalid taskref name", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "_foo-task"}}}, + }, + }, + failureExpected: true, + }, { + name: "valid condition only resource", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Conditions: []v1beta1.PipelineTaskCondition{{ + ConditionRef: "some-condition", + Resources: []v1beta1.PipelineTaskInputResource{{ + Name: "sowe-workspace", Resource: "great-resource", + }}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "valid parameter variables", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, + }, { + Name: "foo-is-baz", Type: v1beta1.ParamTypeString, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{StringVal: "$(baz) and $(foo-is-baz)"}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "valid array parameter variables", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeArray, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"some", "default"}}, + }, { + Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{ArrayVal: []string{"$(baz)", "and", "$(foo-is-baz)"}}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "valid star array parameter variables", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeArray, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"some", "default"}}, + }, { + Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{ArrayVal: []string{"$(baz[*])", "and", "$(foo-is-baz[*])"}}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "pipeline parameter nested in task parameter", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{StringVal: "$(input.workspace.$(baz))"}, + }}, + }}, + }, + }, + failureExpected: false, + }, { + name: "from is on first task", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "the-resource", Resource: "great-resource", From: []string{"bar"}, + }}, + }, + }}, + }, + }, + failureExpected: true, + }, { + name: "from task doesnt exist", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "baz", TaskRef: &v1beta1.TaskRef{Name: "baz-task"}, + }, { + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "the-resource", Resource: "great-resource", From: []string{"bar"}, + }}, + }, + }}, + }, + }, + failureExpected: true, + }, { + name: "output resources missing from declaration", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "the-resource", Resource: "great-resource", + }}, + Outputs: []v1beta1.PipelineTaskOutputResource{{ + Name: "the-magic-resource", Resource: "missing-resource", + }}, + }, + }}, + }, + }, + failureExpected: true, + }, { + name: "input resources missing from declaration", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "the-resource", Resource: "missing-resource", + }}, + Outputs: []v1beta1.PipelineTaskOutputResource{{ + Name: "the-magic-resource", Resource: "great-resource", + }}, + }, + }}, + }, + }, + failureExpected: true, + }, { + name: "invalid condition only resource", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Conditions: []v1beta1.PipelineTaskCondition{{ + ConditionRef: "some-condition", + Resources: []v1beta1.PipelineTaskInputResource{{ + Name: "sowe-workspace", Resource: "missing-resource", + }}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "invalid from in condition", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + }, { + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Conditions: []v1beta1.PipelineTaskCondition{{ + ConditionRef: "some-condition", + Resources: []v1beta1.PipelineTaskInputResource{{ + Name: "sowe-workspace", Resource: "missing-resource", From: []string{"foo"}, + }}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "from resource isn't output by task", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Resources: []v1beta1.PipelineDeclaredResource{{ + Name: "great-resource", Type: v1beta1.PipelineResourceTypeGit, + }, { + Name: "wonderful-resource", Type: v1beta1.PipelineResourceTypeImage, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "some-resource", Resource: "great-resource", + }}, + }, + }, { + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Resources: &v1beta1.PipelineTaskResources{ + Inputs: []v1beta1.PipelineTaskInputResource{{ + Name: "wow-image", Resource: "wonderful-resource", From: []string{"bar"}, + }}, + }, + }}, + }, + }, + failureExpected: true, + }, { + name: "not defined parameter variable", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeString, StringVal: "$(params.does-not-exist)"}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "not defined parameter variable with defined", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "foo", Type: v1beta1.ParamTypeString, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeString, StringVal: "$(params.foo) and $(params.does-not-exist)"}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "invalid parameter type", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "foo", Type: "invalidtype", + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + }}, + }, + }, + failureExpected: true, + }, { + name: "array parameter mismatching default type", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "foo", Type: v1beta1.ParamTypeArray, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeString, StringVal: "astring"}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + }}, + }, + }, + failureExpected: true, + }, { + name: "string parameter mismatching default type", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "foo", Type: v1beta1.ParamTypeString, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", + TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, + }}, + }, + }, + failureExpected: true, + }, { + name: "array parameter used as string", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeString, StringVal: "$(params.baz)"}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "star array parameter used as string", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeString, StringVal: "$(params.baz[*])"}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "array parameter string template not isolated", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"value: $(params.baz)", "last"}}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "star array parameter string template not isolated", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Params: []v1beta1.ParamSpec{{ + Name: "baz", Type: v1beta1.ParamTypeString, Default: &v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"anarray", "elements"}}, + }}, + Tasks: []v1beta1.PipelineTask{{ + Name: "bar", + TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, + Params: []v1beta1.Param{{ + Name: "a-param", Value: v1beta1.ArrayOrString{Type: v1beta1.ParamTypeArray, ArrayVal: []string{"value: $(params.baz[*])", "last"}}, + }}, + }}, + }, + }, + failureExpected: true, + }, { + name: "invalid dependency graph between the tasks", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo-task"}, RunAfter: []string{"bar"}, + }, { + Name: "bar", TaskRef: &v1beta1.TaskRef{Name: "bar-task"}, RunAfter: []string{"foo"}, + }}, + }, + }, + failureExpected: true, + }, { + name: "unused pipeline spec workspaces do not cause an error", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo"}, + }}, + Workspaces: []v1beta1.WorkspacePipelineDeclaration{{ + Name: "foo", + }, { + Name: "bar", + }}, + }, + }, + failureExpected: false, + }, { + name: "workspace bindings relying on a non-existent pipeline workspace cause an error", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, + Spec: v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ + Name: "foo", TaskRef: &v1beta1.TaskRef{Name: "foo"}, + Workspaces: []v1beta1.WorkspacePipelineTaskBinding{{ + Name: "taskWorkspaceName", + Workspace: "pipelineWorkspaceName", + }}, + }}, + Workspaces: []v1beta1.WorkspacePipelineDeclaration{{ + Name: "foo", + }}, + }, + }, + failureExpected: true, + }, { + name: "multiple workspaces sharing the same name are not allowed", + p: &v1beta1.Pipeline{ + ObjectMeta: metav1.ObjectMeta{Name: "pipeline"}, Spec: v1beta1.PipelineSpec{ + Workspaces: []v1beta1.WorkspacePipelineDeclaration{{ + Name: "foo", + }, { + Name: "foo", + }}, + }, + }, + failureExpected: true, + }} + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.p.Validate(context.Background()) + if (!tt.failureExpected) && (err != nil) { + t.Errorf("Pipeline.Validate() returned error: %v", err) + } + + if tt.failureExpected && (err == nil) { + t.Error("Pipeline.Validate() did not return error, wanted error") + } + }) + } +} diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_conversion.go b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go similarity index 85% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_conversion.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go index 0bcdbfd42a5..e7554f92eb9 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go @@ -15,7 +15,7 @@ limitations under the License. */ // nolint: golint -package v1alpha2 +package v1beta1 import ( "context" @@ -28,10 +28,10 @@ var _ apis.Convertible = (*PipelineRun)(nil) // ConvertUp implements api.Convertible func (source *PipelineRun) ConvertUp(ctx context.Context, sink apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest known version, got: %T", sink) + return fmt.Errorf("v1beta1 is the highest known version, got: %T", sink) } // ConvertDown implements api.Convertible func (sink *PipelineRun) ConvertDown(ctx context.Context, source apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest know version, got: %T", source) + return fmt.Errorf("v1beta1 is the highest know version, got: %T", source) } diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_conversion_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_conversion_test.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go index 81f82159a88..58e7a75f043 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_conversion_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_defaults.go b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_defaults.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go index 18389f3ef09..cdb60529055 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_defaults.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_defaults_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go similarity index 72% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_defaults_test.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go index 7297da8abd6..52e46c8843b 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_defaults_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_defaults_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,44 +33,44 @@ import ( func TestPipelineRunSpec_SetDefaults(t *testing.T) { cases := []struct { desc string - prs *v1alpha2.PipelineRunSpec - want *v1alpha2.PipelineRunSpec + prs *v1beta1.PipelineRunSpec + want *v1beta1.PipelineRunSpec }{ { desc: "timeout is nil", - prs: &v1alpha2.PipelineRunSpec{}, - want: &v1alpha2.PipelineRunSpec{ + prs: &v1beta1.PipelineRunSpec{}, + want: &v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "timeout is not nil", - prs: &v1alpha2.PipelineRunSpec{ + prs: &v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, - want: &v1alpha2.PipelineRunSpec{ + want: &v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, }, { desc: "pod template is nil", - prs: &v1alpha2.PipelineRunSpec{}, - want: &v1alpha2.PipelineRunSpec{ + prs: &v1beta1.PipelineRunSpec{}, + want: &v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "pod template is not nil", - prs: &v1alpha2.PipelineRunSpec{ - PodTemplate: &v1alpha2.PodTemplate{ + prs: &v1beta1.PipelineRunSpec{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, }, }, - want: &v1alpha2.PipelineRunSpec{ + want: &v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, - PodTemplate: &v1alpha2.PodTemplate{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, @@ -94,41 +94,41 @@ func TestPipelineRunSpec_SetDefaults(t *testing.T) { func TestPipelineRunDefaulting(t *testing.T) { tests := []struct { name string - in *v1alpha2.PipelineRun - want *v1alpha2.PipelineRun + in *v1beta1.PipelineRun + want *v1beta1.PipelineRun wc func(context.Context) context.Context }{{ name: "empty no context", - in: &v1alpha2.PipelineRun{}, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ + in: &v1beta1.PipelineRun{}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, }, { name: "PipelineRef upgrade context", - in: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + in: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, }, }, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, wc: contexts.WithUpgradeViaDefaulting, }, { name: "PipelineRef default config context", - in: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + in: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, }, }, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, }, }, @@ -146,14 +146,14 @@ func TestPipelineRunDefaulting(t *testing.T) { }, }, { name: "PipelineRef default config context with sa", - in: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + in: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, }, }, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, ServiceAccountName: "tekton", }, @@ -173,17 +173,17 @@ func TestPipelineRunDefaulting(t *testing.T) { }, }, { name: "PipelineRef pod template is coming from default config pod template", - in: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + in: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, }, }, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, ServiceAccountName: "tekton", - PodTemplate: &v1alpha2.PodTemplate{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, @@ -206,22 +206,22 @@ func TestPipelineRunDefaulting(t *testing.T) { }, }, { name: "PipelineRef pod template takes precedence over default config pod template", - in: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, - PodTemplate: &v1alpha2.PodTemplate{ + in: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label2": "value2", }, }, }, }, - want: &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "foo"}, + want: &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, ServiceAccountName: "tekton", - PodTemplate: &v1alpha2.PodTemplate{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label2": "value2", }, diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_types.go b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_types.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_types.go index 975a176c80e..f971b888caf 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_types.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "fmt" diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_types_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go similarity index 81% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_types_test.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go index 78af313857a..9f9a3488770 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_types_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_types_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "fmt" @@ -22,7 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" tb "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -30,7 +30,7 @@ import ( ) func TestPipelineRunStatusConditions(t *testing.T) { - p := &v1alpha2.PipelineRun{} + p := &v1beta1.PipelineRun{} foo := &apis.Condition{ Type: "Foo", Status: "True", @@ -63,7 +63,7 @@ func TestPipelineRunStatusConditions(t *testing.T) { } func TestPipelineRun_TaskRunref(t *testing.T) { - p := &v1alpha2.PipelineRun{ + p := &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "test-name", Namespace: "test-ns", @@ -71,7 +71,7 @@ func TestPipelineRun_TaskRunref(t *testing.T) { } expectTaskRunRef := corev1.ObjectReference{ - APIVersion: "tekton.dev/v1alpha2", + APIVersion: "tekton.dev/v1beta1", Kind: "TaskRun", Namespace: p.Namespace, Name: p.Name, @@ -83,7 +83,7 @@ func TestPipelineRun_TaskRunref(t *testing.T) { } func TestInitializeConditions(t *testing.T) { - p := &v1alpha2.PipelineRun{ + p := &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "test-name", Namespace: "test-ns", @@ -99,7 +99,7 @@ func TestInitializeConditions(t *testing.T) { t.Fatalf("PipelineRun StartTime not initialized correctly") } - p.Status.TaskRuns["fooTask"] = &v1alpha2.PipelineRunTaskRunStatus{} + p.Status.TaskRuns["fooTask"] = &v1beta1.PipelineRunTaskRunStatus{} p.Status.InitializeConditions() if len(p.Status.TaskRuns) != 1 { @@ -108,7 +108,7 @@ func TestInitializeConditions(t *testing.T) { } func TestPipelineRunIsDone(t *testing.T) { - pr := &v1alpha2.PipelineRun{} + pr := &v1beta1.PipelineRun{} foo := &apis.Condition{ Type: apis.ConditionSucceeded, Status: corev1.ConditionFalse, @@ -120,9 +120,9 @@ func TestPipelineRunIsDone(t *testing.T) { } func TestPipelineRunIsCancelled(t *testing.T) { - pr := &v1alpha2.PipelineRun{ - Spec: v1alpha2.PipelineRunSpec{ - Status: v1alpha2.PipelineRunSpecStatusCancelled, + pr := &v1beta1.PipelineRun{ + Spec: v1beta1.PipelineRunSpec{ + Status: v1beta1.PipelineRunSpecStatusCancelled, }, } if !pr.IsCancelled() { @@ -141,24 +141,24 @@ func TestPipelineRunKey(t *testing.T) { func TestPipelineRunHasStarted(t *testing.T) { params := []struct { name string - prStatus v1alpha2.PipelineRunStatus + prStatus v1beta1.PipelineRunStatus expectedValue bool }{{ name: "prWithNoStartTime", - prStatus: v1alpha2.PipelineRunStatus{}, + prStatus: v1beta1.PipelineRunStatus{}, expectedValue: false, }, { name: "prWithStartTime", - prStatus: v1alpha2.PipelineRunStatus{ - PipelineRunStatusFields: v1alpha2.PipelineRunStatusFields{ + prStatus: v1beta1.PipelineRunStatus{ + PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ StartTime: &metav1.Time{Time: time.Now()}, }, }, expectedValue: true, }, { name: "prWithZeroStartTime", - prStatus: v1alpha2.PipelineRunStatus{ - PipelineRunStatusFields: v1alpha2.PipelineRunStatusFields{ + prStatus: v1beta1.PipelineRunStatus{ + PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ StartTime: &metav1.Time{}, }, }, @@ -166,7 +166,7 @@ func TestPipelineRunHasStarted(t *testing.T) { }} for _, tc := range params { t.Run(tc.name, func(t *testing.T) { - pr := &v1alpha2.PipelineRun{ + pr := &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "prunname", Namespace: "testns", @@ -206,12 +206,12 @@ func TestPipelineRunHasTimedOut(t *testing.T) { for _, tc := range tcs { t.Run(t.Name(), func(t *testing.T) { - pr := &v1alpha2.PipelineRun{ + pr := &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "foo"}, - Spec: v1alpha2.PipelineRunSpec{ + Spec: v1beta1.PipelineRunSpec{ Timeout: &metav1.Duration{Duration: tc.timeout}, }, - Status: v1alpha2.PipelineRunStatus{PipelineRunStatusFields: v1alpha2.PipelineRunStatusFields{ + Status: v1beta1.PipelineRunStatus{PipelineRunStatusFields: v1beta1.PipelineRunStatusFields{ StartTime: &metav1.Time{Time: tc.starttime}, }}, } @@ -226,17 +226,17 @@ func TestPipelineRunHasTimedOut(t *testing.T) { func TestPipelineRunGetServiceAccountName(t *testing.T) { for _, tt := range []struct { name string - pr *v1alpha2.PipelineRun + pr *v1beta1.PipelineRun saNames map[string]string }{ { name: "default SA", - pr: &v1alpha2.PipelineRun{ + pr: &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "pr"}, - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "prs"}, + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "prs"}, ServiceAccountName: "defaultSA", - ServiceAccountNames: []v1alpha2.PipelineRunSpecServiceAccountName{{ + ServiceAccountNames: []v1beta1.PipelineRunSpecServiceAccountName{{ TaskName: "taskName", ServiceAccountName: "taskSA", }}, }, @@ -248,12 +248,12 @@ func TestPipelineRunGetServiceAccountName(t *testing.T) { }, { name: "mixed default SA", - pr: &v1alpha2.PipelineRun{ + pr: &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "pr"}, - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{Name: "prs"}, + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: "prs"}, ServiceAccountName: "defaultSA", - ServiceAccountNames: []v1alpha2.PipelineRunSpecServiceAccountName{{ + ServiceAccountNames: []v1beta1.PipelineRunSpecServiceAccountName{{ TaskName: "task1", ServiceAccountName: "task1SA", }, { TaskName: "task2", ServiceAccountName: "task2SA", diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_validation.go b/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_validation.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_validation.go index a3d0968dcc6..2d1a8ae53d5 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_validation.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/pipelinerun_validation_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go similarity index 78% rename from pkg/apis/pipeline/v1alpha2/pipelinerun_validation_test.go rename to pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go index 55f3aa92603..aa697fcd1ac 100644 --- a/pkg/apis/pipeline/v1alpha2/pipelinerun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -22,7 +22,7 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -31,12 +31,12 @@ import ( func TestPipelineRun_Invalidate(t *testing.T) { tests := []struct { name string - pr v1alpha2.PipelineRun + pr v1beta1.PipelineRun want *apis.FieldError }{ { name: "invalid pipelinerun", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "prmetaname", }, @@ -45,7 +45,7 @@ func TestPipelineRun_Invalidate(t *testing.T) { }, { name: "invalid pipelinerun metadata", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pipelinerun.name", }, @@ -56,23 +56,23 @@ func TestPipelineRun_Invalidate(t *testing.T) { }, }, { name: "no pipeline reference", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pipelinelineName", }, - Spec: v1alpha2.PipelineRunSpec{ + Spec: v1beta1.PipelineRunSpec{ ServiceAccountName: "foo", }, }, want: apis.ErrMissingField("spec.pipelineref.name, spec.pipelinespec"), }, { name: "negative pipeline timeout", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pipelinelineName", }, - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ Name: "prname", }, Timeout: &metav1.Duration{Duration: -48 * time.Hour}, @@ -95,28 +95,28 @@ func TestPipelineRun_Invalidate(t *testing.T) { func TestPipelineRun_Validate(t *testing.T) { tests := []struct { name string - pr v1alpha2.PipelineRun + pr v1beta1.PipelineRun }{ { name: "normal case", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pipelinelineName", }, - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ Name: "prname", }, }, }, }, { name: "no timeout", - pr: v1alpha2.PipelineRun{ + pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pipelinelineName", }, - Spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{ + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ Name: "prname", }, Timeout: &metav1.Duration{Duration: 0}, @@ -137,28 +137,28 @@ func TestPipelineRun_Validate(t *testing.T) { func TestPipelineRunSpec_Invalidate(t *testing.T) { tests := []struct { name string - spec v1alpha2.PipelineRunSpec + spec v1beta1.PipelineRunSpec wantErr *apis.FieldError }{{ name: "Empty pipelineSpec", - spec: v1alpha2.PipelineRunSpec{}, + spec: v1beta1.PipelineRunSpec{}, wantErr: apis.ErrMissingField("spec"), }, { name: "pipelineRef without Pipeline Name", - spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{}, + spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{}, }, wantErr: apis.ErrMissingField("spec.pipelineref.name", "spec.pipelinespec"), }, { name: "pipelineRef and pipelineSpec together", - spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{ + spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ Name: "pipelinerefname", }, - PipelineSpec: &v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ + PipelineSpec: &v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ Name: "mytask", - TaskRef: &v1alpha2.TaskRef{ + TaskRef: &v1beta1.TaskRef{ Name: "mytask", }, }}}, @@ -166,11 +166,11 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrDisallowedFields("spec.pipelinespec", "spec.pipelineref"), }, { name: "workspaces may only appear once", - spec: v1alpha2.PipelineRunSpec{ - PipelineRef: &v1alpha2.PipelineRef{ + spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{ Name: "pipelinerefname", }, - Workspaces: []v1alpha2.WorkspaceBinding{{ + Workspaces: []v1beta1.WorkspaceBinding{{ Name: "ws", EmptyDir: &corev1.EmptyDirVolumeSource{}, }, { @@ -196,14 +196,14 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { func TestPipelineRunSpec_Validate(t *testing.T) { tests := []struct { name string - spec v1alpha2.PipelineRunSpec + spec v1beta1.PipelineRunSpec }{{ name: "PipelineRun without pipelineRef", - spec: v1alpha2.PipelineRunSpec{ - PipelineSpec: &v1alpha2.PipelineSpec{ - Tasks: []v1alpha2.PipelineTask{{ + spec: v1beta1.PipelineRunSpec{ + PipelineSpec: &v1beta1.PipelineSpec{ + Tasks: []v1beta1.PipelineTask{{ Name: "mytask", - TaskRef: &v1alpha2.TaskRef{ + TaskRef: &v1beta1.TaskRef{ Name: "mytask", }, }}, diff --git a/pkg/apis/pipeline/v1alpha2/pod.go b/pkg/apis/pipeline/v1beta1/pod.go similarity index 97% rename from pkg/apis/pipeline/v1alpha2/pod.go rename to pkg/apis/pipeline/v1beta1/pod.go index 5066d433560..d4e16486e91 100644 --- a/pkg/apis/pipeline/v1alpha2/pod.go +++ b/pkg/apis/pipeline/v1beta1/pod.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" diff --git a/pkg/apis/pipeline/v1alpha2/pod_test.go b/pkg/apis/pipeline/v1beta1/pod_test.go similarity index 96% rename from pkg/apis/pipeline/v1alpha2/pod_test.go rename to pkg/apis/pipeline/v1beta1/pod_test.go index ab6dd76d66d..36525af19b9 100644 --- a/pkg/apis/pipeline/v1alpha2/pod_test.go +++ b/pkg/apis/pipeline/v1beta1/pod_test.go @@ -14,4 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test diff --git a/pkg/apis/pipeline/v1alpha2/register.go b/pkg/apis/pipeline/v1beta1/register.go similarity index 97% rename from pkg/apis/pipeline/v1alpha2/register.go rename to pkg/apis/pipeline/v1beta1/register.go index 025ac06044e..4d7de9d2245 100644 --- a/pkg/apis/pipeline/v1alpha2/register.go +++ b/pkg/apis/pipeline/v1beta1/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" @@ -24,7 +24,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: pipeline.GroupName, Version: "v1alpha2"} +var SchemeGroupVersion = schema.GroupVersion{Group: pipeline.GroupName, Version: "v1beta1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/pipeline/v1alpha2/resource_types.go b/pkg/apis/pipeline/v1beta1/resource_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/resource_types.go rename to pkg/apis/pipeline/v1beta1/resource_types.go index b579a245169..4d43b0105c1 100644 --- a/pkg/apis/pipeline/v1alpha2/resource_types.go +++ b/pkg/apis/pipeline/v1beta1/resource_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "fmt" diff --git a/pkg/apis/pipeline/v1alpha2/resource_types_test.go b/pkg/apis/pipeline/v1beta1/resource_types_test.go similarity index 73% rename from pkg/apis/pipeline/v1alpha2/resource_types_test.go rename to pkg/apis/pipeline/v1beta1/resource_types_test.go index 63a4c22f8e6..fe155a71b33 100644 --- a/pkg/apis/pipeline/v1alpha2/resource_types_test.go +++ b/pkg/apis/pipeline/v1beta1/resource_types_test.go @@ -11,13 +11,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" ) @@ -44,14 +44,14 @@ var ( type TestTaskModifier struct{} -func (tm *TestTaskModifier) GetStepsToPrepend() []v1alpha2.Step { - return []v1alpha2.Step{{ +func (tm *TestTaskModifier) GetStepsToPrepend() []v1beta1.Step { + return []v1beta1.Step{{ Container: prependStep, }} } -func (tm *TestTaskModifier) GetStepsToAppend() []v1alpha2.Step { - return []v1alpha2.Step{{ +func (tm *TestTaskModifier) GetStepsToAppend() []v1beta1.Step { + return []v1beta1.Step{{ Container: appendStep, }} } @@ -63,13 +63,13 @@ func (tm *TestTaskModifier) GetVolumes() []corev1.Volume { func TestApplyTaskModifier(t *testing.T) { testcases := []struct { name string - ts v1alpha2.TaskSpec + ts v1beta1.TaskSpec }{{ name: "success", - ts: v1alpha2.TaskSpec{}, + ts: v1beta1.TaskSpec{}, }, { name: "identical volume already added", - ts: v1alpha2.TaskSpec{ + ts: v1beta1.TaskSpec{ // Trying to add the same Volume that has already been added shouldn't be an error // and it should not be added twice Volumes: []corev1.Volume{volume}, @@ -77,12 +77,12 @@ func TestApplyTaskModifier(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - if err := v1alpha2.ApplyTaskModifier(&tc.ts, &TestTaskModifier{}); err != nil { + if err := v1beta1.ApplyTaskModifier(&tc.ts, &TestTaskModifier{}); err != nil { t.Fatalf("Did not expect error modifying TaskSpec but got %v", err) } - expectedTaskSpec := v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{ + expectedTaskSpec := v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{ Container: prependStep, }, { Container: appendStep, @@ -102,30 +102,30 @@ func TestApplyTaskModifier(t *testing.T) { func TestApplyTaskModifier_AlreadyAdded(t *testing.T) { testcases := []struct { name string - ts v1alpha2.TaskSpec + ts v1beta1.TaskSpec }{{ name: "prepend already added", - ts: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: prependStep}}, + ts: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: prependStep}}, }, }, { name: "append already added", - ts: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: appendStep}}, + ts: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: appendStep}}, }, }, { name: "both steps already added", - ts: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: prependStep}, {Container: appendStep}}, + ts: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: prependStep}, {Container: appendStep}}, }, }, { name: "both steps already added reverse order", - ts: v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: appendStep}, {Container: prependStep}}, + ts: v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: appendStep}, {Container: prependStep}}, }, }, { name: "volume with same name but diff content already added", - ts: v1alpha2.TaskSpec{ + ts: v1beta1.TaskSpec{ Volumes: []corev1.Volume{{ Name: "magic-volume", VolumeSource: corev1.VolumeSource{ @@ -136,7 +136,7 @@ func TestApplyTaskModifier_AlreadyAdded(t *testing.T) { }} for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - if err := v1alpha2.ApplyTaskModifier(&tc.ts, &TestTaskModifier{}); err == nil { + if err := v1beta1.ApplyTaskModifier(&tc.ts, &TestTaskModifier{}); err == nil { t.Errorf("Expected error when applying values already added but got none") } }) diff --git a/pkg/apis/pipeline/v1alpha2/resource_types_validation.go b/pkg/apis/pipeline/v1beta1/resource_types_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/resource_types_validation.go rename to pkg/apis/pipeline/v1beta1/resource_types_validation.go index e5d658ffc23..d49acfce4d4 100644 --- a/pkg/apis/pipeline/v1alpha2/resource_types_validation.go +++ b/pkg/apis/pipeline/v1beta1/resource_types_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/substitution.go b/pkg/apis/pipeline/v1beta1/substitution.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/substitution.go rename to pkg/apis/pipeline/v1beta1/substitution.go index 8d191b6ded2..e806b988a44 100644 --- a/pkg/apis/pipeline/v1alpha2/substitution.go +++ b/pkg/apis/pipeline/v1beta1/substitution.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "fmt" diff --git a/pkg/apis/pipeline/v1alpha2/task_conversion.go b/pkg/apis/pipeline/v1beta1/task_conversion.go similarity index 84% rename from pkg/apis/pipeline/v1alpha2/task_conversion.go rename to pkg/apis/pipeline/v1beta1/task_conversion.go index 775a2295165..54b5ee318bf 100644 --- a/pkg/apis/pipeline/v1alpha2/task_conversion.go +++ b/pkg/apis/pipeline/v1beta1/task_conversion.go @@ -15,7 +15,7 @@ limitations under the License. */ // nolint: golint -package v1alpha2 +package v1beta1 import ( "context" @@ -28,10 +28,10 @@ var _ apis.Convertible = (*Task)(nil) // ConvertUp implements api.Convertible func (source *Task) ConvertUp(ctx context.Context, sink apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest known version, got: %T", sink) + return fmt.Errorf("v1beta1 is the highest known version, got: %T", sink) } // ConvertDown implements api.Convertible func (sink *Task) ConvertDown(ctx context.Context, source apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest know version, got: %T", source) + return fmt.Errorf("v1beta1 is the highest know version, got: %T", source) } diff --git a/pkg/apis/pipeline/v1alpha2/task_conversion_test.go b/pkg/apis/pipeline/v1beta1/task_conversion_test.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/task_conversion_test.go rename to pkg/apis/pipeline/v1beta1/task_conversion_test.go index 947f795148e..84db635105b 100644 --- a/pkg/apis/pipeline/v1alpha2/task_conversion_test.go +++ b/pkg/apis/pipeline/v1beta1/task_conversion_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/task_defaults.go b/pkg/apis/pipeline/v1beta1/task_defaults.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/task_defaults.go rename to pkg/apis/pipeline/v1beta1/task_defaults.go index f1d1ee1e8b1..c0399f34418 100644 --- a/pkg/apis/pipeline/v1alpha2/task_defaults.go +++ b/pkg/apis/pipeline/v1beta1/task_defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/task_interface.go b/pkg/apis/pipeline/v1beta1/task_interface.go similarity index 97% rename from pkg/apis/pipeline/v1alpha2/task_interface.go rename to pkg/apis/pipeline/v1beta1/task_interface.go index ecb8adeade4..c9507777c5a 100644 --- a/pkg/apis/pipeline/v1alpha2/task_interface.go +++ b/pkg/apis/pipeline/v1beta1/task_interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/pipeline/v1alpha2/task_types.go b/pkg/apis/pipeline/v1beta1/task_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/task_types.go rename to pkg/apis/pipeline/v1beta1/task_types.go index 0d1cd3cfe2c..81b290713c1 100644 --- a/pkg/apis/pipeline/v1alpha2/task_types.go +++ b/pkg/apis/pipeline/v1beta1/task_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( corev1 "k8s.io/api/core/v1" diff --git a/pkg/apis/pipeline/v1alpha2/task_validation.go b/pkg/apis/pipeline/v1beta1/task_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/task_validation.go rename to pkg/apis/pipeline/v1beta1/task_validation.go index bbbf3005063..3bf84cbbd09 100644 --- a/pkg/apis/pipeline/v1alpha2/task_validation.go +++ b/pkg/apis/pipeline/v1beta1/task_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/task_validation_test.go b/pkg/apis/pipeline/v1beta1/task_validation_test.go similarity index 79% rename from pkg/apis/pipeline/v1alpha2/task_validation_test.go rename to pkg/apis/pipeline/v1beta1/task_validation_test.go index d0a62ab303e..df105ff84d1 100644 --- a/pkg/apis/pipeline/v1alpha2/task_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/task_validation_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -22,43 +22,43 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" "knative.dev/pkg/apis" ) -var validResource = v1alpha2.TaskResource{ - ResourceDeclaration: v1alpha2.ResourceDeclaration{ +var validResource = v1beta1.TaskResource{ + ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "source", Type: "git", }, } -var invalidResource = v1alpha2.TaskResource{ - ResourceDeclaration: v1alpha2.ResourceDeclaration{ +var invalidResource = v1beta1.TaskResource{ + ResourceDeclaration: v1beta1.ResourceDeclaration{ Name: "source", Type: "what", }, } -var validSteps = []v1alpha2.Step{{Container: corev1.Container{ +var validSteps = []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", }}} -var invalidSteps = []v1alpha2.Step{{Container: corev1.Container{ +var invalidSteps = []v1beta1.Step{{Container: corev1.Container{ Name: "replaceImage", Image: "myimage", }}} func TestTaskSpecValidate(t *testing.T) { type fields struct { - Params []v1alpha2.ParamSpec - Resources *v1alpha2.TaskResources - Steps []v1alpha2.Step + Params []v1beta1.ParamSpec + Resources *v1beta1.TaskResources + Steps []v1beta1.Step StepTemplate *corev1.Container - Workspaces []v1alpha2.WorkspaceDeclaration + Workspaces []v1beta1.WorkspaceDeclaration } tests := []struct { name string @@ -66,7 +66,7 @@ func TestTaskSpecValidate(t *testing.T) { }{{ name: "unnamed steps", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "myimage", }}, {Container: corev1.Container{ Image: "myotherimage", @@ -75,23 +75,23 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid input resources", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{validResource}, + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{validResource}, }, Steps: validSteps, }, }, { name: "valid output resources", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{validResource}, + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{validResource}, }, Steps: validSteps, }, }, { name: "valid params type implied", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "task", Description: "param", Default: builder.ArrayOrString("default"), @@ -101,9 +101,9 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid params type explicit", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "task", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "param", Default: builder.ArrayOrString("default"), }}, @@ -112,12 +112,12 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid template variable", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", }, { Name: "foo-is-baz", }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "url", Args: []string{"--flag=$(params.baz) && $(params.foo-is-baz)"}, @@ -127,14 +127,14 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid array template variable", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }, { Name: "foo-is-baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", Command: []string{"$(params.foo-is-baz)"}, @@ -145,14 +145,14 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid star array template variable", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }, { Name: "foo-is-baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", Command: []string{"$(params.foo-is-baz)"}, @@ -163,7 +163,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "step template included in validation", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "astep", Command: []string{"echo"}, Args: []string{"hello"}, @@ -175,7 +175,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid step with script", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "my-image", }, @@ -187,7 +187,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid step with script and args", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "my-image", Args: []string{"arg"}, @@ -200,7 +200,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid step with volumeMount under /tekton/home", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -211,13 +211,13 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid workspace", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "my-image", Args: []string{"arg"}, }, }}, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "foo-workspace", Description: "my great workspace", MountPath: "some/path", @@ -226,7 +226,7 @@ func TestTaskSpecValidate(t *testing.T) { }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ts := &v1alpha2.TaskSpec{ + ts := &v1beta1.TaskSpec{ Params: tt.fields.Params, Resources: tt.fields.Resources, Steps: tt.fields.Steps, @@ -244,12 +244,12 @@ func TestTaskSpecValidate(t *testing.T) { func TestTaskSpecValidateError(t *testing.T) { type fields struct { - Params []v1alpha2.ParamSpec - Resources *v1alpha2.TaskResources - Steps []v1alpha2.Step + Params []v1beta1.ParamSpec + Resources *v1beta1.TaskResources + Steps []v1beta1.Step Volumes []corev1.Volume StepTemplate *corev1.Container - Workspaces []v1alpha2.WorkspaceDeclaration + Workspaces []v1beta1.WorkspaceDeclaration } tests := []struct { name string @@ -264,9 +264,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "no step", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "validparam", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "parameter", Default: builder.ArrayOrString("default"), }}, @@ -278,8 +278,8 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "invalid input resource", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{invalidResource}, + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{invalidResource}, }, Steps: validSteps, }, @@ -290,8 +290,8 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "one invalid input resource", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{validResource, invalidResource}, + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{validResource, invalidResource}, }, Steps: validSteps, }, @@ -302,9 +302,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "duplicated inputs resources", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{validResource, validResource}, - Outputs: []v1alpha2.TaskResource{validResource}, + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{validResource, validResource}, + Outputs: []v1beta1.TaskResource{validResource}, }, Steps: validSteps, }, @@ -315,8 +315,8 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "invalid output resource", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{invalidResource}, + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{invalidResource}, }, Steps: validSteps, }, @@ -327,8 +327,8 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "one invalid output resource", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Outputs: []v1alpha2.TaskResource{validResource, invalidResource}, + Resources: &v1beta1.TaskResources{ + Outputs: []v1beta1.TaskResource{validResource, invalidResource}, }, Steps: validSteps, }, @@ -339,9 +339,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "duplicated outputs resources", fields: fields{ - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{validResource}, - Outputs: []v1alpha2.TaskResource{validResource, validResource}, + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{validResource}, + Outputs: []v1beta1.TaskResource{validResource, validResource}, }, Steps: validSteps, }, @@ -352,9 +352,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "invalid param type", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "validparam", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "parameter", Default: builder.ArrayOrString("default"), }, { @@ -372,9 +372,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "param mismatching default/type 1", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "task", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, Description: "param", Default: builder.ArrayOrString("default"), }}, @@ -387,9 +387,9 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "param mismatching default/type 2", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "task", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "param", Default: builder.ArrayOrString("default", "array"), }}, @@ -402,13 +402,13 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "invalid step", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "validparam", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, Description: "parameter", Default: builder.ArrayOrString("default"), }}, - Steps: []v1alpha2.Step{}, + Steps: []v1beta1.Step{}, }, expectedError: apis.FieldError{ Message: "missing field(s)", @@ -427,7 +427,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent param variable", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", Args: []string{"--flag=$(params.inexistent)"}, @@ -440,14 +440,14 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "array used in unaccepted field", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }, { Name: "foo-is-baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "$(params.baz)", Command: []string{"$(params.foo-is-baz)"}, @@ -462,14 +462,14 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "array not properly isolated", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }, { Name: "foo-is-baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -484,14 +484,14 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "array star not properly isolated", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }, { Name: "foo-is-baz", - Type: v1alpha2.ParamTypeArray, + Type: v1beta1.ParamTypeArray, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -506,20 +506,20 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inferred array not properly isolated", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Default: &v1alpha2.ArrayOrString{ - Type: v1alpha2.ParamTypeArray, + Default: &v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeArray, ArrayVal: []string{"implied", "array", "type"}, }, }, { Name: "foo-is-baz", - Default: &v1alpha2.ArrayOrString{ - Type: v1alpha2.ParamTypeArray, + Default: &v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeArray, ArrayVal: []string{"implied", "array", "type"}, }, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -534,20 +534,20 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inferred array star not properly isolated", fields: fields{ - Params: []v1alpha2.ParamSpec{{ + Params: []v1beta1.ParamSpec{{ Name: "baz", - Default: &v1alpha2.ArrayOrString{ - Type: v1alpha2.ParamTypeArray, + Default: &v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeArray, ArrayVal: []string{"implied", "array", "type"}, }, }, { Name: "foo-is-baz", - Default: &v1alpha2.ArrayOrString{ - Type: v1alpha2.ParamTypeArray, + Default: &v1beta1.ArrayOrString{ + Type: v1beta1.ParamTypeArray, ArrayVal: []string{"implied", "array", "type"}, }, }}, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -562,14 +562,14 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "Inexistent param variable with existing", fields: fields{ - Params: []v1alpha2.ParamSpec{ + Params: []v1beta1.ParamSpec{ { Name: "foo", Description: "param", Default: builder.ArrayOrString("default"), }, }, - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", Args: []string{"$(params.foo) && $(params.inexistent)"}, @@ -596,7 +596,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step with script and command", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "myimage", Command: []string{"command"}, @@ -611,7 +611,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mounts under /tekton/", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -626,7 +626,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mount name starts with tekton-internal-", fields: fields{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "tekton-internal-foo", @@ -642,7 +642,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "declared workspaces names are not unique", fields: fields{ Steps: validSteps, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "same-workspace", }, { Name: "same-workspace", @@ -656,7 +656,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "declared workspaces clash with each other", fields: fields{ Steps: validSteps, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "some-workspace", MountPath: "/foo", }, { @@ -671,7 +671,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace mount path already in volumeMounts", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "myimage", Command: []string{"command"}, @@ -681,7 +681,7 @@ func TestTaskSpecValidateError(t *testing.T) { }}, }, }}, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "some-workspace", MountPath: "/foo", }}, @@ -693,7 +693,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace default mount path already in volumeMounts", fields: fields{ - Steps: []v1alpha2.Step{{ + Steps: []v1beta1.Step{{ Container: corev1.Container{ Image: "myimage", Command: []string{"command"}, @@ -703,7 +703,7 @@ func TestTaskSpecValidateError(t *testing.T) { }}, }, }}, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "some-workspace", }}, }, @@ -721,7 +721,7 @@ func TestTaskSpecValidateError(t *testing.T) { }}, }, Steps: validSteps, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "some-workspace", MountPath: "/foo", }}, @@ -740,7 +740,7 @@ func TestTaskSpecValidateError(t *testing.T) { }}, }, Steps: validSteps, - Workspaces: []v1alpha2.WorkspaceDeclaration{{ + Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "some-workspace", }}, }, @@ -751,7 +751,7 @@ func TestTaskSpecValidateError(t *testing.T) { }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ts := &v1alpha2.TaskSpec{ + ts := &v1beta1.TaskSpec{ Params: tt.fields.Params, Resources: tt.fields.Resources, Steps: tt.fields.Steps, diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_conversion.go b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go similarity index 84% rename from pkg/apis/pipeline/v1alpha2/taskrun_conversion.go rename to pkg/apis/pipeline/v1beta1/taskrun_conversion.go index c02993167de..62598644134 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go @@ -15,7 +15,7 @@ limitations under the License. */ // nolint: golint -package v1alpha2 +package v1beta1 import ( "context" @@ -28,10 +28,10 @@ var _ apis.Convertible = (*TaskRun)(nil) // ConvertUp implements api.Convertible func (source *TaskRun) ConvertUp(ctx context.Context, sink apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest known version, got: %T", sink) + return fmt.Errorf("v1beta1 is the highest known version, got: %T", sink) } // ConvertDown implements api.Convertible func (sink *TaskRun) ConvertDown(ctx context.Context, source apis.Convertible) error { - return fmt.Errorf("v1alpha2 is the highest know version, got: %T", source) + return fmt.Errorf("v1beta1 is the highest know version, got: %T", source) } diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_conversion_test.go b/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go similarity index 98% rename from pkg/apis/pipeline/v1alpha2/taskrun_conversion_test.go rename to pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go index 01fa6ea729f..504722c2390 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_conversion_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_conversion_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_defaults.go b/pkg/apis/pipeline/v1beta1/taskrun_defaults.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/taskrun_defaults.go rename to pkg/apis/pipeline/v1beta1/taskrun_defaults.go index 8a9932f1a93..be5a012aedd 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_defaults.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_defaults.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_defaults_test.go b/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go similarity index 67% rename from pkg/apis/pipeline/v1alpha2/taskrun_defaults_test.go rename to pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go index b8a687d26fe..8dbd19384eb 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_defaults_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_defaults_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -24,7 +24,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/config" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -38,55 +38,55 @@ var ( func TestTaskRunSpec_SetDefaults(t *testing.T) { cases := []struct { desc string - trs *v1alpha2.TaskRunSpec - want *v1alpha2.TaskRunSpec + trs *v1beta1.TaskRunSpec + want *v1beta1.TaskRunSpec }{{ desc: "taskref is nil", - trs: &v1alpha2.TaskRunSpec{ + trs: &v1beta1.TaskRunSpec{ TaskRef: nil, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, - want: &v1alpha2.TaskRunSpec{ + want: &v1beta1.TaskRunSpec{ TaskRef: nil, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, }, { desc: "taskref kind is empty", - trs: &v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{}, + trs: &v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{}, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, - want: &v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Kind: v1alpha2.NamespacedTaskKind}, + want: &v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Kind: v1beta1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: 500 * time.Millisecond}, }, }, { desc: "timeout is nil", - trs: &v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Kind: v1alpha2.ClusterTaskKind}, + trs: &v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Kind: v1beta1.ClusterTaskKind}, }, - want: &v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Kind: v1alpha2.ClusterTaskKind}, + want: &v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Kind: v1beta1.ClusterTaskKind}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "pod template is nil", - trs: &v1alpha2.TaskRunSpec{}, - want: &v1alpha2.TaskRunSpec{ + trs: &v1beta1.TaskRunSpec{}, + want: &v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, { desc: "pod template is not nil", - trs: &v1alpha2.TaskRunSpec{ - PodTemplate: &v1alpha2.PodTemplate{ + trs: &v1beta1.TaskRunSpec{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, }, }, - want: &v1alpha2.TaskRunSpec{ + want: &v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, - PodTemplate: &v1alpha2.PodTemplate{ + PodTemplate: &v1beta1.PodTemplate{ NodeSelector: map[string]string{ "label": "value", }, @@ -94,18 +94,18 @@ func TestTaskRunSpec_SetDefaults(t *testing.T) { }, }, { desc: "embedded taskSpec", - trs: &v1alpha2.TaskRunSpec{ - TaskSpec: &v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + trs: &v1beta1.TaskRunSpec{ + TaskSpec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-name", }}, }, }, - want: &v1alpha2.TaskRunSpec{ - TaskSpec: &v1alpha2.TaskSpec{ - Params: []v1alpha2.ParamSpec{{ + want: &v1beta1.TaskRunSpec{ + TaskSpec: &v1beta1.TaskSpec{ + Params: []v1beta1.ParamSpec{{ Name: "param-name", - Type: v1alpha2.ParamTypeString, + Type: v1beta1.ParamTypeString, }}, }, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, @@ -126,54 +126,54 @@ func TestTaskRunSpec_SetDefaults(t *testing.T) { func TestTaskRunDefaulting(t *testing.T) { tests := []struct { name string - in *v1alpha2.TaskRun - want *v1alpha2.TaskRun + in *v1beta1.TaskRun + want *v1beta1.TaskRun wc func(context.Context) context.Context }{{ name: "empty no context", - in: &v1alpha2.TaskRun{}, - want: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ + in: &v1beta1.TaskRun{}, + want: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, }, { name: "TaskRef default to namespace kind", - in: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo"}, + in: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo"}, }, }, - want: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo", Kind: v1alpha2.NamespacedTaskKind}, + want: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo", Kind: v1beta1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, }, { name: "TaskRef upgrade context", - in: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo"}, + in: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo"}, }, }, - want: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo", Kind: v1alpha2.NamespacedTaskKind}, + want: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo", Kind: v1beta1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, }, }, wc: contexts.WithUpgradeViaDefaulting, }, { name: "TaskRef default config context", - in: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo"}, + in: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo"}, }, }, - want: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo", Kind: v1alpha2.NamespacedTaskKind}, + want: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo", Kind: v1beta1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, }, }, @@ -191,14 +191,14 @@ func TestTaskRunDefaulting(t *testing.T) { }, }, { name: "TaskRef default config context with SA", - in: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo"}, + in: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo"}, }, }, - want: &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "foo", Kind: v1alpha2.NamespacedTaskKind}, + want: &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "foo", Kind: v1beta1.NamespacedTaskKind}, Timeout: &metav1.Duration{Duration: 5 * time.Minute}, ServiceAccountName: "tekton", }, diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_types.go b/pkg/apis/pipeline/v1beta1/taskrun_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/taskrun_types.go rename to pkg/apis/pipeline/v1beta1/taskrun_types.go index 41511db13ed..c6ee26fa05f 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_types.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "fmt" diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_types_test.go b/pkg/apis/pipeline/v1beta1/taskrun_types_test.go similarity index 86% rename from pkg/apis/pipeline/v1alpha2/taskrun_types_test.go rename to pkg/apis/pipeline/v1beta1/taskrun_types_test.go index 7fc9e2d1d69..d8de391bdf4 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_types_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_types_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "fmt" @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -31,7 +31,7 @@ import ( ) func TestTaskRun_GetBuildPodRef(t *testing.T) { - tr := &v1alpha2.TaskRun{ + tr := &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Namespace: "testns", Name: "taskrunname", @@ -50,11 +50,11 @@ func TestTaskRun_GetBuildPodRef(t *testing.T) { func TestTaskRun_GetPipelineRunPVCName(t *testing.T) { tests := []struct { name string - tr *v1alpha2.TaskRun + tr *v1beta1.TaskRun expectedPVCName string }{{ name: "invalid owner reference", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{{ Kind: "SomeOtherOwner", @@ -65,7 +65,7 @@ func TestTaskRun_GetPipelineRunPVCName(t *testing.T) { expectedPVCName: "", }, { name: "valid pipelinerun owner", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{{ Kind: "PipelineRun", @@ -90,11 +90,11 @@ func TestTaskRun_GetPipelineRunPVCName(t *testing.T) { func TestTaskRun_HasPipelineRun(t *testing.T) { tests := []struct { name string - tr *v1alpha2.TaskRun + tr *v1beta1.TaskRun want bool }{{ name: "invalid owner reference", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{{ Kind: "SomeOtherOwner", @@ -105,7 +105,7 @@ func TestTaskRun_HasPipelineRun(t *testing.T) { want: false, }, { name: "valid pipelinerun owner", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{{ Kind: "PipelineRun", @@ -125,8 +125,8 @@ func TestTaskRun_HasPipelineRun(t *testing.T) { } func TestTaskRunIsDone(t *testing.T) { - tr := &v1alpha2.TaskRun{ - Status: v1alpha2.TaskRunStatus{ + tr := &v1beta1.TaskRun{ + Status: v1beta1.TaskRunStatus{ Status: duckv1beta1.Status{ Conditions: []apis.Condition{{ Type: apis.ConditionSucceeded, @@ -141,9 +141,9 @@ func TestTaskRunIsDone(t *testing.T) { } func TestTaskRunIsCancelled(t *testing.T) { - tr := &v1alpha2.TaskRun{ - Spec: v1alpha2.TaskRunSpec{ - Status: v1alpha2.TaskRunSpecStatusCancelled, + tr := &v1beta1.TaskRun{ + Spec: v1beta1.TaskRunSpec{ + Status: v1beta1.TaskRunSpecStatusCancelled, }, } if !tr.IsCancelled() { @@ -152,7 +152,7 @@ func TestTaskRunIsCancelled(t *testing.T) { } func TestTaskRunKey(t *testing.T) { - tr := &v1alpha2.TaskRun{ + tr := &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Name: "taskrunname", }, @@ -166,24 +166,24 @@ func TestTaskRunKey(t *testing.T) { func TestTaskRunHasStarted(t *testing.T) { params := []struct { name string - trStatus v1alpha2.TaskRunStatus + trStatus v1beta1.TaskRunStatus expectedValue bool }{{ name: "trWithNoStartTime", - trStatus: v1alpha2.TaskRunStatus{}, + trStatus: v1beta1.TaskRunStatus{}, expectedValue: false, }, { name: "trWithStartTime", - trStatus: v1alpha2.TaskRunStatus{ - TaskRunStatusFields: v1alpha2.TaskRunStatusFields{ + trStatus: v1beta1.TaskRunStatus{ + TaskRunStatusFields: v1beta1.TaskRunStatusFields{ StartTime: &metav1.Time{Time: time.Now()}, }, }, expectedValue: true, }, { name: "trWithZeroStartTime", - trStatus: v1alpha2.TaskRunStatus{ - TaskRunStatusFields: v1alpha2.TaskRunStatusFields{ + trStatus: v1beta1.TaskRunStatus{ + TaskRunStatusFields: v1beta1.TaskRunStatusFields{ StartTime: &metav1.Time{}, }, }, @@ -191,7 +191,7 @@ func TestTaskRunHasStarted(t *testing.T) { }} for _, tc := range params { t.Run(tc.name, func(t *testing.T) { - tr := &v1alpha2.TaskRun{} + tr := &v1beta1.TaskRun{} tr.Status = tc.trStatus if tr.HasStarted() != tc.expectedValue { t.Fatalf("Expected taskrun HasStarted() to return %t but got %t", tc.expectedValue, tr.HasStarted()) @@ -203,13 +203,13 @@ func TestTaskRunHasStarted(t *testing.T) { func TestTaskRunIsOfPipelinerun(t *testing.T) { tests := []struct { name string - tr *v1alpha2.TaskRun + tr *v1beta1.TaskRun expectedValue bool expetectedPipeline string expetectedPipelineRun string }{{ name: "yes", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ pipeline.GroupName + pipeline.PipelineLabelKey: "pipeline", @@ -222,7 +222,7 @@ func TestTaskRunIsOfPipelinerun(t *testing.T) { expetectedPipelineRun: "pipelinerun", }, { name: "no", - tr: &v1alpha2.TaskRun{}, + tr: &v1beta1.TaskRun{}, expectedValue: false, }} diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_validation.go b/pkg/apis/pipeline/v1beta1/taskrun_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/taskrun_validation.go rename to pkg/apis/pipeline/v1beta1/taskrun_validation.go index 772584251ad..d76cdbb72ef 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_validation.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/taskrun_validation_test.go b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go similarity index 65% rename from pkg/apis/pipeline/v1alpha2/taskrun_validation_test.go rename to pkg/apis/pipeline/v1beta1/taskrun_validation_test.go index 9dddc41741a..0712fda9a1d 100644 --- a/pkg/apis/pipeline/v1alpha2/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "context" @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" @@ -34,15 +34,15 @@ import ( func TestTaskRun_Invalidate(t *testing.T) { tests := []struct { name string - task *v1alpha2.TaskRun + task *v1beta1.TaskRun want *apis.FieldError }{{ name: "invalid taskspec", - task: &v1alpha2.TaskRun{}, + task: &v1beta1.TaskRun{}, want: apis.ErrMissingField("spec"), }, { name: "invalid taskrun metadata", - task: &v1alpha2.TaskRun{ + task: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Name: "task.name", }, @@ -63,12 +63,12 @@ func TestTaskRun_Invalidate(t *testing.T) { } func TestTaskRun_Validate(t *testing.T) { - tr := &v1alpha2.TaskRun{ + tr := &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{ Name: "taskrname", }, - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "taskrefname"}, + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "taskrefname"}, }, } if err := tr.Validate(context.Background()); err != nil { @@ -79,15 +79,15 @@ func TestTaskRun_Validate(t *testing.T) { func TestTaskRun_Workspaces_Invalid(t *testing.T) { tests := []struct { name string - tr *v1alpha2.TaskRun + tr *v1beta1.TaskRun wantErr *apis.FieldError }{{ name: "make sure WorkspaceBinding validation invoked", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "taskname"}, - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "task"}, - Workspaces: []v1alpha2.WorkspaceBinding{{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "task"}, + Workspaces: []v1beta1.WorkspaceBinding{{ Name: "workspace", PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{}, }}, @@ -96,11 +96,11 @@ func TestTaskRun_Workspaces_Invalid(t *testing.T) { wantErr: apis.ErrMissingField("workspace.persistentvolumeclaim.claimname"), }, { name: "bind same workspace twice", - tr: &v1alpha2.TaskRun{ + tr: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "taskname"}, - Spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{Name: "task"}, - Workspaces: []v1alpha2.WorkspaceBinding{{ + Spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{Name: "task"}, + Workspaces: []v1beta1.WorkspaceBinding{{ Name: "workspace", EmptyDir: &corev1.EmptyDirVolumeSource{}, }, { @@ -127,26 +127,26 @@ func TestTaskRun_Workspaces_Invalid(t *testing.T) { func TestTaskRunSpec_Invalidate(t *testing.T) { tests := []struct { name string - spec v1alpha2.TaskRunSpec + spec v1beta1.TaskRunSpec wantErr *apis.FieldError }{{ name: "invalid taskspec", - spec: v1alpha2.TaskRunSpec{}, + spec: v1beta1.TaskRunSpec{}, wantErr: apis.ErrMissingField("spec"), }, { name: "invalid taskref name", - spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{}, + spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{}, }, wantErr: apis.ErrMissingField("spec.taskref.name, spec.taskspec"), }, { name: "invalid taskref and taskspec together", - spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{ + spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{ Name: "taskrefname", }, - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -155,8 +155,8 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrDisallowedFields("spec.taskspec", "spec.taskref"), }, { name: "negative pipeline timeout", - spec: v1alpha2.TaskRunSpec{ - TaskRef: &v1alpha2.TaskRef{ + spec: v1beta1.TaskRunSpec{ + TaskRef: &v1beta1.TaskRef{ Name: "taskrefname", }, Timeout: &metav1.Duration{Duration: -48 * time.Hour}, @@ -164,9 +164,9 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("-48h0m0s should be >= 0", "spec.timeout"), }, { name: "invalid taskspec", - spec: v1alpha2.TaskRunSpec{ - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + spec: v1beta1.TaskRunSpec{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "invalid-name-with-$weird-char/%", Image: "myimage", }}}, @@ -179,7 +179,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }, }, { name: "invalid params", - spec: v1alpha2.TaskRunSpec{ + spec: v1beta1.TaskRunSpec{ Params: []v1alpha1.Param{{ Name: "name", Value: *builder.ArrayOrString("value"), @@ -187,7 +187,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { Name: "name", Value: *builder.ArrayOrString("value"), }}, - TaskRef: &v1alpha2.TaskRef{Name: "mytask"}, + TaskRef: &v1beta1.TaskRef{Name: "mytask"}, }, wantErr: apis.ErrMultipleOneOf("spec.inputs.params"), }} @@ -204,12 +204,12 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { func TestTaskRunSpec_Validate(t *testing.T) { tests := []struct { name string - spec v1alpha2.TaskRunSpec + spec v1beta1.TaskRunSpec }{{ name: "taskspec without a taskRef", - spec: v1alpha2.TaskRunSpec{ - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + spec: v1beta1.TaskRunSpec{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -217,10 +217,10 @@ func TestTaskRunSpec_Validate(t *testing.T) { }, }, { name: "no timeout", - spec: v1alpha2.TaskRunSpec{ + spec: v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: 0}, - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -228,14 +228,14 @@ func TestTaskRunSpec_Validate(t *testing.T) { }, }, { name: "parameters", - spec: v1alpha2.TaskRunSpec{ + spec: v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: 0}, - Params: []v1alpha2.Param{{ + Params: []v1beta1.Param{{ Name: "name", Value: *builder.ArrayOrString("value"), }}, - TaskSpec: &v1alpha2.TaskSpec{ - Steps: []v1alpha2.Step{{Container: corev1.Container{ + TaskSpec: &v1beta1.TaskSpec{ + Steps: []v1beta1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -254,15 +254,15 @@ func TestTaskRunSpec_Validate(t *testing.T) { func TestResources_Validate(t *testing.T) { tests := []struct { name string - resources *v1alpha2.TaskRunResources + resources *v1beta1.TaskRunResources }{{ name: "no resources is valid", }, { name: "inputs only", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, Name: "workspace", @@ -271,17 +271,17 @@ func TestResources_Validate(t *testing.T) { }, }, { name: "multiple inputs only", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource1", }, Name: "workspace1", }, }, { - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource2", }, Name: "workspace2", @@ -290,10 +290,10 @@ func TestResources_Validate(t *testing.T) { }, }, { name: "outputs only", - resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, Name: "workspace", @@ -302,17 +302,17 @@ func TestResources_Validate(t *testing.T) { }, }, { name: "multiple outputs only", - resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource1", }, Name: "workspace1", }, }, { - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource2", }, Name: "workspace2", @@ -321,18 +321,18 @@ func TestResources_Validate(t *testing.T) { }, }, { name: "inputs and outputs", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, Name: "workspace", }, }}, - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, Name: "workspace", @@ -353,21 +353,21 @@ func TestResources_Validate(t *testing.T) { func TestResources_Invalidate(t *testing.T) { tests := []struct { name string - resources *v1alpha2.TaskRunResources + resources *v1beta1.TaskRunResources wantErr *apis.FieldError }{{ name: "duplicate task inputs", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource1", }, Name: "workspace", }, }, { - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource2", }, Name: "workspace", @@ -377,14 +377,14 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("spec.resources.inputs.name"), }, { name: "duplicate resource ref and resource spec", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, ResourceSpec: &resource.PipelineResourceSpec{ - Type: v1alpha2.PipelineResourceTypeGit, + Type: v1beta1.PipelineResourceTypeGit, }, Name: "resource-dup", }, @@ -393,9 +393,9 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrDisallowedFields("spec.resources.inputs.name.resourceRef", "spec.resources.inputs.name.resourceSpec"), }, { name: "invalid resource spec", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ ResourceSpec: &resource.PipelineResourceSpec{ Type: "non-existent", }, @@ -406,9 +406,9 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("spec.type", "non-existent"), }, { name: "no resource ref", // and resource spec - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "resource", }, }}, @@ -416,17 +416,17 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrMissingField("spec.resources.inputs.name.resourceRef", "spec.resources.inputs.name.resourceSpec"), }, { name: "duplicate task outputs", - resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource1", }, Name: "workspace", }, }, { - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource2", }, Name: "workspace", @@ -436,14 +436,14 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("spec.resources.outputs.name"), }, { name: "duplicate resource ref and resource spec", - resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ - ResourceRef: &v1alpha2.PipelineResourceRef{ + resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ + ResourceRef: &v1beta1.PipelineResourceRef{ Name: "testresource", }, ResourceSpec: &resource.PipelineResourceSpec{ - Type: v1alpha2.PipelineResourceTypeGit, + Type: v1beta1.PipelineResourceTypeGit, }, Name: "resource-dup", }, @@ -452,9 +452,9 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrDisallowedFields("spec.resources.outputs.name.resourceRef", "spec.resources.outputs.name.resourceSpec"), }, { name: "invalid resource spec", - resources: &v1alpha2.TaskRunResources{ - Inputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + resources: &v1beta1.TaskRunResources{ + Inputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ ResourceSpec: &resource.PipelineResourceSpec{ Type: "non-existent", }, @@ -465,9 +465,9 @@ func TestResources_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("spec.type", "non-existent"), }, { name: "no resource ref ", // and resource spec - resources: &v1alpha2.TaskRunResources{ - Outputs: []v1alpha2.TaskResourceBinding{{ - PipelineResourceBinding: v1alpha2.PipelineResourceBinding{ + resources: &v1beta1.TaskRunResources{ + Outputs: []v1beta1.TaskResourceBinding{{ + PipelineResourceBinding: v1beta1.PipelineResourceBinding{ Name: "resource", }, }}, diff --git a/pkg/apis/pipeline/v1alpha2/types_test.go b/pkg/apis/pipeline/v1beta1/types_test.go similarity index 63% rename from pkg/apis/pipeline/v1alpha2/types_test.go rename to pkg/apis/pipeline/v1beta1/types_test.go index 705c238e779..546b8fce5db 100644 --- a/pkg/apis/pipeline/v1alpha2/types_test.go +++ b/pkg/apis/pipeline/v1beta1/types_test.go @@ -14,20 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2_test +package v1beta1_test import ( "testing" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "knative.dev/pkg/webhook/resourcesemantics" ) func TestTypes(t *testing.T) { // Assert that types satisfy webhook interface. - // var _ resourcesemantics.GenericCRD = (*v1alpha2.ClusterTask)(nil) - var _ resourcesemantics.GenericCRD = (*v1alpha2.TaskRun)(nil) - var _ resourcesemantics.GenericCRD = (*v1alpha2.Task)(nil) - var _ resourcesemantics.GenericCRD = (*v1alpha2.Pipeline)(nil) - // var _ resourcesemantics.GenericCRD = (*v1alpha2.Condition)(nil) + // var _ resourcesemantics.GenericCRD = (*v1beta1.ClusterTask)(nil) + var _ resourcesemantics.GenericCRD = (*v1beta1.TaskRun)(nil) + var _ resourcesemantics.GenericCRD = (*v1beta1.Task)(nil) + var _ resourcesemantics.GenericCRD = (*v1beta1.Pipeline)(nil) + // var _ resourcesemantics.GenericCRD = (*v1beta1.Condition)(nil) } diff --git a/pkg/apis/pipeline/v1alpha2/workspace_types.go b/pkg/apis/pipeline/v1beta1/workspace_types.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/workspace_types.go rename to pkg/apis/pipeline/v1beta1/workspace_types.go index f9d85a7d55f..e2c768a563a 100644 --- a/pkg/apis/pipeline/v1alpha2/workspace_types.go +++ b/pkg/apis/pipeline/v1beta1/workspace_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "path/filepath" diff --git a/pkg/apis/pipeline/v1alpha2/workspace_validation.go b/pkg/apis/pipeline/v1beta1/workspace_validation.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/workspace_validation.go rename to pkg/apis/pipeline/v1beta1/workspace_validation.go index 61778dc0dc0..99e0a1b9ef5 100644 --- a/pkg/apis/pipeline/v1alpha2/workspace_validation.go +++ b/pkg/apis/pipeline/v1beta1/workspace_validation.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/workspace_validation_test.go b/pkg/apis/pipeline/v1beta1/workspace_validation_test.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/workspace_validation_test.go rename to pkg/apis/pipeline/v1beta1/workspace_validation_test.go index f8ee5c1162b..9316e0f1e63 100644 --- a/pkg/apis/pipeline/v1alpha2/workspace_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/workspace_validation_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1beta1 import ( "context" diff --git a/pkg/apis/pipeline/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/pipeline/v1alpha2/zz_generated.deepcopy.go rename to pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go index 0d5d6c52e08..9fec10b10e2 100644 --- a/pkg/apis/pipeline/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod" diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 404c9a03d3f..fdee31c6897 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -22,7 +22,7 @@ import ( "fmt" tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1" - tektonv1alpha2 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha2" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -31,7 +31,7 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface - TektonV1alpha2() tektonv1alpha2.TektonV1alpha2Interface + TektonV1beta1() tektonv1beta1.TektonV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one @@ -39,7 +39,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient tektonV1alpha1 *tektonv1alpha1.TektonV1alpha1Client - tektonV1alpha2 *tektonv1alpha2.TektonV1alpha2Client + tektonV1beta1 *tektonv1beta1.TektonV1beta1Client } // TektonV1alpha1 retrieves the TektonV1alpha1Client @@ -47,9 +47,9 @@ func (c *Clientset) TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface { return c.tektonV1alpha1 } -// TektonV1alpha2 retrieves the TektonV1alpha2Client -func (c *Clientset) TektonV1alpha2() tektonv1alpha2.TektonV1alpha2Interface { - return c.tektonV1alpha2 +// TektonV1beta1 retrieves the TektonV1beta1Client +func (c *Clientset) TektonV1beta1() tektonv1beta1.TektonV1beta1Interface { + return c.tektonV1beta1 } // Discovery retrieves the DiscoveryClient @@ -77,7 +77,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.tektonV1alpha2, err = tektonv1alpha2.NewForConfig(&configShallowCopy) + cs.tektonV1beta1, err = tektonv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -94,7 +94,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset cs.tektonV1alpha1 = tektonv1alpha1.NewForConfigOrDie(c) - cs.tektonV1alpha2 = tektonv1alpha2.NewForConfigOrDie(c) + cs.tektonV1beta1 = tektonv1beta1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -104,7 +104,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.tektonV1alpha1 = tektonv1alpha1.New(c) - cs.tektonV1alpha2 = tektonv1alpha2.New(c) + cs.tektonV1beta1 = tektonv1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index e87ff86fc78..06ece62d7a4 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -22,8 +22,8 @@ import ( clientset "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1" faketektonv1alpha1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/fake" - tektonv1alpha2 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha2" - faketektonv1alpha2 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1" + faketektonv1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -83,7 +83,7 @@ func (c *Clientset) TektonV1alpha1() tektonv1alpha1.TektonV1alpha1Interface { return &faketektonv1alpha1.FakeTektonV1alpha1{Fake: &c.Fake} } -// TektonV1alpha2 retrieves the TektonV1alpha2Client -func (c *Clientset) TektonV1alpha2() tektonv1alpha2.TektonV1alpha2Interface { - return &faketektonv1alpha2.FakeTektonV1alpha2{Fake: &c.Fake} +// TektonV1beta1 retrieves the TektonV1beta1Client +func (c *Clientset) TektonV1beta1() tektonv1beta1.TektonV1beta1Interface { + return &faketektonv1beta1.FakeTektonV1beta1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index e3ab1e2e306..9cb0cd85161 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -20,7 +20,7 @@ package fake import ( tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - tektonv1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +33,7 @@ var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ tektonv1alpha1.AddToScheme, - tektonv1alpha2.AddToScheme, + tektonv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 591f92bb2fa..aca95492fcb 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -20,7 +20,7 @@ package scheme import ( tektonv1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - tektonv1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + tektonv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -33,7 +33,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ tektonv1alpha1.AddToScheme, - tektonv1alpha2.AddToScheme, + tektonv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/clustertask.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go similarity index 80% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/clustertask.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go index 2dfffff4c89..25545a39169 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/clustertask.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( "time" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,14 +37,14 @@ type ClusterTasksGetter interface { // ClusterTaskInterface has methods to work with ClusterTask resources. type ClusterTaskInterface interface { - Create(*v1alpha2.ClusterTask) (*v1alpha2.ClusterTask, error) - Update(*v1alpha2.ClusterTask) (*v1alpha2.ClusterTask, error) + Create(*v1beta1.ClusterTask) (*v1beta1.ClusterTask, error) + Update(*v1beta1.ClusterTask) (*v1beta1.ClusterTask, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.ClusterTask, error) - List(opts v1.ListOptions) (*v1alpha2.ClusterTaskList, error) + Get(name string, options v1.GetOptions) (*v1beta1.ClusterTask, error) + List(opts v1.ListOptions) (*v1beta1.ClusterTaskList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.ClusterTask, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterTask, err error) ClusterTaskExpansion } @@ -54,15 +54,15 @@ type clusterTasks struct { } // newClusterTasks returns a ClusterTasks -func newClusterTasks(c *TektonV1alpha2Client) *clusterTasks { +func newClusterTasks(c *TektonV1beta1Client) *clusterTasks { return &clusterTasks{ client: c.RESTClient(), } } // Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. -func (c *clusterTasks) Get(name string, options v1.GetOptions) (result *v1alpha2.ClusterTask, err error) { - result = &v1alpha2.ClusterTask{} +func (c *clusterTasks) Get(name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} err = c.client.Get(). Resource("clustertasks"). Name(name). @@ -73,12 +73,12 @@ func (c *clusterTasks) Get(name string, options v1.GetOptions) (result *v1alpha2 } // List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. -func (c *clusterTasks) List(opts v1.ListOptions) (result *v1alpha2.ClusterTaskList, err error) { +func (c *clusterTasks) List(opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.ClusterTaskList{} + result = &v1beta1.ClusterTaskList{} err = c.client.Get(). Resource("clustertasks"). VersionedParams(&opts, scheme.ParameterCodec). @@ -103,8 +103,8 @@ func (c *clusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Create(clusterTask *v1alpha2.ClusterTask) (result *v1alpha2.ClusterTask, err error) { - result = &v1alpha2.ClusterTask{} +func (c *clusterTasks) Create(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} err = c.client.Post(). Resource("clustertasks"). Body(clusterTask). @@ -114,8 +114,8 @@ func (c *clusterTasks) Create(clusterTask *v1alpha2.ClusterTask) (result *v1alph } // Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Update(clusterTask *v1alpha2.ClusterTask) (result *v1alpha2.ClusterTask, err error) { - result = &v1alpha2.ClusterTask{} +func (c *clusterTasks) Update(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} err = c.client.Put(). Resource("clustertasks"). Name(clusterTask.Name). @@ -151,8 +151,8 @@ func (c *clusterTasks) DeleteCollection(options *v1.DeleteOptions, listOptions v } // Patch applies the patch and returns the patched clusterTask. -func (c *clusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.ClusterTask, err error) { - result = &v1alpha2.ClusterTask{} +func (c *clusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterTask, err error) { + result = &v1beta1.ClusterTask{} err = c.client.Patch(pt). Resource("clustertasks"). SubResource(subresources...). diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/doc.go similarity index 97% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/doc.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/doc.go index 1df2d63e633..ff6e6bc2555 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/doc.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha2 +package v1beta1 diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/doc.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_clustertask.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go similarity index 74% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_clustertask.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go index 0500b54e877..5cfd93cc11e 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_clustertask.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_clustertask.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,27 +30,27 @@ import ( // FakeClusterTasks implements ClusterTaskInterface type FakeClusterTasks struct { - Fake *FakeTektonV1alpha2 + Fake *FakeTektonV1beta1 } -var clustertasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1alpha2", Resource: "clustertasks"} +var clustertasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "clustertasks"} -var clustertasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1alpha2", Kind: "ClusterTask"} +var clustertasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "ClusterTask"} // Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. -func (c *FakeClusterTasks) Get(name string, options v1.GetOptions) (result *v1alpha2.ClusterTask, err error) { +func (c *FakeClusterTasks) Get(name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertasksResource, name), &v1alpha2.ClusterTask{}) + Invokes(testing.NewRootGetAction(clustertasksResource, name), &v1beta1.ClusterTask{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.ClusterTask), err + return obj.(*v1beta1.ClusterTask), err } // List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. -func (c *FakeClusterTasks) List(opts v1.ListOptions) (result *v1alpha2.ClusterTaskList, err error) { +func (c *FakeClusterTasks) List(opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertasksResource, clustertasksKind, opts), &v1alpha2.ClusterTaskList{}) + Invokes(testing.NewRootListAction(clustertasksResource, clustertasksKind, opts), &v1beta1.ClusterTaskList{}) if obj == nil { return nil, err } @@ -59,8 +59,8 @@ func (c *FakeClusterTasks) List(opts v1.ListOptions) (result *v1alpha2.ClusterTa if label == nil { label = labels.Everything() } - list := &v1alpha2.ClusterTaskList{ListMeta: obj.(*v1alpha2.ClusterTaskList).ListMeta} - for _, item := range obj.(*v1alpha2.ClusterTaskList).Items { + list := &v1beta1.ClusterTaskList{ListMeta: obj.(*v1beta1.ClusterTaskList).ListMeta} + for _, item := range obj.(*v1beta1.ClusterTaskList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -75,29 +75,29 @@ func (c *FakeClusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *FakeClusterTasks) Create(clusterTask *v1alpha2.ClusterTask) (result *v1alpha2.ClusterTask, err error) { +func (c *FakeClusterTasks) Create(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertasksResource, clusterTask), &v1alpha2.ClusterTask{}) + Invokes(testing.NewRootCreateAction(clustertasksResource, clusterTask), &v1beta1.ClusterTask{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.ClusterTask), err + return obj.(*v1beta1.ClusterTask), err } // Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *FakeClusterTasks) Update(clusterTask *v1alpha2.ClusterTask) (result *v1alpha2.ClusterTask, err error) { +func (c *FakeClusterTasks) Update(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertasksResource, clusterTask), &v1alpha2.ClusterTask{}) + Invokes(testing.NewRootUpdateAction(clustertasksResource, clusterTask), &v1beta1.ClusterTask{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.ClusterTask), err + return obj.(*v1beta1.ClusterTask), err } // Delete takes name of the clusterTask and deletes it. Returns an error if one occurs. func (c *FakeClusterTasks) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(clustertasksResource, name), &v1alpha2.ClusterTask{}) + Invokes(testing.NewRootDeleteAction(clustertasksResource, name), &v1beta1.ClusterTask{}) return err } @@ -105,16 +105,16 @@ func (c *FakeClusterTasks) Delete(name string, options *v1.DeleteOptions) error func (c *FakeClusterTasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(clustertasksResource, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha2.ClusterTaskList{}) + _, err := c.Fake.Invokes(action, &v1beta1.ClusterTaskList{}) return err } // Patch applies the patch and returns the patched clusterTask. -func (c *FakeClusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.ClusterTask, err error) { +func (c *FakeClusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterTask, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertasksResource, name, pt, data, subresources...), &v1alpha2.ClusterTask{}) + Invokes(testing.NewRootPatchSubresourceAction(clustertasksResource, name, pt, data, subresources...), &v1beta1.ClusterTask{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.ClusterTask), err + return obj.(*v1beta1.ClusterTask), err } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go similarity index 74% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go index 9987d89c0af..f146c35b258 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakePipelines implements PipelineInterface type FakePipelines struct { - Fake *FakeTektonV1alpha2 + Fake *FakeTektonV1beta1 ns string } -var pipelinesResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1alpha2", Resource: "pipelines"} +var pipelinesResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "pipelines"} -var pipelinesKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1alpha2", Kind: "Pipeline"} +var pipelinesKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "Pipeline"} // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *FakePipelines) Get(name string, options v1.GetOptions) (result *v1alpha2.Pipeline, err error) { +func (c *FakePipelines) Get(name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(pipelinesResource, c.ns, name), &v1alpha2.Pipeline{}) + Invokes(testing.NewGetAction(pipelinesResource, c.ns, name), &v1beta1.Pipeline{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Pipeline), err + return obj.(*v1beta1.Pipeline), err } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *FakePipelines) List(opts v1.ListOptions) (result *v1alpha2.PipelineList, err error) { +func (c *FakePipelines) List(opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(pipelinesResource, pipelinesKind, c.ns, opts), &v1alpha2.PipelineList{}) + Invokes(testing.NewListAction(pipelinesResource, pipelinesKind, c.ns, opts), &v1beta1.PipelineList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakePipelines) List(opts v1.ListOptions) (result *v1alpha2.PipelineList if label == nil { label = labels.Everything() } - list := &v1alpha2.PipelineList{ListMeta: obj.(*v1alpha2.PipelineList).ListMeta} - for _, item := range obj.(*v1alpha2.PipelineList).Items { + list := &v1beta1.PipelineList{ListMeta: obj.(*v1beta1.PipelineList).ListMeta} + for _, item := range obj.(*v1beta1.PipelineList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakePipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *FakePipelines) Create(pipeline *v1alpha2.Pipeline) (result *v1alpha2.Pipeline, err error) { +func (c *FakePipelines) Create(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(pipelinesResource, c.ns, pipeline), &v1alpha2.Pipeline{}) + Invokes(testing.NewCreateAction(pipelinesResource, c.ns, pipeline), &v1beta1.Pipeline{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Pipeline), err + return obj.(*v1beta1.Pipeline), err } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *FakePipelines) Update(pipeline *v1alpha2.Pipeline) (result *v1alpha2.Pipeline, err error) { +func (c *FakePipelines) Update(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(pipelinesResource, c.ns, pipeline), &v1alpha2.Pipeline{}) + Invokes(testing.NewUpdateAction(pipelinesResource, c.ns, pipeline), &v1beta1.Pipeline{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Pipeline), err + return obj.(*v1beta1.Pipeline), err } // Delete takes name of the pipeline and deletes it. Returns an error if one occurs. func (c *FakePipelines) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(pipelinesResource, c.ns, name), &v1alpha2.Pipeline{}) + Invokes(testing.NewDeleteAction(pipelinesResource, c.ns, name), &v1beta1.Pipeline{}) return err } @@ -112,17 +112,17 @@ func (c *FakePipelines) Delete(name string, options *v1.DeleteOptions) error { func (c *FakePipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(pipelinesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha2.PipelineList{}) + _, err := c.Fake.Invokes(action, &v1beta1.PipelineList{}) return err } // Patch applies the patch and returns the patched pipeline. -func (c *FakePipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Pipeline, err error) { +func (c *FakePipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Pipeline, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pipelinesResource, c.ns, name, pt, data, subresources...), &v1alpha2.Pipeline{}) + Invokes(testing.NewPatchSubresourceAction(pipelinesResource, c.ns, name, pt, data, subresources...), &v1beta1.Pipeline{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Pipeline), err + return obj.(*v1beta1.Pipeline), err } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline_client.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go similarity index 64% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline_client.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go index 14cbd2b7dae..e3863eb0939 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipeline_client.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipeline_client.go @@ -19,38 +19,38 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeTektonV1alpha2 struct { +type FakeTektonV1beta1 struct { *testing.Fake } -func (c *FakeTektonV1alpha2) ClusterTasks() v1alpha2.ClusterTaskInterface { +func (c *FakeTektonV1beta1) ClusterTasks() v1beta1.ClusterTaskInterface { return &FakeClusterTasks{c} } -func (c *FakeTektonV1alpha2) Pipelines(namespace string) v1alpha2.PipelineInterface { +func (c *FakeTektonV1beta1) Pipelines(namespace string) v1beta1.PipelineInterface { return &FakePipelines{c, namespace} } -func (c *FakeTektonV1alpha2) PipelineRuns(namespace string) v1alpha2.PipelineRunInterface { +func (c *FakeTektonV1beta1) PipelineRuns(namespace string) v1beta1.PipelineRunInterface { return &FakePipelineRuns{c, namespace} } -func (c *FakeTektonV1alpha2) Tasks(namespace string) v1alpha2.TaskInterface { +func (c *FakeTektonV1beta1) Tasks(namespace string) v1beta1.TaskInterface { return &FakeTasks{c, namespace} } -func (c *FakeTektonV1alpha2) TaskRuns(namespace string) v1alpha2.TaskRunInterface { +func (c *FakeTektonV1beta1) TaskRuns(namespace string) v1beta1.TaskRunInterface { return &FakeTaskRuns{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeTektonV1alpha2) RESTClient() rest.Interface { +func (c *FakeTektonV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipelinerun.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go similarity index 72% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipelinerun.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go index fca23a73381..c9c0f0c16f2 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_pipelinerun.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_pipelinerun.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakePipelineRuns implements PipelineRunInterface type FakePipelineRuns struct { - Fake *FakeTektonV1alpha2 + Fake *FakeTektonV1beta1 ns string } -var pipelinerunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1alpha2", Resource: "pipelineruns"} +var pipelinerunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "pipelineruns"} -var pipelinerunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1alpha2", Kind: "PipelineRun"} +var pipelinerunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "PipelineRun"} // Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. -func (c *FakePipelineRuns) Get(name string, options v1.GetOptions) (result *v1alpha2.PipelineRun, err error) { +func (c *FakePipelineRuns) Get(name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(pipelinerunsResource, c.ns, name), &v1alpha2.PipelineRun{}) + Invokes(testing.NewGetAction(pipelinerunsResource, c.ns, name), &v1beta1.PipelineRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.PipelineRun), err + return obj.(*v1beta1.PipelineRun), err } // List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. -func (c *FakePipelineRuns) List(opts v1.ListOptions) (result *v1alpha2.PipelineRunList, err error) { +func (c *FakePipelineRuns) List(opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(pipelinerunsResource, pipelinerunsKind, c.ns, opts), &v1alpha2.PipelineRunList{}) + Invokes(testing.NewListAction(pipelinerunsResource, pipelinerunsKind, c.ns, opts), &v1beta1.PipelineRunList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakePipelineRuns) List(opts v1.ListOptions) (result *v1alpha2.PipelineR if label == nil { label = labels.Everything() } - list := &v1alpha2.PipelineRunList{ListMeta: obj.(*v1alpha2.PipelineRunList).ListMeta} - for _, item := range obj.(*v1alpha2.PipelineRunList).Items { + list := &v1beta1.PipelineRunList{ListMeta: obj.(*v1beta1.PipelineRunList).ListMeta} + for _, item := range obj.(*v1beta1.PipelineRunList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakePipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *FakePipelineRuns) Create(pipelineRun *v1alpha2.PipelineRun) (result *v1alpha2.PipelineRun, err error) { +func (c *FakePipelineRuns) Create(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(pipelinerunsResource, c.ns, pipelineRun), &v1alpha2.PipelineRun{}) + Invokes(testing.NewCreateAction(pipelinerunsResource, c.ns, pipelineRun), &v1beta1.PipelineRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.PipelineRun), err + return obj.(*v1beta1.PipelineRun), err } // Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *FakePipelineRuns) Update(pipelineRun *v1alpha2.PipelineRun) (result *v1alpha2.PipelineRun, err error) { +func (c *FakePipelineRuns) Update(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(pipelinerunsResource, c.ns, pipelineRun), &v1alpha2.PipelineRun{}) + Invokes(testing.NewUpdateAction(pipelinerunsResource, c.ns, pipelineRun), &v1beta1.PipelineRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.PipelineRun), err + return obj.(*v1beta1.PipelineRun), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePipelineRuns) UpdateStatus(pipelineRun *v1alpha2.PipelineRun) (*v1alpha2.PipelineRun, error) { +func (c *FakePipelineRuns) UpdateStatus(pipelineRun *v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(pipelinerunsResource, "status", c.ns, pipelineRun), &v1alpha2.PipelineRun{}) + Invokes(testing.NewUpdateSubresourceAction(pipelinerunsResource, "status", c.ns, pipelineRun), &v1beta1.PipelineRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.PipelineRun), err + return obj.(*v1beta1.PipelineRun), err } // Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs. func (c *FakePipelineRuns) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(pipelinerunsResource, c.ns, name), &v1alpha2.PipelineRun{}) + Invokes(testing.NewDeleteAction(pipelinerunsResource, c.ns, name), &v1beta1.PipelineRun{}) return err } @@ -124,17 +124,17 @@ func (c *FakePipelineRuns) Delete(name string, options *v1.DeleteOptions) error func (c *FakePipelineRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(pipelinerunsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha2.PipelineRunList{}) + _, err := c.Fake.Invokes(action, &v1beta1.PipelineRunList{}) return err } // Patch applies the patch and returns the patched pipelineRun. -func (c *FakePipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.PipelineRun, err error) { +func (c *FakePipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PipelineRun, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pipelinerunsResource, c.ns, name, pt, data, subresources...), &v1alpha2.PipelineRun{}) + Invokes(testing.NewPatchSubresourceAction(pipelinerunsResource, c.ns, name, pt, data, subresources...), &v1beta1.PipelineRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.PipelineRun), err + return obj.(*v1beta1.PipelineRun), err } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_task.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go similarity index 75% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_task.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go index b8dc46324b3..fb0f456b69a 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_task.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_task.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeTasks implements TaskInterface type FakeTasks struct { - Fake *FakeTektonV1alpha2 + Fake *FakeTektonV1beta1 ns string } -var tasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1alpha2", Resource: "tasks"} +var tasksResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "tasks"} -var tasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1alpha2", Kind: "Task"} +var tasksKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "Task"} // Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *FakeTasks) Get(name string, options v1.GetOptions) (result *v1alpha2.Task, err error) { +func (c *FakeTasks) Get(name string, options v1.GetOptions) (result *v1beta1.Task, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(tasksResource, c.ns, name), &v1alpha2.Task{}) + Invokes(testing.NewGetAction(tasksResource, c.ns, name), &v1beta1.Task{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Task), err + return obj.(*v1beta1.Task), err } // List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *FakeTasks) List(opts v1.ListOptions) (result *v1alpha2.TaskList, err error) { +func (c *FakeTasks) List(opts v1.ListOptions) (result *v1beta1.TaskList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(tasksResource, tasksKind, c.ns, opts), &v1alpha2.TaskList{}) + Invokes(testing.NewListAction(tasksResource, tasksKind, c.ns, opts), &v1beta1.TaskList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTasks) List(opts v1.ListOptions) (result *v1alpha2.TaskList, err er if label == nil { label = labels.Everything() } - list := &v1alpha2.TaskList{ListMeta: obj.(*v1alpha2.TaskList).ListMeta} - for _, item := range obj.(*v1alpha2.TaskList).Items { + list := &v1beta1.TaskList{ListMeta: obj.(*v1beta1.TaskList).ListMeta} + for _, item := range obj.(*v1beta1.TaskList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *FakeTasks) Create(task *v1alpha2.Task) (result *v1alpha2.Task, err error) { +func (c *FakeTasks) Create(task *v1beta1.Task) (result *v1beta1.Task, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(tasksResource, c.ns, task), &v1alpha2.Task{}) + Invokes(testing.NewCreateAction(tasksResource, c.ns, task), &v1beta1.Task{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Task), err + return obj.(*v1beta1.Task), err } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *FakeTasks) Update(task *v1alpha2.Task) (result *v1alpha2.Task, err error) { +func (c *FakeTasks) Update(task *v1beta1.Task) (result *v1beta1.Task, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tasksResource, c.ns, task), &v1alpha2.Task{}) + Invokes(testing.NewUpdateAction(tasksResource, c.ns, task), &v1beta1.Task{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Task), err + return obj.(*v1beta1.Task), err } // Delete takes name of the task and deletes it. Returns an error if one occurs. func (c *FakeTasks) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(tasksResource, c.ns, name), &v1alpha2.Task{}) + Invokes(testing.NewDeleteAction(tasksResource, c.ns, name), &v1beta1.Task{}) return err } @@ -112,17 +112,17 @@ func (c *FakeTasks) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(tasksResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha2.TaskList{}) + _, err := c.Fake.Invokes(action, &v1beta1.TaskList{}) return err } // Patch applies the patch and returns the patched task. -func (c *FakeTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Task, err error) { +func (c *FakeTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Task, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tasksResource, c.ns, name, pt, data, subresources...), &v1alpha2.Task{}) + Invokes(testing.NewPatchSubresourceAction(tasksResource, c.ns, name, pt, data, subresources...), &v1beta1.Task{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.Task), err + return obj.(*v1beta1.Task), err } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_taskrun.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go similarity index 74% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_taskrun.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go index 6d1592efc40..5b833596739 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/fake/fake_taskrun.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/fake/fake_taskrun.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeTaskRuns implements TaskRunInterface type FakeTaskRuns struct { - Fake *FakeTektonV1alpha2 + Fake *FakeTektonV1beta1 ns string } -var taskrunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1alpha2", Resource: "taskruns"} +var taskrunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1beta1", Resource: "taskruns"} -var taskrunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1alpha2", Kind: "TaskRun"} +var taskrunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1beta1", Kind: "TaskRun"} // Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. -func (c *FakeTaskRuns) Get(name string, options v1.GetOptions) (result *v1alpha2.TaskRun, err error) { +func (c *FakeTaskRuns) Get(name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(taskrunsResource, c.ns, name), &v1alpha2.TaskRun{}) + Invokes(testing.NewGetAction(taskrunsResource, c.ns, name), &v1beta1.TaskRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.TaskRun), err + return obj.(*v1beta1.TaskRun), err } // List takes label and field selectors, and returns the list of TaskRuns that match those selectors. -func (c *FakeTaskRuns) List(opts v1.ListOptions) (result *v1alpha2.TaskRunList, err error) { +func (c *FakeTaskRuns) List(opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(taskrunsResource, taskrunsKind, c.ns, opts), &v1alpha2.TaskRunList{}) + Invokes(testing.NewListAction(taskrunsResource, taskrunsKind, c.ns, opts), &v1beta1.TaskRunList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTaskRuns) List(opts v1.ListOptions) (result *v1alpha2.TaskRunList, if label == nil { label = labels.Everything() } - list := &v1alpha2.TaskRunList{ListMeta: obj.(*v1alpha2.TaskRunList).ListMeta} - for _, item := range obj.(*v1alpha2.TaskRunList).Items { + list := &v1beta1.TaskRunList{ListMeta: obj.(*v1beta1.TaskRunList).ListMeta} + for _, item := range obj.(*v1beta1.TaskRunList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeTaskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *FakeTaskRuns) Create(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, err error) { +func (c *FakeTaskRuns) Create(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(taskrunsResource, c.ns, taskRun), &v1alpha2.TaskRun{}) + Invokes(testing.NewCreateAction(taskrunsResource, c.ns, taskRun), &v1beta1.TaskRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.TaskRun), err + return obj.(*v1beta1.TaskRun), err } // Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *FakeTaskRuns) Update(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, err error) { +func (c *FakeTaskRuns) Update(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(taskrunsResource, c.ns, taskRun), &v1alpha2.TaskRun{}) + Invokes(testing.NewUpdateAction(taskrunsResource, c.ns, taskRun), &v1beta1.TaskRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.TaskRun), err + return obj.(*v1beta1.TaskRun), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeTaskRuns) UpdateStatus(taskRun *v1alpha2.TaskRun) (*v1alpha2.TaskRun, error) { +func (c *FakeTaskRuns) UpdateStatus(taskRun *v1beta1.TaskRun) (*v1beta1.TaskRun, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(taskrunsResource, "status", c.ns, taskRun), &v1alpha2.TaskRun{}) + Invokes(testing.NewUpdateSubresourceAction(taskrunsResource, "status", c.ns, taskRun), &v1beta1.TaskRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.TaskRun), err + return obj.(*v1beta1.TaskRun), err } // Delete takes name of the taskRun and deletes it. Returns an error if one occurs. func (c *FakeTaskRuns) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(taskrunsResource, c.ns, name), &v1alpha2.TaskRun{}) + Invokes(testing.NewDeleteAction(taskrunsResource, c.ns, name), &v1beta1.TaskRun{}) return err } @@ -124,17 +124,17 @@ func (c *FakeTaskRuns) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTaskRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(taskrunsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha2.TaskRunList{}) + _, err := c.Fake.Invokes(action, &v1beta1.TaskRunList{}) return err } // Patch applies the patch and returns the patched taskRun. -func (c *FakeTaskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.TaskRun, err error) { +func (c *FakeTaskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TaskRun, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(taskrunsResource, c.ns, name, pt, data, subresources...), &v1alpha2.TaskRun{}) + Invokes(testing.NewPatchSubresourceAction(taskrunsResource, c.ns, name, pt, data, subresources...), &v1beta1.TaskRun{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.TaskRun), err + return obj.(*v1beta1.TaskRun), err } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go similarity index 97% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/generated_expansion.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go index e88ed853bba..0fe47f306c0 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 type ClusterTaskExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go similarity index 81% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go index a5c10399123..c89e4a46317 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( "time" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,14 +37,14 @@ type PipelinesGetter interface { // PipelineInterface has methods to work with Pipeline resources. type PipelineInterface interface { - Create(*v1alpha2.Pipeline) (*v1alpha2.Pipeline, error) - Update(*v1alpha2.Pipeline) (*v1alpha2.Pipeline, error) + Create(*v1beta1.Pipeline) (*v1beta1.Pipeline, error) + Update(*v1beta1.Pipeline) (*v1beta1.Pipeline, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.Pipeline, error) - List(opts v1.ListOptions) (*v1alpha2.PipelineList, error) + Get(name string, options v1.GetOptions) (*v1beta1.Pipeline, error) + List(opts v1.ListOptions) (*v1beta1.PipelineList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Pipeline, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Pipeline, err error) PipelineExpansion } @@ -55,7 +55,7 @@ type pipelines struct { } // newPipelines returns a Pipelines -func newPipelines(c *TektonV1alpha2Client, namespace string) *pipelines { +func newPipelines(c *TektonV1beta1Client, namespace string) *pipelines { return &pipelines{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newPipelines(c *TektonV1alpha2Client, namespace string) *pipelines { } // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1alpha2.Pipeline, err error) { - result = &v1alpha2.Pipeline{} +func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). @@ -76,12 +76,12 @@ func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1alpha2.Pi } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *pipelines) List(opts v1.ListOptions) (result *v1alpha2.PipelineList, err error) { +func (c *pipelines) List(opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.PipelineList{} + result = &v1beta1.PipelineList{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). @@ -108,8 +108,8 @@ func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Create(pipeline *v1alpha2.Pipeline) (result *v1alpha2.Pipeline, err error) { - result = &v1alpha2.Pipeline{} +func (c *pipelines) Create(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} err = c.client.Post(). Namespace(c.ns). Resource("pipelines"). @@ -120,8 +120,8 @@ func (c *pipelines) Create(pipeline *v1alpha2.Pipeline) (result *v1alpha2.Pipeli } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Update(pipeline *v1alpha2.Pipeline) (result *v1alpha2.Pipeline, err error) { - result = &v1alpha2.Pipeline{} +func (c *pipelines) Update(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} err = c.client.Put(). Namespace(c.ns). Resource("pipelines"). @@ -160,8 +160,8 @@ func (c *pipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.L } // Patch applies the patch and returns the patched pipeline. -func (c *pipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Pipeline, err error) { - result = &v1alpha2.Pipeline{} +func (c *pipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Pipeline, err error) { + result = &v1beta1.Pipeline{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelines"). diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline_client.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go similarity index 59% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline_client.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go index b6acbfd826f..373236e24d9 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipeline_client.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline_client.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type TektonV1alpha2Interface interface { +type TektonV1beta1Interface interface { RESTClient() rest.Interface ClusterTasksGetter PipelinesGetter @@ -33,33 +33,33 @@ type TektonV1alpha2Interface interface { TaskRunsGetter } -// TektonV1alpha2Client is used to interact with features provided by the tekton.dev group. -type TektonV1alpha2Client struct { +// TektonV1beta1Client is used to interact with features provided by the tekton.dev group. +type TektonV1beta1Client struct { restClient rest.Interface } -func (c *TektonV1alpha2Client) ClusterTasks() ClusterTaskInterface { +func (c *TektonV1beta1Client) ClusterTasks() ClusterTaskInterface { return newClusterTasks(c) } -func (c *TektonV1alpha2Client) Pipelines(namespace string) PipelineInterface { +func (c *TektonV1beta1Client) Pipelines(namespace string) PipelineInterface { return newPipelines(c, namespace) } -func (c *TektonV1alpha2Client) PipelineRuns(namespace string) PipelineRunInterface { +func (c *TektonV1beta1Client) PipelineRuns(namespace string) PipelineRunInterface { return newPipelineRuns(c, namespace) } -func (c *TektonV1alpha2Client) Tasks(namespace string) TaskInterface { +func (c *TektonV1beta1Client) Tasks(namespace string) TaskInterface { return newTasks(c, namespace) } -func (c *TektonV1alpha2Client) TaskRuns(namespace string) TaskRunInterface { +func (c *TektonV1beta1Client) TaskRuns(namespace string) TaskRunInterface { return newTaskRuns(c, namespace) } -// NewForConfig creates a new TektonV1alpha2Client for the given config. -func NewForConfig(c *rest.Config) (*TektonV1alpha2Client, error) { +// NewForConfig creates a new TektonV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*TektonV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -68,12 +68,12 @@ func NewForConfig(c *rest.Config) (*TektonV1alpha2Client, error) { if err != nil { return nil, err } - return &TektonV1alpha2Client{client}, nil + return &TektonV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new TektonV1alpha2Client for the given config and +// NewForConfigOrDie creates a new TektonV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *TektonV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *TektonV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -81,13 +81,13 @@ func NewForConfigOrDie(c *rest.Config) *TektonV1alpha2Client { return client } -// New creates a new TektonV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *TektonV1alpha2Client { - return &TektonV1alpha2Client{c} +// New creates a new TektonV1beta1Client for the given RESTClient. +func New(c rest.Interface) *TektonV1beta1Client { + return &TektonV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion + gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -101,7 +101,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *TektonV1alpha2Client) RESTClient() rest.Interface { +func (c *TektonV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipelinerun.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go similarity index 78% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipelinerun.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go index e168cc0ac3d..0509c0f0f76 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/pipelinerun.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( "time" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,15 +37,15 @@ type PipelineRunsGetter interface { // PipelineRunInterface has methods to work with PipelineRun resources. type PipelineRunInterface interface { - Create(*v1alpha2.PipelineRun) (*v1alpha2.PipelineRun, error) - Update(*v1alpha2.PipelineRun) (*v1alpha2.PipelineRun, error) - UpdateStatus(*v1alpha2.PipelineRun) (*v1alpha2.PipelineRun, error) + Create(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) + Update(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) + UpdateStatus(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.PipelineRun, error) - List(opts v1.ListOptions) (*v1alpha2.PipelineRunList, error) + Get(name string, options v1.GetOptions) (*v1beta1.PipelineRun, error) + List(opts v1.ListOptions) (*v1beta1.PipelineRunList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.PipelineRun, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PipelineRun, err error) PipelineRunExpansion } @@ -56,7 +56,7 @@ type pipelineRuns struct { } // newPipelineRuns returns a PipelineRuns -func newPipelineRuns(c *TektonV1alpha2Client, namespace string) *pipelineRuns { +func newPipelineRuns(c *TektonV1beta1Client, namespace string) *pipelineRuns { return &pipelineRuns{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newPipelineRuns(c *TektonV1alpha2Client, namespace string) *pipelineRuns { } // Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. -func (c *pipelineRuns) Get(name string, options v1.GetOptions) (result *v1alpha2.PipelineRun, err error) { - result = &v1alpha2.PipelineRun{} +func (c *pipelineRuns) Get(name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} err = c.client.Get(). Namespace(c.ns). Resource("pipelineruns"). @@ -77,12 +77,12 @@ func (c *pipelineRuns) Get(name string, options v1.GetOptions) (result *v1alpha2 } // List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. -func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1alpha2.PipelineRunList, err error) { +func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.PipelineRunList{} + result = &v1beta1.PipelineRunList{} err = c.client.Get(). Namespace(c.ns). Resource("pipelineruns"). @@ -109,8 +109,8 @@ func (c *pipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Create(pipelineRun *v1alpha2.PipelineRun) (result *v1alpha2.PipelineRun, err error) { - result = &v1alpha2.PipelineRun{} +func (c *pipelineRuns) Create(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} err = c.client.Post(). Namespace(c.ns). Resource("pipelineruns"). @@ -121,8 +121,8 @@ func (c *pipelineRuns) Create(pipelineRun *v1alpha2.PipelineRun) (result *v1alph } // Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Update(pipelineRun *v1alpha2.PipelineRun) (result *v1alpha2.PipelineRun, err error) { - result = &v1alpha2.PipelineRun{} +func (c *pipelineRuns) Update(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). @@ -136,8 +136,8 @@ func (c *pipelineRuns) Update(pipelineRun *v1alpha2.PipelineRun) (result *v1alph // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *pipelineRuns) UpdateStatus(pipelineRun *v1alpha2.PipelineRun) (result *v1alpha2.PipelineRun, err error) { - result = &v1alpha2.PipelineRun{} +func (c *pipelineRuns) UpdateStatus(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). @@ -177,8 +177,8 @@ func (c *pipelineRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v } // Patch applies the patch and returns the patched pipelineRun. -func (c *pipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.PipelineRun, err error) { - result = &v1alpha2.PipelineRun{} +func (c *pipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PipelineRun, err error) { + result = &v1beta1.PipelineRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelineruns"). diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/task.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go similarity index 82% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/task.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go index bdc655bb45c..7b02a7a6ca7 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/task.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( "time" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,14 +37,14 @@ type TasksGetter interface { // TaskInterface has methods to work with Task resources. type TaskInterface interface { - Create(*v1alpha2.Task) (*v1alpha2.Task, error) - Update(*v1alpha2.Task) (*v1alpha2.Task, error) + Create(*v1beta1.Task) (*v1beta1.Task, error) + Update(*v1beta1.Task) (*v1beta1.Task, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.Task, error) - List(opts v1.ListOptions) (*v1alpha2.TaskList, error) + Get(name string, options v1.GetOptions) (*v1beta1.Task, error) + List(opts v1.ListOptions) (*v1beta1.TaskList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Task, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Task, err error) TaskExpansion } @@ -55,7 +55,7 @@ type tasks struct { } // newTasks returns a Tasks -func newTasks(c *TektonV1alpha2Client, namespace string) *tasks { +func newTasks(c *TektonV1beta1Client, namespace string) *tasks { return &tasks{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newTasks(c *TektonV1alpha2Client, namespace string) *tasks { } // Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *tasks) Get(name string, options v1.GetOptions) (result *v1alpha2.Task, err error) { - result = &v1alpha2.Task{} +func (c *tasks) Get(name string, options v1.GetOptions) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} err = c.client.Get(). Namespace(c.ns). Resource("tasks"). @@ -76,12 +76,12 @@ func (c *tasks) Get(name string, options v1.GetOptions) (result *v1alpha2.Task, } // List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *tasks) List(opts v1.ListOptions) (result *v1alpha2.TaskList, err error) { +func (c *tasks) List(opts v1.ListOptions) (result *v1beta1.TaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.TaskList{} + result = &v1beta1.TaskList{} err = c.client.Get(). Namespace(c.ns). Resource("tasks"). @@ -108,8 +108,8 @@ func (c *tasks) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Create(task *v1alpha2.Task) (result *v1alpha2.Task, err error) { - result = &v1alpha2.Task{} +func (c *tasks) Create(task *v1beta1.Task) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} err = c.client.Post(). Namespace(c.ns). Resource("tasks"). @@ -120,8 +120,8 @@ func (c *tasks) Create(task *v1alpha2.Task) (result *v1alpha2.Task, err error) { } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Update(task *v1alpha2.Task) (result *v1alpha2.Task, err error) { - result = &v1alpha2.Task{} +func (c *tasks) Update(task *v1beta1.Task) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} err = c.client.Put(). Namespace(c.ns). Resource("tasks"). @@ -160,8 +160,8 @@ func (c *tasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListO } // Patch applies the patch and returns the patched task. -func (c *tasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Task, err error) { - result = &v1alpha2.Task{} +func (c *tasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Task, err error) { + result = &v1beta1.Task{} err = c.client.Patch(pt). Namespace(c.ns). Resource("tasks"). diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/taskrun.go b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go similarity index 80% rename from pkg/client/clientset/versioned/typed/pipeline/v1alpha2/taskrun.go rename to pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go index f56e6e50d4b..b3f3018538f 100644 --- a/pkg/client/clientset/versioned/typed/pipeline/v1alpha2/taskrun.go +++ b/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( "time" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,15 +37,15 @@ type TaskRunsGetter interface { // TaskRunInterface has methods to work with TaskRun resources. type TaskRunInterface interface { - Create(*v1alpha2.TaskRun) (*v1alpha2.TaskRun, error) - Update(*v1alpha2.TaskRun) (*v1alpha2.TaskRun, error) - UpdateStatus(*v1alpha2.TaskRun) (*v1alpha2.TaskRun, error) + Create(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) + Update(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) + UpdateStatus(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.TaskRun, error) - List(opts v1.ListOptions) (*v1alpha2.TaskRunList, error) + Get(name string, options v1.GetOptions) (*v1beta1.TaskRun, error) + List(opts v1.ListOptions) (*v1beta1.TaskRunList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.TaskRun, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TaskRun, err error) TaskRunExpansion } @@ -56,7 +56,7 @@ type taskRuns struct { } // newTaskRuns returns a TaskRuns -func newTaskRuns(c *TektonV1alpha2Client, namespace string) *taskRuns { +func newTaskRuns(c *TektonV1beta1Client, namespace string) *taskRuns { return &taskRuns{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newTaskRuns(c *TektonV1alpha2Client, namespace string) *taskRuns { } // Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. -func (c *taskRuns) Get(name string, options v1.GetOptions) (result *v1alpha2.TaskRun, err error) { - result = &v1alpha2.TaskRun{} +func (c *taskRuns) Get(name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} err = c.client.Get(). Namespace(c.ns). Resource("taskruns"). @@ -77,12 +77,12 @@ func (c *taskRuns) Get(name string, options v1.GetOptions) (result *v1alpha2.Tas } // List takes label and field selectors, and returns the list of TaskRuns that match those selectors. -func (c *taskRuns) List(opts v1.ListOptions) (result *v1alpha2.TaskRunList, err error) { +func (c *taskRuns) List(opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.TaskRunList{} + result = &v1beta1.TaskRunList{} err = c.client.Get(). Namespace(c.ns). Resource("taskruns"). @@ -109,8 +109,8 @@ func (c *taskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Create(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, err error) { - result = &v1alpha2.TaskRun{} +func (c *taskRuns) Create(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} err = c.client.Post(). Namespace(c.ns). Resource("taskruns"). @@ -121,8 +121,8 @@ func (c *taskRuns) Create(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, } // Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Update(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, err error) { - result = &v1alpha2.TaskRun{} +func (c *taskRuns) Update(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). @@ -136,8 +136,8 @@ func (c *taskRuns) Update(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *taskRuns) UpdateStatus(taskRun *v1alpha2.TaskRun) (result *v1alpha2.TaskRun, err error) { - result = &v1alpha2.TaskRun{} +func (c *taskRuns) UpdateStatus(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). @@ -177,8 +177,8 @@ func (c *taskRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li } // Patch applies the patch and returns the patched taskRun. -func (c *taskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.TaskRun, err error) { - result = &v1alpha2.TaskRun{} +func (c *taskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TaskRun, err error) { + result = &v1beta1.TaskRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("taskruns"). diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index a57c99d44de..707a9843c8a 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -22,7 +22,7 @@ import ( "fmt" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -67,17 +67,17 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha1.SchemeGroupVersion.WithResource("taskruns"): return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha1().TaskRuns().Informer()}, nil - // Group=tekton.dev, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("clustertasks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha2().ClusterTasks().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("pipelines"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha2().Pipelines().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("pipelineruns"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha2().PipelineRuns().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("tasks"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha2().Tasks().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("taskruns"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1alpha2().TaskRuns().Informer()}, nil + // Group=tekton.dev, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("clustertasks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().ClusterTasks().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("pipelines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Pipelines().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("pipelineruns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().PipelineRuns().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("tasks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().Tasks().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("taskruns"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1beta1().TaskRuns().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/pipeline/interface.go b/pkg/client/informers/externalversions/pipeline/interface.go index 1cd7b1c27b2..ffd05dbcfb1 100644 --- a/pkg/client/informers/externalversions/pipeline/interface.go +++ b/pkg/client/informers/externalversions/pipeline/interface.go @@ -21,15 +21,15 @@ package pipeline import ( internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha1" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface } type group struct { @@ -48,7 +48,7 @@ func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/clustertask.go b/pkg/client/informers/externalversions/pipeline/v1beta1/clustertask.go similarity index 83% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/clustertask.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/clustertask.go index 5fed5cc58fc..58faade858a 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/clustertask.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/clustertask.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( time "time" - pipelinev1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // ClusterTasks. type ClusterTaskInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ClusterTaskLister + Lister() v1beta1.ClusterTaskLister } type clusterTaskInformer struct { @@ -60,16 +60,16 @@ func NewFilteredClusterTaskInformer(client versioned.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().ClusterTasks().List(options) + return client.TektonV1beta1().ClusterTasks().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().ClusterTasks().Watch(options) + return client.TektonV1beta1().ClusterTasks().Watch(options) }, }, - &pipelinev1alpha2.ClusterTask{}, + &pipelinev1beta1.ClusterTask{}, resyncPeriod, indexers, ) @@ -80,9 +80,9 @@ func (f *clusterTaskInformer) defaultInformer(client versioned.Interface, resync } func (f *clusterTaskInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha2.ClusterTask{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.ClusterTask{}, f.defaultInformer) } -func (f *clusterTaskInformer) Lister() v1alpha2.ClusterTaskLister { - return v1alpha2.NewClusterTaskLister(f.Informer().GetIndexer()) +func (f *clusterTaskInformer) Lister() v1beta1.ClusterTaskLister { + return v1beta1.NewClusterTaskLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/interface.go b/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go similarity index 99% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/interface.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/interface.go index c494dbd88f3..b93bb635e08 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/pipeline.go b/pkg/client/informers/externalversions/pipeline/v1beta1/pipeline.go similarity index 84% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/pipeline.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/pipeline.go index 6801a3e82d0..d856526eda9 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/pipeline.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/pipeline.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( time "time" - pipelinev1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // Pipelines. type PipelineInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.PipelineLister + Lister() v1beta1.PipelineLister } type pipelineInformer struct { @@ -61,16 +61,16 @@ func NewFilteredPipelineInformer(client versioned.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().Pipelines(namespace).List(options) + return client.TektonV1beta1().Pipelines(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().Pipelines(namespace).Watch(options) + return client.TektonV1beta1().Pipelines(namespace).Watch(options) }, }, - &pipelinev1alpha2.Pipeline{}, + &pipelinev1beta1.Pipeline{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *pipelineInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *pipelineInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha2.Pipeline{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.Pipeline{}, f.defaultInformer) } -func (f *pipelineInformer) Lister() v1alpha2.PipelineLister { - return v1alpha2.NewPipelineLister(f.Informer().GetIndexer()) +func (f *pipelineInformer) Lister() v1beta1.PipelineLister { + return v1beta1.NewPipelineLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/pipelinerun.go b/pkg/client/informers/externalversions/pipeline/v1beta1/pipelinerun.go similarity index 83% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/pipelinerun.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/pipelinerun.go index 44047dd06f1..6672320d6dd 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/pipelinerun.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/pipelinerun.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( time "time" - pipelinev1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // PipelineRuns. type PipelineRunInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.PipelineRunLister + Lister() v1beta1.PipelineRunLister } type pipelineRunInformer struct { @@ -61,16 +61,16 @@ func NewFilteredPipelineRunInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().PipelineRuns(namespace).List(options) + return client.TektonV1beta1().PipelineRuns(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().PipelineRuns(namespace).Watch(options) + return client.TektonV1beta1().PipelineRuns(namespace).Watch(options) }, }, - &pipelinev1alpha2.PipelineRun{}, + &pipelinev1beta1.PipelineRun{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *pipelineRunInformer) defaultInformer(client versioned.Interface, resync } func (f *pipelineRunInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha2.PipelineRun{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.PipelineRun{}, f.defaultInformer) } -func (f *pipelineRunInformer) Lister() v1alpha2.PipelineRunLister { - return v1alpha2.NewPipelineRunLister(f.Informer().GetIndexer()) +func (f *pipelineRunInformer) Lister() v1beta1.PipelineRunLister { + return v1beta1.NewPipelineRunLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/task.go b/pkg/client/informers/externalversions/pipeline/v1beta1/task.go similarity index 84% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/task.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/task.go index d8bddca6a97..eae8a5daca7 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/task.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/task.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( time "time" - pipelinev1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // Tasks. type TaskInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.TaskLister + Lister() v1beta1.TaskLister } type taskInformer struct { @@ -61,16 +61,16 @@ func NewFilteredTaskInformer(client versioned.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().Tasks(namespace).List(options) + return client.TektonV1beta1().Tasks(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().Tasks(namespace).Watch(options) + return client.TektonV1beta1().Tasks(namespace).Watch(options) }, }, - &pipelinev1alpha2.Task{}, + &pipelinev1beta1.Task{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *taskInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *taskInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha2.Task{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.Task{}, f.defaultInformer) } -func (f *taskInformer) Lister() v1alpha2.TaskLister { - return v1alpha2.NewTaskLister(f.Informer().GetIndexer()) +func (f *taskInformer) Lister() v1beta1.TaskLister { + return v1beta1.NewTaskLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/pipeline/v1alpha2/taskrun.go b/pkg/client/informers/externalversions/pipeline/v1beta1/taskrun.go similarity index 84% rename from pkg/client/informers/externalversions/pipeline/v1alpha2/taskrun.go rename to pkg/client/informers/externalversions/pipeline/v1beta1/taskrun.go index 614ff931881..4bed6732367 100644 --- a/pkg/client/informers/externalversions/pipeline/v1alpha2/taskrun.go +++ b/pkg/client/informers/externalversions/pipeline/v1beta1/taskrun.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( time "time" - pipelinev1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // TaskRuns. type TaskRunInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.TaskRunLister + Lister() v1beta1.TaskRunLister } type taskRunInformer struct { @@ -61,16 +61,16 @@ func NewFilteredTaskRunInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().TaskRuns(namespace).List(options) + return client.TektonV1beta1().TaskRuns(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.TektonV1alpha2().TaskRuns(namespace).Watch(options) + return client.TektonV1beta1().TaskRuns(namespace).Watch(options) }, }, - &pipelinev1alpha2.TaskRun{}, + &pipelinev1beta1.TaskRun{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *taskRunInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *taskRunInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&pipelinev1alpha2.TaskRun{}, f.defaultInformer) + return f.factory.InformerFor(&pipelinev1beta1.TaskRun{}, f.defaultInformer) } -func (f *taskRunInformer) Lister() v1alpha2.TaskRunLister { - return v1alpha2.NewTaskRunLister(f.Informer().GetIndexer()) +func (f *taskRunInformer) Lister() v1beta1.TaskRunLister { + return v1beta1.NewTaskRunLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/clustertask/clustertask.go b/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go similarity index 80% rename from pkg/client/injection/informers/pipeline/v1alpha2/clustertask/clustertask.go rename to pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go index f99f39a8fde..6b3e61e835e 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/clustertask/clustertask.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/clustertask/clustertask.go @@ -21,7 +21,7 @@ package clustertask import ( "context" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Tekton().V1alpha2().ClusterTasks() + inf := f.Tekton().V1beta1().ClusterTasks() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1alpha2.ClusterTaskInformer { +func Get(ctx context.Context) v1beta1.ClusterTaskInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2.ClusterTaskInformer from context.") + "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.ClusterTaskInformer from context.") } - return untyped.(v1alpha2.ClusterTaskInformer) + return untyped.(v1beta1.ClusterTaskInformer) } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/clustertask/fake/fake.go b/pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/pipeline/v1alpha2/clustertask/fake/fake.go rename to pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake/fake.go index 241415d5657..7e9896dd41d 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/clustertask/fake/fake.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/clustertask/fake/fake.go @@ -22,7 +22,7 @@ import ( "context" fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - clustertask "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha2/clustertask" + clustertask "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/clustertask" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Tekton().V1alpha2().ClusterTasks() + inf := f.Tekton().V1beta1().ClusterTasks() return context.WithValue(ctx, clustertask.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/pipeline/fake/fake.go b/pkg/client/injection/informers/pipeline/v1beta1/pipeline/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/pipeline/v1alpha2/pipeline/fake/fake.go rename to pkg/client/injection/informers/pipeline/v1beta1/pipeline/fake/fake.go index 946e54037a7..3b0460cff1a 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/pipeline/fake/fake.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/pipeline/fake/fake.go @@ -22,7 +22,7 @@ import ( "context" fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - pipeline "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha2/pipeline" + pipeline "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipeline" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Tekton().V1alpha2().Pipelines() + inf := f.Tekton().V1beta1().Pipelines() return context.WithValue(ctx, pipeline.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/pipeline/pipeline.go b/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go similarity index 81% rename from pkg/client/injection/informers/pipeline/v1alpha2/pipeline/pipeline.go rename to pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go index ff19269f11d..48afd99ddb7 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/pipeline/pipeline.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/pipeline/pipeline.go @@ -21,7 +21,7 @@ package pipeline import ( "context" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Tekton().V1alpha2().Pipelines() + inf := f.Tekton().V1beta1().Pipelines() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1alpha2.PipelineInformer { +func Get(ctx context.Context) v1beta1.PipelineInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2.PipelineInformer from context.") + "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.PipelineInformer from context.") } - return untyped.(v1alpha2.PipelineInformer) + return untyped.(v1beta1.PipelineInformer) } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/fake/fake.go b/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/fake/fake.go rename to pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/fake/fake.go index 995fffc705a..6170db795b8 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/fake/fake.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/fake/fake.go @@ -22,7 +22,7 @@ import ( "context" fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - pipelinerun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun" + pipelinerun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Tekton().V1alpha2().PipelineRuns() + inf := f.Tekton().V1beta1().PipelineRuns() return context.WithValue(ctx, pipelinerun.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/pipelinerun.go b/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go similarity index 80% rename from pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/pipelinerun.go rename to pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go index 8c18696bfab..0b3fc8e1c97 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/pipelinerun/pipelinerun.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/pipelinerun/pipelinerun.go @@ -21,7 +21,7 @@ package pipelinerun import ( "context" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Tekton().V1alpha2().PipelineRuns() + inf := f.Tekton().V1beta1().PipelineRuns() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1alpha2.PipelineRunInformer { +func Get(ctx context.Context) v1beta1.PipelineRunInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2.PipelineRunInformer from context.") + "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.PipelineRunInformer from context.") } - return untyped.(v1alpha2.PipelineRunInformer) + return untyped.(v1beta1.PipelineRunInformer) } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/task/fake/fake.go b/pkg/client/injection/informers/pipeline/v1beta1/task/fake/fake.go similarity index 94% rename from pkg/client/injection/informers/pipeline/v1alpha2/task/fake/fake.go rename to pkg/client/injection/informers/pipeline/v1beta1/task/fake/fake.go index 675368cd38c..9efa956eb22 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/task/fake/fake.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/task/fake/fake.go @@ -22,7 +22,7 @@ import ( "context" fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - task "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha2/task" + task "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/task" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Tekton().V1alpha2().Tasks() + inf := f.Tekton().V1beta1().Tasks() return context.WithValue(ctx, task.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/task/task.go b/pkg/client/injection/informers/pipeline/v1beta1/task/task.go similarity index 82% rename from pkg/client/injection/informers/pipeline/v1alpha2/task/task.go rename to pkg/client/injection/informers/pipeline/v1beta1/task/task.go index ee1f1c3ec0e..c38102ddb32 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/task/task.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/task/task.go @@ -21,7 +21,7 @@ package task import ( "context" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Tekton().V1alpha2().Tasks() + inf := f.Tekton().V1beta1().Tasks() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1alpha2.TaskInformer { +func Get(ctx context.Context) v1beta1.TaskInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2.TaskInformer from context.") + "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.TaskInformer from context.") } - return untyped.(v1alpha2.TaskInformer) + return untyped.(v1beta1.TaskInformer) } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/taskrun/fake/fake.go b/pkg/client/injection/informers/pipeline/v1beta1/taskrun/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/pipeline/v1alpha2/taskrun/fake/fake.go rename to pkg/client/injection/informers/pipeline/v1beta1/taskrun/fake/fake.go index 33ea930befa..ab9ffbda40d 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/taskrun/fake/fake.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/taskrun/fake/fake.go @@ -22,7 +22,7 @@ import ( "context" fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake" - taskrun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1alpha2/taskrun" + taskrun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1beta1/taskrun" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Tekton().V1alpha2().TaskRuns() + inf := f.Tekton().V1beta1().TaskRuns() return context.WithValue(ctx, taskrun.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/pipeline/v1alpha2/taskrun/taskrun.go b/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go similarity index 81% rename from pkg/client/injection/informers/pipeline/v1alpha2/taskrun/taskrun.go rename to pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go index 52addcae9c7..943f7eb108c 100644 --- a/pkg/client/injection/informers/pipeline/v1alpha2/taskrun/taskrun.go +++ b/pkg/client/injection/informers/pipeline/v1beta1/taskrun/taskrun.go @@ -21,7 +21,7 @@ package taskrun import ( "context" - v1alpha2 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1" factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Tekton().V1alpha2().TaskRuns() + inf := f.Tekton().V1beta1().TaskRuns() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1alpha2.TaskRunInformer { +func Get(ctx context.Context) v1beta1.TaskRunInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1alpha2.TaskRunInformer from context.") + "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1beta1.TaskRunInformer from context.") } - return untyped.(v1alpha2.TaskRunInformer) + return untyped.(v1beta1.TaskRunInformer) } diff --git a/pkg/client/listers/pipeline/v1alpha2/clustertask.go b/pkg/client/listers/pipeline/v1beta1/clustertask.go similarity index 77% rename from pkg/client/listers/pipeline/v1alpha2/clustertask.go rename to pkg/client/listers/pipeline/v1beta1/clustertask.go index e71fbe7492a..73388bd7e6a 100644 --- a/pkg/client/listers/pipeline/v1alpha2/clustertask.go +++ b/pkg/client/listers/pipeline/v1beta1/clustertask.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,9 +28,9 @@ import ( // ClusterTaskLister helps list ClusterTasks. type ClusterTaskLister interface { // List lists all ClusterTasks in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.ClusterTask, err error) + List(selector labels.Selector) (ret []*v1beta1.ClusterTask, err error) // Get retrieves the ClusterTask from the index for a given name. - Get(name string) (*v1alpha2.ClusterTask, error) + Get(name string) (*v1beta1.ClusterTask, error) ClusterTaskListerExpansion } @@ -45,21 +45,21 @@ func NewClusterTaskLister(indexer cache.Indexer) ClusterTaskLister { } // List lists all ClusterTasks in the indexer. -func (s *clusterTaskLister) List(selector labels.Selector) (ret []*v1alpha2.ClusterTask, err error) { +func (s *clusterTaskLister) List(selector labels.Selector) (ret []*v1beta1.ClusterTask, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ClusterTask)) + ret = append(ret, m.(*v1beta1.ClusterTask)) }) return ret, err } // Get retrieves the ClusterTask from the index for a given name. -func (s *clusterTaskLister) Get(name string) (*v1alpha2.ClusterTask, error) { +func (s *clusterTaskLister) Get(name string) (*v1beta1.ClusterTask, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("clustertask"), name) + return nil, errors.NewNotFound(v1beta1.Resource("clustertask"), name) } - return obj.(*v1alpha2.ClusterTask), nil + return obj.(*v1beta1.ClusterTask), nil } diff --git a/pkg/client/listers/pipeline/v1alpha2/expansion_generated.go b/pkg/client/listers/pipeline/v1beta1/expansion_generated.go similarity index 99% rename from pkg/client/listers/pipeline/v1alpha2/expansion_generated.go rename to pkg/client/listers/pipeline/v1beta1/expansion_generated.go index 19d3ffa1bc9..ca23ad825cf 100644 --- a/pkg/client/listers/pipeline/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/pipeline/v1beta1/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 // ClusterTaskListerExpansion allows custom methods to be added to // ClusterTaskLister. diff --git a/pkg/client/listers/pipeline/v1alpha2/pipeline.go b/pkg/client/listers/pipeline/v1beta1/pipeline.go similarity index 80% rename from pkg/client/listers/pipeline/v1alpha2/pipeline.go rename to pkg/client/listers/pipeline/v1beta1/pipeline.go index 5fa74362ac4..f35adf32a1d 100644 --- a/pkg/client/listers/pipeline/v1alpha2/pipeline.go +++ b/pkg/client/listers/pipeline/v1beta1/pipeline.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // PipelineLister helps list Pipelines. type PipelineLister interface { // List lists all Pipelines in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.Pipeline, err error) + List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) // Pipelines returns an object that can list and get Pipelines. Pipelines(namespace string) PipelineNamespaceLister PipelineListerExpansion @@ -45,9 +45,9 @@ func NewPipelineLister(indexer cache.Indexer) PipelineLister { } // List lists all Pipelines in the indexer. -func (s *pipelineLister) List(selector labels.Selector) (ret []*v1alpha2.Pipeline, err error) { +func (s *pipelineLister) List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Pipeline)) + ret = append(ret, m.(*v1beta1.Pipeline)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *pipelineLister) Pipelines(namespace string) PipelineNamespaceLister { // PipelineNamespaceLister helps list and get Pipelines. type PipelineNamespaceLister interface { // List lists all Pipelines in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha2.Pipeline, err error) + List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) // Get retrieves the Pipeline from the indexer for a given namespace and name. - Get(name string) (*v1alpha2.Pipeline, error) + Get(name string) (*v1beta1.Pipeline, error) PipelineNamespaceListerExpansion } @@ -74,21 +74,21 @@ type pipelineNamespaceLister struct { } // List lists all Pipelines in the indexer for a given namespace. -func (s pipelineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Pipeline, err error) { +func (s pipelineNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Pipeline, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Pipeline)) + ret = append(ret, m.(*v1beta1.Pipeline)) }) return ret, err } // Get retrieves the Pipeline from the indexer for a given namespace and name. -func (s pipelineNamespaceLister) Get(name string) (*v1alpha2.Pipeline, error) { +func (s pipelineNamespaceLister) Get(name string) (*v1beta1.Pipeline, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("pipeline"), name) + return nil, errors.NewNotFound(v1beta1.Resource("pipeline"), name) } - return obj.(*v1alpha2.Pipeline), nil + return obj.(*v1beta1.Pipeline), nil } diff --git a/pkg/client/listers/pipeline/v1alpha2/pipelinerun.go b/pkg/client/listers/pipeline/v1beta1/pipelinerun.go similarity index 80% rename from pkg/client/listers/pipeline/v1alpha2/pipelinerun.go rename to pkg/client/listers/pipeline/v1beta1/pipelinerun.go index c83afb1a6d1..29eb1f86df4 100644 --- a/pkg/client/listers/pipeline/v1alpha2/pipelinerun.go +++ b/pkg/client/listers/pipeline/v1beta1/pipelinerun.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // PipelineRunLister helps list PipelineRuns. type PipelineRunLister interface { // List lists all PipelineRuns in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.PipelineRun, err error) + List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) // PipelineRuns returns an object that can list and get PipelineRuns. PipelineRuns(namespace string) PipelineRunNamespaceLister PipelineRunListerExpansion @@ -45,9 +45,9 @@ func NewPipelineRunLister(indexer cache.Indexer) PipelineRunLister { } // List lists all PipelineRuns in the indexer. -func (s *pipelineRunLister) List(selector labels.Selector) (ret []*v1alpha2.PipelineRun, err error) { +func (s *pipelineRunLister) List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.PipelineRun)) + ret = append(ret, m.(*v1beta1.PipelineRun)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *pipelineRunLister) PipelineRuns(namespace string) PipelineRunNamespaceL // PipelineRunNamespaceLister helps list and get PipelineRuns. type PipelineRunNamespaceLister interface { // List lists all PipelineRuns in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha2.PipelineRun, err error) + List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) // Get retrieves the PipelineRun from the indexer for a given namespace and name. - Get(name string) (*v1alpha2.PipelineRun, error) + Get(name string) (*v1beta1.PipelineRun, error) PipelineRunNamespaceListerExpansion } @@ -74,21 +74,21 @@ type pipelineRunNamespaceLister struct { } // List lists all PipelineRuns in the indexer for a given namespace. -func (s pipelineRunNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.PipelineRun, err error) { +func (s pipelineRunNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.PipelineRun, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.PipelineRun)) + ret = append(ret, m.(*v1beta1.PipelineRun)) }) return ret, err } // Get retrieves the PipelineRun from the indexer for a given namespace and name. -func (s pipelineRunNamespaceLister) Get(name string) (*v1alpha2.PipelineRun, error) { +func (s pipelineRunNamespaceLister) Get(name string) (*v1beta1.PipelineRun, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("pipelinerun"), name) + return nil, errors.NewNotFound(v1beta1.Resource("pipelinerun"), name) } - return obj.(*v1alpha2.PipelineRun), nil + return obj.(*v1beta1.PipelineRun), nil } diff --git a/pkg/client/listers/pipeline/v1alpha2/task.go b/pkg/client/listers/pipeline/v1beta1/task.go similarity index 78% rename from pkg/client/listers/pipeline/v1alpha2/task.go rename to pkg/client/listers/pipeline/v1beta1/task.go index 9b8b2ee73eb..fa6284eeb04 100644 --- a/pkg/client/listers/pipeline/v1alpha2/task.go +++ b/pkg/client/listers/pipeline/v1beta1/task.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // TaskLister helps list Tasks. type TaskLister interface { // List lists all Tasks in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.Task, err error) + List(selector labels.Selector) (ret []*v1beta1.Task, err error) // Tasks returns an object that can list and get Tasks. Tasks(namespace string) TaskNamespaceLister TaskListerExpansion @@ -45,9 +45,9 @@ func NewTaskLister(indexer cache.Indexer) TaskLister { } // List lists all Tasks in the indexer. -func (s *taskLister) List(selector labels.Selector) (ret []*v1alpha2.Task, err error) { +func (s *taskLister) List(selector labels.Selector) (ret []*v1beta1.Task, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Task)) + ret = append(ret, m.(*v1beta1.Task)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *taskLister) Tasks(namespace string) TaskNamespaceLister { // TaskNamespaceLister helps list and get Tasks. type TaskNamespaceLister interface { // List lists all Tasks in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha2.Task, err error) + List(selector labels.Selector) (ret []*v1beta1.Task, err error) // Get retrieves the Task from the indexer for a given namespace and name. - Get(name string) (*v1alpha2.Task, error) + Get(name string) (*v1beta1.Task, error) TaskNamespaceListerExpansion } @@ -74,21 +74,21 @@ type taskNamespaceLister struct { } // List lists all Tasks in the indexer for a given namespace. -func (s taskNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Task, err error) { +func (s taskNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Task, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Task)) + ret = append(ret, m.(*v1beta1.Task)) }) return ret, err } // Get retrieves the Task from the indexer for a given namespace and name. -func (s taskNamespaceLister) Get(name string) (*v1alpha2.Task, error) { +func (s taskNamespaceLister) Get(name string) (*v1beta1.Task, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("task"), name) + return nil, errors.NewNotFound(v1beta1.Resource("task"), name) } - return obj.(*v1alpha2.Task), nil + return obj.(*v1beta1.Task), nil } diff --git a/pkg/client/listers/pipeline/v1alpha2/taskrun.go b/pkg/client/listers/pipeline/v1beta1/taskrun.go similarity index 80% rename from pkg/client/listers/pipeline/v1alpha2/taskrun.go rename to pkg/client/listers/pipeline/v1beta1/taskrun.go index 53302307ef6..eff83408030 100644 --- a/pkg/client/listers/pipeline/v1alpha2/taskrun.go +++ b/pkg/client/listers/pipeline/v1beta1/taskrun.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - v1alpha2 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // TaskRunLister helps list TaskRuns. type TaskRunLister interface { // List lists all TaskRuns in the indexer. - List(selector labels.Selector) (ret []*v1alpha2.TaskRun, err error) + List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) // TaskRuns returns an object that can list and get TaskRuns. TaskRuns(namespace string) TaskRunNamespaceLister TaskRunListerExpansion @@ -45,9 +45,9 @@ func NewTaskRunLister(indexer cache.Indexer) TaskRunLister { } // List lists all TaskRuns in the indexer. -func (s *taskRunLister) List(selector labels.Selector) (ret []*v1alpha2.TaskRun, err error) { +func (s *taskRunLister) List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TaskRun)) + ret = append(ret, m.(*v1beta1.TaskRun)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *taskRunLister) TaskRuns(namespace string) TaskRunNamespaceLister { // TaskRunNamespaceLister helps list and get TaskRuns. type TaskRunNamespaceLister interface { // List lists all TaskRuns in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha2.TaskRun, err error) + List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) // Get retrieves the TaskRun from the indexer for a given namespace and name. - Get(name string) (*v1alpha2.TaskRun, error) + Get(name string) (*v1beta1.TaskRun, error) TaskRunNamespaceListerExpansion } @@ -74,21 +74,21 @@ type taskRunNamespaceLister struct { } // List lists all TaskRuns in the indexer for a given namespace. -func (s taskRunNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.TaskRun, err error) { +func (s taskRunNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.TaskRun, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TaskRun)) + ret = append(ret, m.(*v1beta1.TaskRun)) }) return ret, err } // Get retrieves the TaskRun from the indexer for a given namespace and name. -func (s taskRunNamespaceLister) Get(name string) (*v1alpha2.TaskRun, error) { +func (s taskRunNamespaceLister) Get(name string) (*v1beta1.TaskRun, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("taskrun"), name) + return nil, errors.NewNotFound(v1beta1.Resource("taskrun"), name) } - return obj.(*v1alpha2.TaskRun), nil + return obj.(*v1beta1.TaskRun), nil } diff --git a/pkg/pod/pod_test.go b/pkg/pod/pod_test.go index 5ee55acb30c..254c55e7912 100644 --- a/pkg/pod/pod_test.go +++ b/pkg/pod/pod_test.go @@ -25,7 +25,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/system" "github.com/tektoncd/pipeline/test/names" corev1 "k8s.io/api/core/v1" @@ -79,7 +79,7 @@ func TestMakePod(t *testing.T) { wantAnnotations map[string]string }{{ desc: "simple", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "name", Image: "image", @@ -115,7 +115,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "with service account", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "name", Image: "image", @@ -169,7 +169,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "with-pod-template", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "name", Image: "image", @@ -237,7 +237,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "very long step name", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters", Image: "image", @@ -273,7 +273,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "step name ends with non alphanumeric", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "ends-with-invalid-%%__$$", Image: "image", @@ -309,7 +309,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "workingDir in workspace", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "name", Image: "image", @@ -355,7 +355,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "sidecar container", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "primary-name", Image: "primary-image", @@ -404,7 +404,7 @@ func TestMakePod(t *testing.T) { }, }, { desc: "sidecar container with script", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "primary-name", Image: "primary-image", @@ -471,7 +471,7 @@ sidecar-script-heredoc-randomly-generated-mz4c7 }, }, { desc: "resource request", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -553,7 +553,7 @@ sidecar-script-heredoc-randomly-generated-mz4c7 }, }, { desc: "step with script and stepTemplate", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ Env: []corev1.EnvVar{{Name: "FOO", Value: "bar"}}, Args: []string{"template", "args"}, @@ -681,7 +681,7 @@ script-heredoc-randomly-generated-78c5n }, { desc: "using another scheduler", ts: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{ { Container: corev1.Container{ diff --git a/pkg/reconciler/pipelinerun/pipelinerun.go b/pkg/reconciler/pipelinerun/pipelinerun.go index 98749f8eb37..cbd410d0e09 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun.go +++ b/pkg/reconciler/pipelinerun/pipelinerun.go @@ -27,7 +27,7 @@ import ( apisconfig "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/artifacts" listers "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" resourcelisters "github.com/tektoncd/pipeline/pkg/client/resource/listers/resource/v1alpha1" @@ -236,8 +236,8 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1alpha1.PipelineRun) er // and may not have had all of the assumed default specified. pr.SetDefaults(contexts.WithUpgradeViaDefaulting(ctx)) - if err := pr.ConvertUp(ctx, &v1alpha2.PipelineRun{}); err != nil { - if ce, ok := err.(*v1alpha2.CannotConvertError); ok { + if err := pr.ConvertUp(ctx, &v1beta1.PipelineRun{}); err != nil { + if ce, ok := err.(*v1beta1.CannotConvertError); ok { pr.Status.MarkResourceNotConvertible(ce) return nil } @@ -247,7 +247,7 @@ func (c *Reconciler) reconcile(ctx context.Context, pr *v1alpha1.PipelineRun) er getPipelineFunc := c.getPipelineFunc(pr) pipelineMeta, pipelineSpec, err := resources.GetPipelineData(ctx, pr, getPipelineFunc) if err != nil { - if ce, ok := err.(*v1alpha2.CannotConvertError); ok { + if ce, ok := err.(*v1beta1.CannotConvertError); ok { pr.Status.MarkResourceNotConvertible(ce) return nil } @@ -733,7 +733,7 @@ func (c *Reconciler) makeConditionCheckContainer(rprt *resources.ResolvedPipelin TaskSpec: taskSpec, ServiceAccountName: pr.GetServiceAccountName(rprt.PipelineTask.Name), Params: rcc.PipelineTaskCondition.Params, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: rcc.ToTaskResourceBindings(), }, Timeout: getTaskRunTimeout(pr, rprt), diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index d3710d74b7f..01da170c50b 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -27,7 +27,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/resources" taskrunresources "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing" @@ -295,7 +295,7 @@ func TestReconcile_PipelineSpecTaskSpec(t *testing.T) { ps := []*v1alpha1.Pipeline{ tb.Pipeline("test-pipeline", "foo", tb.PipelineSpec( - tb.PipelineTask("unit-test-task-spec", "", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + tb.PipelineTask("unit-test-task-spec", "", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "mystep", Image: "myimage"}}}, diff --git a/pkg/reconciler/pipelinerun/resources/conditionresolution.go b/pkg/reconciler/pipelinerun/resources/conditionresolution.go index 3294da25277..52ba82a8917 100644 --- a/pkg/reconciler/pipelinerun/resources/conditionresolution.go +++ b/pkg/reconciler/pipelinerun/resources/conditionresolution.go @@ -22,7 +22,7 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource" resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" corev1 "k8s.io/api/core/v1" @@ -99,7 +99,7 @@ func (rcc *ResolvedConditionCheck) ConditionToTaskSpec() (*v1alpha1.TaskSpec, er } t := &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{rcc.Condition.Spec.Check}, }, } diff --git a/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go b/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go index 80aec7f805d..c898478c8a7 100644 --- a/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" tb "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -196,7 +196,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { tb.ConditionSpecCheck("foo", "ubuntu"), )), want: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "foo", Image: "ubuntu", @@ -210,7 +210,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { tb.ConditionSpecCheck("", "ubuntu"), )), want: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "condition-check-bar", Image: "ubuntu", @@ -227,7 +227,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { tb.ConditionParamSpec("img", v1alpha1.ParamTypeString), )), want: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "$(inputs.params.name)", Image: "$(inputs.params.img)", @@ -258,7 +258,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { )), }, want: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "name", Image: "ubuntu", diff --git a/pkg/reconciler/pipelinerun/resources/input_output_steps.go b/pkg/reconciler/pipelinerun/resources/input_output_steps.go index eec7460b67c..0079f7b1b5d 100644 --- a/pkg/reconciler/pipelinerun/resources/input_output_steps.go +++ b/pkg/reconciler/pipelinerun/resources/input_output_steps.go @@ -20,7 +20,7 @@ import ( "path/filepath" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" ) // GetOutputSteps will add the correct `path` to the output resources for pt @@ -103,7 +103,7 @@ func WrapSteps(tr *v1alpha1.TaskRunSpec, pt *v1alpha1.PipelineTask, inputs, outp return } if tr.Resources == nil { - tr.Resources = &v1alpha2.TaskRunResources{} + tr.Resources = &v1beta1.TaskRunResources{} } if pt.Resources != nil { // Add presteps to setup updated input diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go index bc7fdc2a05b..f3025f20541 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go @@ -27,7 +27,7 @@ import ( "knative.dev/pkg/apis" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" "github.com/tektoncd/pipeline/pkg/list" "github.com/tektoncd/pipeline/pkg/names" @@ -321,7 +321,7 @@ func ResolvePipelineRun( spec = *pt.TaskSpec } spec.SetDefaults(contexts.WithUpgradeViaDefaulting(ctx)) - if err := spec.ConvertUp(ctx, &v1alpha2.TaskSpec{}); err != nil { + if err := spec.ConvertUp(ctx, &v1beta1.TaskSpec{}); err != nil { return nil, err } rtr, err := ResolvePipelineTaskResources(pt, &spec, taskName, kind, providedResources) diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go index bdcb40fe8bc..fbb638a4f3a 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go @@ -25,7 +25,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/pipeline/dag" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" tb "github.com/tektoncd/pipeline/test/builder" @@ -93,7 +93,7 @@ var task = &v1alpha1.Task{ ObjectMeta: metav1.ObjectMeta{ Name: "task", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, @@ -104,7 +104,7 @@ var clustertask = &v1alpha1.ClusterTask{ ObjectMeta: metav1.ObjectMeta{ Name: "clustertask", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, @@ -459,7 +459,7 @@ var taskWithOptionalResourcesDeprecated = &v1alpha1.Task{ Name: "task", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, @@ -492,12 +492,12 @@ var taskWithOptionalResources = &v1alpha1.Task{ Name: "task", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, - Resources: &v1alpha2.TaskResources{ - Inputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ + Resources: &v1beta1.TaskResources{ + Inputs: []v1beta1.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "optional-input", Type: "git", Optional: true, @@ -506,7 +506,7 @@ var taskWithOptionalResources = &v1alpha1.Task{ Type: "git", Optional: false, }}}, - Outputs: []v1alpha2.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ + Outputs: []v1beta1.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "optional-output", Type: "git", Optional: true, @@ -1187,7 +1187,7 @@ func TestResolvePipelineRun(t *testing.T) { tb.PipelineTaskOutputResource("output1", "git-resource"), ), tb.PipelineTask("mytask4", "", - tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, diff --git a/pkg/reconciler/pipelinerun/resources/pipelinespec.go b/pkg/reconciler/pipelinerun/resources/pipelinespec.go index c3bc2845e1b..46b1f1e917d 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinespec.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinespec.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -44,7 +44,7 @@ func GetPipelineData(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, get pipelineMeta = t.PipelineMetadata() pipelineSpec = t.PipelineSpec() - if err := pipelineSpec.ConvertUp(ctx, &v1alpha2.PipelineSpec{}); err != nil { + if err := pipelineSpec.ConvertUp(ctx, &v1beta1.PipelineSpec{}); err != nil { return nil, nil, err } case pipelineRun.Spec.PipelineSpec != nil: diff --git a/pkg/reconciler/taskrun/resources/apply_test.go b/pkg/reconciler/taskrun/resources/apply_test.go index 65cbf7da3bf..24c7224601f 100644 --- a/pkg/reconciler/taskrun/resources/apply_test.go +++ b/pkg/reconciler/taskrun/resources/apply_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" "github.com/tektoncd/pipeline/test/builder" @@ -46,7 +46,7 @@ var ( } simpleTaskSpec = &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Sidecars: []v1alpha1.Sidecar{{ Container: corev1.Container{ Name: "foo", @@ -160,7 +160,7 @@ var ( }, }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "workspace", @@ -182,13 +182,13 @@ var ( } gcsTaskSpec = &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "foobar", Image: "someImage", Args: []string{"$(outputs.resources.bucket.path)"}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "bucket", @@ -198,7 +198,7 @@ var ( }, } - arrayParamTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + arrayParamTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "simple-image", Image: "some-image", @@ -210,7 +210,7 @@ var ( }}}, }} - arrayAndStringParamTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + arrayAndStringParamTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "simple-image", Image: "some-image", @@ -222,7 +222,7 @@ var ( }}}, }} - multipleArrayParamsTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + multipleArrayParamsTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "simple-image", Image: "some-image", @@ -234,7 +234,7 @@ var ( }}}, }} - multipleArrayAndStringsParamsTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + multipleArrayAndStringsParamsTaskSpec = &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "simple-image", Image: "image-$(inputs.params.string-param2)", @@ -604,7 +604,7 @@ func TestApplyResources(t *testing.T) { func TestApplyWorkspaces(t *testing.T) { names.TestingSeed() - ts := &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts := &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ Env: []corev1.EnvVar{{ Name: "template-var", @@ -715,7 +715,7 @@ func TestApplyWorkspaces(t *testing.T) { func TestTaskResults(t *testing.T) { names.TestingSeed() - ts := &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts := &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Results: []v1alpha1.TaskResult{{ Name: "current-date-unix-timestamp", Description: "The current date in unix timestamp format", diff --git a/pkg/reconciler/taskrun/resources/image_exporter_test.go b/pkg/reconciler/taskrun/resources/image_exporter_test.go index a9ba08e2526..7551b411754 100644 --- a/pkg/reconciler/taskrun/resources/image_exporter_test.go +++ b/pkg/reconciler/taskrun/resources/image_exporter_test.go @@ -21,7 +21,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/names" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,11 +41,11 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-image", @@ -68,7 +68,7 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-image", @@ -105,13 +105,13 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}, {Container: corev1.Container{ Name: "step2", }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-image", @@ -134,7 +134,7 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-image", diff --git a/pkg/reconciler/taskrun/resources/input_resource_test.go b/pkg/reconciler/taskrun/resources/input_resource_test.go index d4a27ecb7fd..89f5a6bb493 100644 --- a/pkg/reconciler/taskrun/resources/input_resource_test.go +++ b/pkg/reconciler/taskrun/resources/input_resource_test.go @@ -22,7 +22,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource" "github.com/tektoncd/pipeline/pkg/artifacts" "github.com/tektoncd/pipeline/pkg/logging" @@ -281,8 +281,8 @@ func TestAddResourceToTask(t *testing.T) { Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }}, @@ -292,8 +292,8 @@ func TestAddResourceToTask(t *testing.T) { Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: multipleGitInputs, }, }}, @@ -303,8 +303,8 @@ func TestAddResourceToTask(t *testing.T) { Name: "task-with-targetpath", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gcsInputs, }, }}, @@ -314,8 +314,8 @@ func TestAddResourceToTask(t *testing.T) { Name: "build-from-repo-with-optional-source", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: optionalGitInputs, }, }}, @@ -330,7 +330,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -355,7 +355,7 @@ func TestAddResourceToTask(t *testing.T) { taskRun: taskRun, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-9l9zj", Image: "override-with-git:latest", @@ -364,7 +364,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -381,7 +381,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -395,7 +395,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", @@ -404,7 +404,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git-with-branch"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -421,7 +421,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -442,7 +442,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-with-branch-mz4c7", Image: "override-with-git:latest", @@ -458,7 +458,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git-with-branch"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: multipleGitInputs, }, }, @@ -475,7 +475,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -489,7 +489,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-9l9zj", Image: "override-with-git:latest", @@ -498,7 +498,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -515,7 +515,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -529,7 +529,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", @@ -538,7 +538,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git-with-branch"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -556,7 +556,7 @@ func TestAddResourceToTask(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -571,7 +571,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "create-dir-gitspace-mz4c7", Image: "busybox", @@ -588,7 +588,7 @@ func TestAddResourceToTask(t *testing.T) { PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: "pipelinerun-pvc"}, }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -605,7 +605,7 @@ func TestAddResourceToTask(t *testing.T) { TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -619,7 +619,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-with-sslVerify-false-9l9zj", Image: "override-with-git:latest", @@ -628,7 +628,7 @@ func TestAddResourceToTask(t *testing.T) { WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git-with-sslVerify-false"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }, @@ -642,7 +642,7 @@ func TestAddResourceToTask(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -656,7 +656,7 @@ func TestAddResourceToTask(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "create-dir-storage1-9l9zj", Image: "busybox", @@ -674,7 +674,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Image: "google/cloud-sdk", }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gcsInputs, }, }, @@ -692,7 +692,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -707,7 +707,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "create-dir-workspace-mz4c7", Image: "busybox", @@ -724,7 +724,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: "pipelinerun-pvc"}, }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gcsInputs, }, }, @@ -738,7 +738,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -760,7 +760,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -780,8 +780,8 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "workspace-invalid", @@ -799,8 +799,8 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: clusterInputs, }, }}, @@ -814,7 +814,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir TaskRef: &v1alpha1.TaskRef{ Name: "build-from-repo", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "target-cluster", @@ -828,7 +828,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "kubeconfig-9l9zj", Image: "override-with-kubeconfig-writer:latest", @@ -837,7 +837,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir "-clusterConfig", `{"name":"cluster3","type":"cluster","url":"http://10.10.10.10","revision":"","username":"","password":"","namespace":"namespace1","token":"","Insecure":false,"cadata":"bXktY2EtY2VydAo=","secrets":null}`, }, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: clusterInputs, }, }, @@ -849,8 +849,8 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: clusterInputs, }, }}, @@ -864,7 +864,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir TaskRef: &v1alpha1.TaskRef{ Name: "build-from-repo", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "target-cluster", @@ -878,7 +878,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "kubeconfig-9l9zj", Image: "override-with-kubeconfig-writer:latest", @@ -898,7 +898,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir Name: "CADATA", }}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: clusterInputs, }, }, @@ -915,7 +915,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir TaskRef: &v1alpha1.TaskRef{ Name: "simpleTask", }, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -929,7 +929,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", @@ -938,7 +938,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir WorkingDir: "/workspace", Env: []corev1.EnvVar{{Name: "TEKTON_RESOURCE_NAME", Value: "the-git-with-branch"}}, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: optionalGitInputs, }, }, @@ -985,8 +985,8 @@ func TestStorageInputResource(t *testing.T) { }{{ desc: "inputs with no resource spec and resource ref", task: &v1alpha1.Task{ - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "gcs-input-resource", @@ -1001,7 +1001,7 @@ func TestStorageInputResource(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "gcs-input-resource", @@ -1014,8 +1014,8 @@ func TestStorageInputResource(t *testing.T) { }, { desc: "inputs with resource spec and no resource ref", task: &v1alpha1.Task{ - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gcsStorageInputs, }, }}, @@ -1026,7 +1026,7 @@ func TestStorageInputResource(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "gcs-input-resource", @@ -1047,7 +1047,7 @@ func TestStorageInputResource(t *testing.T) { }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "create-dir-gcs-input-resource-9l9zj", Image: "busybox", @@ -1065,7 +1065,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource Image: "google/cloud-sdk", }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gcsStorageInputs, }, }, @@ -1093,8 +1093,8 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource Name: "get-storage", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gcsStorageInputs, }, }}, @@ -1105,7 +1105,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "gcs-input-resource", @@ -1119,7 +1119,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "create-dir-storage-gcs-keys-9l9zj", Image: "busybox", @@ -1143,7 +1143,7 @@ gsutil rsync -d -r gs://fake-bucket/rules.zip /workspace/gcs-input-resource }, }, }}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gcsStorageInputs, }, Volumes: []corev1.Volume{{ @@ -1158,8 +1158,8 @@ gsutil rsync -d -r gs://fake-bucket/rules.zip /workspace/gcs-input-resource }, { desc: "optional inputs with no resource spec and no resource ref", task: &v1alpha1.Task{ - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: optionalStorageInputs, }, }}, @@ -1171,16 +1171,16 @@ gsutil rsync -d -r gs://fake-bucket/rules.zip /workspace/gcs-input-resource }, Spec: v1alpha1.TaskRunSpec{ Params: nil, - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: nil, }, }, }, wantErr: false, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: nil, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: optionalStorageInputs, }, }, @@ -1207,8 +1207,8 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Name: "build-from-repo", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, }}, @@ -1218,8 +1218,8 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Name: "task-with-targetpath", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: gcsInputs, }, }}, @@ -1229,8 +1229,8 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Name: "task-with-multiple-gcs-inputs", Namespace: "marshmallow", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: multipleGcsInputs, }, }}, @@ -1272,7 +1272,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -1286,7 +1286,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "artifact-dest-mkdir-gitspace-9l9zj", Image: "busybox", @@ -1299,7 +1299,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Env: gcsEnv, VolumeMounts: gcsVolumeMounts, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gitInputs, }, Volumes: gcsVolumes, @@ -1318,7 +1318,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -1332,7 +1332,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "artifact-dest-mkdir-workspace-mssqb", Image: "busybox", @@ -1345,7 +1345,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Env: gcsEnv, VolumeMounts: gcsVolumeMounts, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: gcsInputs, }, Volumes: gcsVolumes, @@ -1364,7 +1364,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ ResourceRef: &v1alpha1.PipelineResourceRef{ @@ -1386,7 +1386,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "artifact-dest-mkdir-workspace-vr6ds", Image: "busybox", @@ -1410,7 +1410,7 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { Env: gcsEnv, VolumeMounts: gcsVolumeMounts, }}}, - Resources: &v1alpha2.TaskResources{ + Resources: &v1beta1.TaskResources{ Inputs: multipleGcsInputs, }, Volumes: gcsVolumes, diff --git a/pkg/reconciler/taskrun/resources/output_resource_test.go b/pkg/reconciler/taskrun/resources/output_resource_test.go index 210ab80eac4..8e7624ac2a9 100644 --- a/pkg/reconciler/taskrun/resources/output_resource_test.go +++ b/pkg/reconciler/taskrun/resources/output_resource_test.go @@ -21,7 +21,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource" "github.com/tektoncd/pipeline/pkg/artifacts" "github.com/tektoncd/pipeline/pkg/logging" @@ -122,7 +122,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -149,8 +149,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -210,7 +210,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -229,8 +229,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -285,7 +285,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -304,8 +304,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -330,7 +330,7 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -348,8 +348,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -377,7 +377,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -404,8 +404,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -483,7 +483,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -502,8 +502,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -568,7 +568,7 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -587,8 +587,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -632,7 +632,7 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -650,8 +650,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -699,7 +699,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -717,8 +717,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -746,7 +746,7 @@ func TestValidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -764,8 +764,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -789,7 +789,7 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -807,8 +807,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -831,7 +831,7 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -856,8 +856,8 @@ func TestValidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -922,7 +922,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Inputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -949,8 +949,8 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Inputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -988,7 +988,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -1007,8 +1007,8 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -1037,7 +1037,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -1055,8 +1055,8 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -1133,8 +1133,8 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -1154,7 +1154,7 @@ func TestInvalidOutputResources(t *testing.T) { }}, }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -1176,8 +1176,8 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -1206,7 +1206,7 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskRunSpec{ - Resources: &v1alpha2.TaskRunResources{ + Resources: &v1beta1.TaskRunResources{ Outputs: []v1alpha1.TaskResourceBinding{{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: "source-workspace", @@ -1224,8 +1224,8 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", @@ -1244,8 +1244,8 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", Type: "git", @@ -1274,8 +1274,8 @@ func TestInvalidOutputResources(t *testing.T) { Namespace: "marshmallow", }, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ - Resources: &v1alpha2.TaskResources{ + TaskSpec: v1beta1.TaskSpec{ + Resources: &v1beta1.TaskResources{ Outputs: []v1alpha1.TaskResource{{ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: "source-workspace", Type: "git", diff --git a/pkg/reconciler/taskrun/resources/taskresourceresolution.go b/pkg/reconciler/taskrun/resources/taskresourceresolution.go index 31546992cd7..b501b0b5ac8 100644 --- a/pkg/reconciler/taskrun/resources/taskresourceresolution.go +++ b/pkg/reconciler/taskrun/resources/taskresourceresolution.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -45,7 +45,7 @@ type GetResource func(string) (*v1alpha1.PipelineResource, error) // ResolveTaskResources looks up PipelineResources referenced by inputs and outputs and returns // a structure that unites the resolved references and the Task Spec. If referenced PipelineResources // can't be found, an error is returned. -func ResolveTaskResources(ts *v1alpha1.TaskSpec, taskName string, kind v1alpha1.TaskKind, inputs []v1alpha2.TaskResourceBinding, outputs []v1alpha2.TaskResourceBinding, gr GetResource) (*ResolvedTaskResources, error) { +func ResolveTaskResources(ts *v1alpha1.TaskSpec, taskName string, kind v1alpha1.TaskKind, inputs []v1beta1.TaskResourceBinding, outputs []v1beta1.TaskResourceBinding, gr GetResource) (*ResolvedTaskResources, error) { rtr := ResolvedTaskResources{ TaskName: taskName, TaskSpec: ts, diff --git a/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go b/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go index 342214c9bc2..77c494471bf 100644 --- a/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go +++ b/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -76,7 +76,7 @@ func TestResolveTaskRun(t *testing.T) { taskName := "orchestrate" kind := v1alpha1.NamespacedTaskKind - taskSpec := v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + taskSpec := v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, @@ -198,7 +198,7 @@ func TestResolveTaskRun_missingInput(t *testing.T) { } func TestResolveTaskRun_noResources(t *testing.T) { - taskSpec := v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + taskSpec := v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, diff --git a/pkg/reconciler/taskrun/resources/taskspec.go b/pkg/reconciler/taskrun/resources/taskspec.go index b2d19f09660..9f59de771e6 100644 --- a/pkg/reconciler/taskrun/resources/taskspec.go +++ b/pkg/reconciler/taskrun/resources/taskspec.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/contexts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -50,7 +50,7 @@ func GetTaskData(ctx context.Context, taskRun *v1alpha1.TaskRun, getTask GetTask taskSpec = t.TaskSpec() taskSpec.SetDefaults(contexts.WithUpgradeViaDefaulting(ctx)) - if err := taskSpec.ConvertUp(ctx, &v1alpha2.TaskSpec{}); err != nil { + if err := taskSpec.ConvertUp(ctx, &v1beta1.TaskSpec{}); err != nil { return nil, nil, err } case taskRun.Spec.TaskSpec != nil: diff --git a/pkg/reconciler/taskrun/resources/taskspec_test.go b/pkg/reconciler/taskrun/resources/taskspec_test.go index a5f74996211..5b71476fce3 100644 --- a/pkg/reconciler/taskrun/resources/taskspec_test.go +++ b/pkg/reconciler/taskrun/resources/taskspec_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -32,7 +32,7 @@ func TestGetTaskSpec_Ref(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "orchestrate", }, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, @@ -70,7 +70,7 @@ func TestGetTaskSpec_Embedded(t *testing.T) { Name: "mytaskrun", }, Spec: v1alpha1.TaskRunSpec{ - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step1", }}}, diff --git a/pkg/reconciler/taskrun/taskrun.go b/pkg/reconciler/taskrun/taskrun.go index e0ef3b694e0..f4538f18d58 100644 --- a/pkg/reconciler/taskrun/taskrun.go +++ b/pkg/reconciler/taskrun/taskrun.go @@ -27,7 +27,7 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource" listers "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1alpha1" resourcelisters "github.com/tektoncd/pipeline/pkg/client/resource/listers/resource/v1alpha1" @@ -232,8 +232,8 @@ func (c *Reconciler) reconcile(ctx context.Context, tr *v1alpha1.TaskRun) error // and may not have had all of the assumed default specified. tr.SetDefaults(contexts.WithUpgradeViaDefaulting(ctx)) - if err := tr.ConvertUp(ctx, &v1alpha2.TaskRun{}); err != nil { - if ce, ok := err.(*v1alpha2.CannotConvertError); ok { + if err := tr.ConvertUp(ctx, &v1beta1.TaskRun{}); err != nil { + if ce, ok := err.(*v1beta1.CannotConvertError); ok { tr.Status.MarkResourceNotConvertible(ce) return nil } @@ -252,7 +252,7 @@ func (c *Reconciler) reconcile(ctx context.Context, tr *v1alpha1.TaskRun) error getTaskFunc, kind := c.getTaskFunc(tr) taskMeta, taskSpec, err := resources.GetTaskData(ctx, tr, getTaskFunc) if err != nil { - if ce, ok := err.(*v1alpha2.CannotConvertError); ok { + if ce, ok := err.(*v1beta1.CannotConvertError); ok { tr.Status.MarkResourceNotConvertible(ce) return nil } @@ -297,8 +297,8 @@ func (c *Reconciler) reconcile(ctx context.Context, tr *v1alpha1.TaskRun) error return nil } - inputs := []v1alpha2.TaskResourceBinding{} - outputs := []v1alpha2.TaskResourceBinding{} + inputs := []v1beta1.TaskResourceBinding{} + outputs := []v1beta1.TaskResourceBinding{} if tr.Spec.Resources != nil { inputs = tr.Spec.Resources.Inputs outputs = tr.Spec.Resources.Outputs diff --git a/pkg/reconciler/taskrun/validate_resources.go b/pkg/reconciler/taskrun/validate_resources.go index 567dbfa3097..0a0c6776219 100644 --- a/pkg/reconciler/taskrun/validate_resources.go +++ b/pkg/reconciler/taskrun/validate_resources.go @@ -20,12 +20,12 @@ import ( "fmt" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/list" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" ) -func validateResources(requiredResources []v1alpha2.TaskResource, providedResources map[string]*v1alpha1.PipelineResource) error { +func validateResources(requiredResources []v1beta1.TaskResource, providedResources map[string]*v1alpha1.PipelineResource) error { required := make([]string, 0, len(requiredResources)) optional := make([]string, 0, len(requiredResources)) for _, resource := range requiredResources { @@ -64,7 +64,7 @@ func validateResources(requiredResources []v1alpha2.TaskResource, providedResour return nil } -func validateParams(paramSpecs []v1alpha2.ParamSpec, params []v1alpha1.Param) error { +func validateParams(paramSpecs []v1beta1.ParamSpec, params []v1alpha1.Param) error { var neededParams []string paramTypes := make(map[string]v1alpha1.ParamType) neededParams = make([]string, 0, len(paramSpecs)) @@ -113,8 +113,8 @@ func ValidateResolvedTaskResources(params []v1alpha1.Param, rtr *resources.Resol if err := validateParams(rtr.TaskSpec.Params, params); err != nil { return fmt.Errorf("invalid input params: %w", err) } - inputs := []v1alpha2.TaskResource{} - outputs := []v1alpha2.TaskResource{} + inputs := []v1beta1.TaskResource{} + outputs := []v1beta1.TaskResource{} if rtr.TaskSpec.Resources != nil { inputs = rtr.TaskSpec.Resources.Inputs outputs = rtr.TaskSpec.Resources.Outputs diff --git a/pkg/workspace/apply_test.go b/pkg/workspace/apply_test.go index 3471cb9041c..88204440925 100644 --- a/pkg/workspace/apply_test.go +++ b/pkg/workspace/apply_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/workspace" "github.com/tektoncd/pipeline/test/names" corev1 "k8s.io/api/core/v1" @@ -202,7 +202,7 @@ func TestApply(t *testing.T) { expectedTaskSpec v1alpha1.TaskSpec }{{ name: "binding a single workspace with a PVC", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", }}, @@ -214,7 +214,7 @@ func TestApply(t *testing.T) { }, SubPath: "/foo/bar/baz", }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-9l9zj", @@ -236,7 +236,7 @@ func TestApply(t *testing.T) { }}, }, { name: "binding a single workspace with emptyDir", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", }}, @@ -248,7 +248,7 @@ func TestApply(t *testing.T) { }, SubPath: "/foo/bar/baz", }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-mz4c7", @@ -270,7 +270,7 @@ func TestApply(t *testing.T) { }}, }, { name: "task spec already has volumes and stepTemplate", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "awesome-volume", @@ -294,7 +294,7 @@ func TestApply(t *testing.T) { }, SubPath: "/foo/bar/baz", }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "awesome-volume", @@ -324,14 +324,14 @@ func TestApply(t *testing.T) { }}, }, { name: "0 workspace bindings", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ Container: corev1.Container{ Name: "foo", }}}, }}, workspaces: []v1alpha1.WorkspaceBinding{}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ Container: corev1.Container{ Name: "foo", @@ -339,7 +339,7 @@ func TestApply(t *testing.T) { }}, }, { name: "binding multiple workspaces", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", }, { @@ -358,7 +358,7 @@ func TestApply(t *testing.T) { ClaimName: "myotherpvc", }, }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-78c5n", @@ -392,7 +392,7 @@ func TestApply(t *testing.T) { }}, }, { name: "multiple workspaces binding to the same volume with diff subpaths doesnt duplicate", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", }, { @@ -412,7 +412,7 @@ func TestApply(t *testing.T) { }, SubPath: "/very/professional/work/space", }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-j2tds", @@ -440,7 +440,7 @@ func TestApply(t *testing.T) { }}, }, { name: "non default mount path", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", MountPath: "/my/fancy/mount/path", @@ -452,7 +452,7 @@ func TestApply(t *testing.T) { ClaimName: "mypvc", }, }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-l22wn", @@ -474,7 +474,7 @@ func TestApply(t *testing.T) { }}, }, { name: "readOnly true marks volume mount readOnly", - ts: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + ts: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Workspaces: []v1alpha1.WorkspaceDeclaration{{ Name: "custom", MountPath: "/my/fancy/mount/path", @@ -487,7 +487,7 @@ func TestApply(t *testing.T) { ClaimName: "mypvc", }, }}, - expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + expectedTaskSpec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ StepTemplate: &corev1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-twkr2", diff --git a/test/builder/pipeline_test.go b/test/builder/pipeline_test.go index 0c27d2e9339..ca0132dea38 100644 --- a/test/builder/pipeline_test.go +++ b/test/builder/pipeline_test.go @@ -27,7 +27,7 @@ import ( duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" tb "github.com/tektoncd/pipeline/test/builder" ) @@ -56,7 +56,7 @@ func TestPipeline(t *testing.T) { tb.RunAfter("foo"), tb.PipelineTaskTimeout(5*time.Second), ), - tb.PipelineTask("foo", "", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + tb.PipelineTask("foo", "", tb.PipelineTaskSpec(&v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step", Image: "myimage", @@ -136,7 +136,7 @@ func TestPipeline(t *testing.T) { Timeout: &metav1.Duration{Duration: 5 * time.Second}, }, { Name: "foo", - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "step", Image: "myimage", diff --git a/test/builder/task.go b/test/builder/task.go index 78e9d6debe8..87d2f23aac5 100644 --- a/test/builder/task.go +++ b/test/builder/task.go @@ -21,7 +21,7 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -38,7 +38,7 @@ type ClusterTaskOp func(*v1alpha1.ClusterTask) type TaskSpecOp func(*v1alpha1.TaskSpec) // TaskResourcesOp is an operation which modify a TaskResources struct. -type TaskResourcesOp func(*v1alpha2.TaskResources) +type TaskResourcesOp func(*v1beta1.TaskResources) // InputsOp is an operation which modify an Inputs struct. type InputsOp func(*v1alpha1.Inputs) @@ -53,7 +53,7 @@ type TaskRunOp func(*v1alpha1.TaskRun) type TaskRunSpecOp func(*v1alpha1.TaskRunSpec) // TaskRunResourcesOp is an operation which modify a TaskRunResources struct. -type TaskRunResourcesOp func(*v1alpha2.TaskRunResources) +type TaskRunResourcesOp func(*v1beta1.TaskRunResources) // TaskResourceOp is an operation which modify a TaskResource struct. type TaskResourceOp func(*v1alpha1.TaskResource) @@ -232,7 +232,7 @@ func TaskParam(name string, pt v1alpha1.ParamType, ops ...ParamSpecOp) TaskSpecO // TaskResources sets the Resources to the TaskSpec func TaskResources(ops ...TaskResourcesOp) TaskSpecOp { return func(spec *v1alpha1.TaskSpec) { - r := &v1alpha2.TaskResources{} + r := &v1beta1.TaskResources{} for _, op := range ops { op(r) } @@ -242,8 +242,8 @@ func TaskResources(ops ...TaskResourcesOp) TaskSpecOp { // TaskResourcesInput adds a TaskResource as Inputs to the TaskResources func TaskResourcesInput(name string, resourceType v1alpha1.PipelineResourceType, ops ...TaskResourceOp) TaskResourcesOp { - return func(r *v1alpha2.TaskResources) { - i := &v1alpha2.TaskResource{ + return func(r *v1beta1.TaskResources) { + i := &v1beta1.TaskResource{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: name, Type: resourceType, @@ -258,8 +258,8 @@ func TaskResourcesInput(name string, resourceType v1alpha1.PipelineResourceType, // TaskResourcesOutput adds a TaskResource as Outputs to the TaskResources func TaskResourcesOutput(name string, resourceType v1alpha1.PipelineResourceType, ops ...TaskResourceOp) TaskResourcesOp { - return func(r *v1alpha2.TaskResources) { - o := &v1alpha2.TaskResource{ + return func(r *v1beta1.TaskResources) { + o := &v1beta1.TaskResource{ ResourceDeclaration: v1alpha1.ResourceDeclaration{ Name: name, Type: resourceType, @@ -607,7 +607,7 @@ func TaskRunSelfLink(selflink string) TaskRunOp { func TaskRunSpec(ops ...TaskRunSpecOp) TaskRunOp { return func(tr *v1alpha1.TaskRun) { spec := &tr.Spec - spec.Resources = &v1alpha2.TaskRunResources{} + spec.Resources = &v1beta1.TaskRunResources{} // Set a default timeout spec.Timeout = &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute} for _, op := range ops { @@ -689,7 +689,7 @@ func TaskRunParam(name, value string, additionalValues ...string) TaskRunSpecOp // TaskRunResources sets the TaskRunResources to the TaskRunSpec func TaskRunResources(ops ...TaskRunResourcesOp) TaskRunSpecOp { return func(spec *v1alpha1.TaskRunSpec) { - r := &v1alpha2.TaskRunResources{} + r := &v1beta1.TaskRunResources{} for _, op := range ops { op(r) } @@ -699,7 +699,7 @@ func TaskRunResources(ops ...TaskRunResourcesOp) TaskRunSpecOp { // TaskRunResourcesInput adds a TaskRunResource as Inputs to the TaskRunResources func TaskRunResourcesInput(name string, ops ...TaskResourceBindingOp) TaskRunResourcesOp { - return func(r *v1alpha2.TaskRunResources) { + return func(r *v1beta1.TaskRunResources) { binding := &v1alpha1.TaskResourceBinding{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: name, @@ -714,7 +714,7 @@ func TaskRunResourcesInput(name string, ops ...TaskResourceBindingOp) TaskRunRes // TaskRunResourcesOutput adds a TaskRunResource as Outputs to the TaskRunResources func TaskRunResourcesOutput(name string, ops ...TaskResourceBindingOp) TaskRunResourcesOp { - return func(r *v1alpha2.TaskRunResources) { + return func(r *v1beta1.TaskRunResources) { binding := &v1alpha1.TaskResourceBinding{ PipelineResourceBinding: v1alpha1.PipelineResourceBinding{ Name: name, diff --git a/test/builder/task_test.go b/test/builder/task_test.go index 8dde503d36b..82b47c083ab 100644 --- a/test/builder/task_test.go +++ b/test/builder/task_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/tektoncd/pipeline/pkg/apis/config" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources" tb "github.com/tektoncd/pipeline/test/builder" corev1 "k8s.io/api/core/v1" @@ -68,7 +68,7 @@ func TestTask(t *testing.T) { expectedTask := &v1alpha1.Task{ ObjectMeta: metav1.ObjectMeta{Name: "test-task", Namespace: "foo"}, Spec: v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Name: "mycontainer", Image: "myimage", @@ -148,7 +148,7 @@ func TestClusterTask(t *testing.T) { )) expectedTask := &v1alpha1.ClusterTask{ ObjectMeta: metav1.ObjectMeta{Name: "test-clustertask"}, - Spec: v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + Spec: v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Image: "myimage", Command: []string{"/mycmd"}, @@ -265,7 +265,7 @@ func TestTaskRunWithTaskRef(t *testing.T) { Paths: []string{"output-folder"}, }}, }, - Resources: &v1alpha2.TaskRunResources{}, + Resources: &v1beta1.TaskRunResources{}, Timeout: &metav1.Duration{Duration: config.DefaultTimeoutMinutes * time.Minute}, TaskRef: &v1alpha1.TaskRef{ Name: "task-output", @@ -290,7 +290,7 @@ func TestTaskRunWithTaskRef(t *testing.T) { }, TaskRunStatusFields: v1alpha1.TaskRunStatusFields{ PodName: "my-pod-name", - Sidecars: []v1alpha2.SidecarState{{ + Sidecars: []v1beta1.SidecarState{{ Name: "sidecar", ImageID: "ImageID", ContainerName: "ContainerName", @@ -328,7 +328,7 @@ func TestTaskRunWithTaskSpec(t *testing.T) { }, Spec: v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Image: "image", Command: []string{"/mycmd"}, @@ -344,7 +344,7 @@ func TestTaskRunWithTaskSpec(t *testing.T) { Params: nil, }, }, - Resources: &v1alpha2.TaskRunResources{}, + Resources: &v1beta1.TaskRunResources{}, ServiceAccountName: "sa", Status: v1alpha1.TaskRunSpecStatusCancelled, Timeout: &metav1.Duration{Duration: 2 * time.Minute}, @@ -375,7 +375,7 @@ func TestTaskRunWithPodTemplate(t *testing.T) { }, Spec: v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{ - TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Image: "image", Command: []string{"/mycmd"}, @@ -396,7 +396,7 @@ func TestTaskRunWithPodTemplate(t *testing.T) { "label": "value", }, }, - Resources: &v1alpha2.TaskRunResources{}, + Resources: &v1beta1.TaskRunResources{}, ServiceAccountName: "sa", Status: v1alpha1.TaskRunSpecStatusCancelled, Timeout: &metav1.Duration{Duration: 2 * time.Minute}, @@ -416,7 +416,7 @@ func TestResolvedTaskResources(t *testing.T) { tb.ResolvedTaskResourcesOutputs("qux", tb.PipelineResource("quux", "quuz")), ) expectedResolvedTaskResources := &resources.ResolvedTaskResources{ - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{Container: corev1.Container{ Image: "image", Command: []string{"/mycmd"}, diff --git a/test/e2e-tests-yaml.sh b/test/e2e-tests-yaml.sh index 9969442f6c6..6d2061dca9f 100755 --- a/test/e2e-tests-yaml.sh +++ b/test/e2e-tests-yaml.sh @@ -33,7 +33,7 @@ install_pipeline_crd # Run the tests failed=0 -for version in v1alpha1 v1alpha2; do +for version in v1alpha1 v1beta1; do for test in taskrun pipelinerun; do header "Running YAML e2e tests for ${version} ${test}s" if ! run_yaml_tests ${version} ${test}; then diff --git a/test/retry_test.go b/test/retry_test.go index 7816395be4d..ab7add10491 100644 --- a/test/retry_test.go +++ b/test/retry_test.go @@ -23,7 +23,7 @@ import ( "time" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" @@ -48,7 +48,7 @@ func TestTaskRunRetry(t *testing.T) { PipelineSpec: &v1alpha1.PipelineSpec{ Tasks: []v1alpha1.PipelineTask{{ Name: "retry-me", - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ Container: corev1.Container{Image: "busybox"}, Script: "exit 1", diff --git a/test/start_time_test.go b/test/start_time_test.go index bcbda9d199a..8dd8e742a70 100644 --- a/test/start_time_test.go +++ b/test/start_time_test.go @@ -19,7 +19,7 @@ import ( "time" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" knativetest "knative.dev/pkg/test" @@ -43,7 +43,7 @@ func TestStartTime(t *testing.T) { Namespace: namespace, }, Spec: v1alpha1.TaskRunSpec{ - TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1alpha2.TaskSpec{ + TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ Container: corev1.Container{Image: "ubuntu"}, Script: "sleep 10",