From db8ffae635d74edf3f0a8b561e828f61576e8b40 Mon Sep 17 00:00:00 2001 From: Lee Bernick Date: Thu, 22 Sep 2022 15:31:37 -0400 Subject: [PATCH] Deprecate ClusterTasks This commit marks ClusterTasks as deprecated, planned for the next Pipelines release. --- docs/deprecations.md | 1 + docs/tasks.md | 2 ++ examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml | 2 ++ examples/v1beta1/taskruns/clustertask.yaml | 2 ++ .../v1beta1/taskruns/optional-resources-with-clustertask.yaml | 2 ++ pkg/apis/pipeline/v1beta1/cluster_task_types.go | 2 +- pkg/apis/pipeline/v1beta1/openapi_generated.go | 2 +- pkg/apis/pipeline/v1beta1/swagger.json | 2 +- 8 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/deprecations.md b/docs/deprecations.md index 93c539af7b0..d6e78ec0c16 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -23,3 +23,4 @@ being deprecated. | [The `PipelineRun.Status.TaskRuns` and `PipelineRun.Status.Runs` fields are deprecated and will be removed.](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md) | v0.35.0 | Beta | Jan 25, 2023 | | [PipelineRun.Timeout is deprecated and will be removed](https://github.com/tektoncd/community/blob/main/teps/0046-finallytask-execution-post-timeout.md) | v0.36.0 | Beta | Feb 25, 2023 | | [Several fields of Task.Step are deprecated](https://github.com/tektoncd/pipeline/issues/4737) | v0.36.0 | Beta | Feb 25, 2023 | +| [ClusterTask is deprecated](https://github.com/tektoncd/pipeline/issues/4476) | v0.41.0 | Beta | July 13, 2023 | diff --git a/docs/tasks.md b/docs/tasks.md index 1271f07c211..c36144d8920 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -129,6 +129,8 @@ spec: ### `Task` vs. `ClusterTask` +**Note: ClusterTasks are deprecated.** Please use the [cluster resolver](./cluster-resolver.md) instead. + A `ClusterTask` is a `Task` scoped to the entire cluster instead of a single namespace. A `ClusterTask` behaves identically to a `Task` and therefore everything in this document applies to both. diff --git a/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml b/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml index d70960dbb12..3ea557489e6 100644 --- a/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml +++ b/examples/v1beta1/pipelineruns/clustertask-pipelinerun.yaml @@ -1,3 +1,5 @@ +# Note: ClusterTasks are deprecated. Please use the cluster resolver instead. +# https://github.com/tektoncd/pipeline/blob/main/docs/cluster-resolver.md apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: diff --git a/examples/v1beta1/taskruns/clustertask.yaml b/examples/v1beta1/taskruns/clustertask.yaml index 9124271adc9..79a4ecd1a89 100644 --- a/examples/v1beta1/taskruns/clustertask.yaml +++ b/examples/v1beta1/taskruns/clustertask.yaml @@ -1,3 +1,5 @@ +# Note: ClusterTasks are deprecated. Please use the cluster resolver instead. +# https://github.com/tektoncd/pipeline/blob/main/docs/cluster-resolver.md apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: diff --git a/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml b/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml index 882443c6971..469060123ec 100644 --- a/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml +++ b/examples/v1beta1/taskruns/optional-resources-with-clustertask.yaml @@ -1,3 +1,5 @@ +# Note: ClusterTasks are deprecated. Please use the cluster resolver instead. +# https://github.com/tektoncd/pipeline/blob/main/docs/cluster-resolver.md apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: diff --git a/pkg/apis/pipeline/v1beta1/cluster_task_types.go b/pkg/apis/pipeline/v1beta1/cluster_task_types.go index 183b71347c5..1a78de26055 100644 --- a/pkg/apis/pipeline/v1beta1/cluster_task_types.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_types.go @@ -31,7 +31,7 @@ import ( // ClusterTask is a Task with a cluster scope. ClusterTasks are used to // represent Tasks that should be publicly addressable from any namespace in the -// cluster. +// cluster. Deprecated: Please use the cluster resolver instead. type ClusterTask struct { metav1.TypeMeta `json:",inline"` // +optional diff --git a/pkg/apis/pipeline/v1beta1/openapi_generated.go b/pkg/apis/pipeline/v1beta1/openapi_generated.go index 885182db906..0095ff2ae6a 100644 --- a/pkg/apis/pipeline/v1beta1/openapi_generated.go +++ b/pkg/apis/pipeline/v1beta1/openapi_generated.go @@ -525,7 +525,7 @@ func schema_pkg_apis_pipeline_v1beta1_ClusterTask(ref common.ReferenceCallback) return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ClusterTask is a Task with a cluster scope. ClusterTasks are used to represent Tasks that should be publicly addressable from any namespace in the cluster.", + Description: "ClusterTask is a Task with a cluster scope. ClusterTasks are used to represent Tasks that should be publicly addressable from any namespace in the cluster. Deprecated: Please use the cluster resolver instead.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { diff --git a/pkg/apis/pipeline/v1beta1/swagger.json b/pkg/apis/pipeline/v1beta1/swagger.json index 6a831aaa724..bf2317f20f0 100644 --- a/pkg/apis/pipeline/v1beta1/swagger.json +++ b/pkg/apis/pipeline/v1beta1/swagger.json @@ -501,7 +501,7 @@ } }, "v1beta1.ClusterTask": { - "description": "ClusterTask is a Task with a cluster scope. ClusterTasks are used to represent Tasks that should be publicly addressable from any namespace in the cluster.", + "description": "ClusterTask is a Task with a cluster scope. ClusterTasks are used to represent Tasks that should be publicly addressable from any namespace in the cluster. Deprecated: Please use the cluster resolver instead.", "type": "object", "properties": { "apiVersion": {