Skip to content

Commit 7a6ab62

Browse files
JeromeJutekton-robot
authored andcommitted
Remove CloudEvent Resources
This commit removes the CloudEvent Resources support. This PR removes , its respective example test, relevant functions in cloud_event_controller and docs for cloud-event resources. Removal of , as in #5967 has been broken up into removal of each resources packages for the code standard.
1 parent 30b5e96 commit 7a6ab62

File tree

11 files changed

+1
-1445
lines changed

11 files changed

+1
-1445
lines changed

docs/resources.md

-65
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ For example:
5151
- [Cluster Resource](#cluster-resource)
5252
- [Storage Resource](#storage-resource)
5353
- [GCS Storage Resource](#gcs-storage-resource)
54-
- [Cloud Event Resource](#cloud-event-resource)
5554
- [Why Aren't PipelineResources in Beta?](#why-aren-t-pipelineresources-in-beta)
5655

5756
## Syntax
@@ -925,70 +924,6 @@ service account.
925924

926925
--------------------------------------------------------------------------------
927926

928-
### Cloud Event Resource
929-
930-
The `cloudevent` resource represents a
931-
[cloud event](https://github.com/cloudevents/spec) that is sent to a target
932-
`URI` upon completion of a `TaskRun`. The `cloudevent` resource sends Tekton
933-
specific events; the body of the event includes the entire `TaskRun` spec plus
934-
status; the types of events defined for now are:
935-
936-
- dev.tekton.event.task.unknown
937-
- dev.tekton.event.task.successful
938-
- dev.tekton.event.task.failed
939-
940-
`cloudevent` resources are useful to notify a third party upon the completion
941-
and status of a `TaskRun`. In combinations with the
942-
[Tekton triggers](https://github.com/tektoncd/triggers) project they can be used
943-
to link `Task/PipelineRuns` asynchronously.
944-
945-
To create a CloudEvent resource using the `PipelineResource` CRD:
946-
947-
```yaml
948-
apiVersion: tekton.dev/v1alpha1
949-
kind: PipelineResource
950-
metadata:
951-
name: event-to-sink
952-
spec:
953-
type: cloudEvent
954-
params:
955-
- name: targetURI
956-
value: http://sink:8080
957-
```
958-
959-
The content of an event is for example:
960-
961-
```yaml
962-
Context Attributes,
963-
SpecVersion: 0.2
964-
Type: dev.tekton.event.task.successful
965-
Source: /apis/tekton.dev/v1beta1/namespaces/default/taskruns/pipeline-run-api-16aa55-source-to-image-task-rpndl
966-
ID: pipeline-run-api-16aa55-source-to-image-task-rpndl
967-
Time: 2019-07-04T11:03:53.058694712Z
968-
ContentType: application/json
969-
Transport Context,
970-
URI: /
971-
Host: my-sink.default.my-cluster.containers.appdomain.cloud
972-
Method: POST
973-
Data,
974-
{
975-
"taskRun": {
976-
"metadata": {...}
977-
"spec": {
978-
"inputs": {...}
979-
"outputs": {...}
980-
"serviceAccount": "default",
981-
"taskRef": {
982-
"name": "source-to-image",
983-
"kind": "Task"
984-
},
985-
"timeout": "1h0m0s"
986-
},
987-
"status": {...}
988-
}
989-
}
990-
```
991-
992927
## Why Aren't PipelineResources in Beta?
993928

994929
The short answer is that they're not ready to be given a Beta level of support by Tekton's developers. The long answer is, well, longer:

examples/v1beta1/taskruns/cloud-event.yaml

-184
This file was deleted.

pkg/apis/pipeline/v1beta1/resource_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ const (
5151

5252
// PipelineResourceTypePullRequest indicates that this source is a SCM Pull Request.
5353
PipelineResourceTypePullRequest PipelineResourceType = resource.PipelineResourceTypePullRequest
54-
55-
// PipelineResourceTypeCloudEvent indicates that this source is a cloud event URI
56-
PipelineResourceTypeCloudEvent PipelineResourceType = resource.PipelineResourceTypeCloudEvent
5754
)
5855

5956
// AllResourceTypes can be used for validation to check if a provided Resource type is one of the known types.

pkg/apis/resource/resource.go

-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
2323
pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2424
resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1"
25-
"github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/cloudevent"
2625
"github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/cluster"
2726
"github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/git"
2827
"github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/image"
@@ -45,8 +44,6 @@ func FromType(name string, r *resourcev1alpha1.PipelineResource, images pipeline
4544
return storage.NewResource(name, images, r)
4645
case resourcev1alpha1.PipelineResourceTypePullRequest:
4746
return pullrequest.NewResource(name, images.PRImage, r)
48-
case resourcev1alpha1.PipelineResourceTypeCloudEvent:
49-
return cloudevent.NewResource(name, r)
5047
}
5148
return nil, fmt.Errorf("%s is an invalid or unimplemented PipelineResource", r.Spec.Type)
5249
}

pkg/apis/resource/v1alpha1/cloudevent/cloud_event_resource.go

-91
This file was deleted.

0 commit comments

Comments
 (0)