-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path300-gitlabsource.yaml
258 lines (257 loc) · 9.14 KB
/
300-gitlabsource.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# Copyright 2021 The Knative 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.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: gitlabsources.sources.knative.dev
labels:
contrib.eventing.knative.dev/release: devel
eventing.knative.dev/source: "true"
duck.knative.dev/source: "true"
knative.dev/crd-install: "true"
annotations:
# Webhook event types as documented at https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#events.
# NOTE(antoineco): GitLab doesn't currently provide schemas for those events (gitlab-org/gitlab#208924)
registry.knative.dev/eventTypes: |
[
{
"type": "dev.knative.sources.gitlab.build",
"description": "Triggered on status change of a job."
},
{
"type": "dev.knative.sources.gitlab.deployment",
"description": "Triggered when a deployment starts, succeeds, fails, or is cancelled."
},
{
"type": "dev.knative.sources.gitlab.issue",
"description": "Triggered when a new issue is created or an existing issue was updated/closed/reopened."
},
{
"type": "dev.knative.sources.gitlab.merge_request",
"description": "Triggered when a merge request is created/updated/merged/closed or a commit is added in the source branch."
},
{
"type": "dev.knative.sources.gitlab.note",
"description": "Triggered when a new comment is made on commits, merge requests, issues, and code snippets."
},
{
"type": "dev.knative.sources.gitlab.pipeline",
"description": "Triggered on status change of Pipeline."
},
{
"type": "dev.knative.sources.gitlab.push",
"description": "Triggered when you push to the repository except when pushing tags."
},
{
"type": "dev.knative.sources.gitlab.tag_push",
"description": "Triggered when you create (or delete) tags to the repository."
},
{
"type": "dev.knative.sources.gitlab.wiki_page",
"description": "Triggered when a wiki page is created, updated or deleted."
}
]
spec:
group: sources.knative.dev
scope: Namespaced
names:
kind: GitLabSource
plural: gitlabsources
categories:
- all
- knative
- eventing
- sources
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
spec:
description: Desired state of the event source.
type: object
properties:
projectUrl:
description: URL of the GitLab project to receive events from.
type: string
format: uri
eventTypes:
description: List of webhooks to enable on the selected GitLab
project. Those correspond to the attributes enumerated at
https://docs.gitlab.com/ee/api/projects.html#add-project-hook
type: array
items:
type: string
enum:
- confidential_issues_events
- confidential_note_events
- deployment_events
- issues_events
- job_events
- merge_requests_events
- note_events
- pipeline_events
- push_events
- tag_push_events
- wiki_page_events
minItems: 1
accessToken:
description: Access token for the GitLab API.
type: object
properties:
secretKeyRef:
description: A reference to a Kubernetes Secret object
containing a GitLab access token.
type: object
properties:
name:
description: The name of the Kubernetes Secret object
which contains the GitLab access token.
type: string
key:
description: The key which contains the GitLab access
token within the Kubernetes Secret object referenced by
name.
type: string
required:
- name
- key
secretToken:
description: Arbitrary token used to validate requests to
webhooks.
type: object
properties:
secretKeyRef:
description: A reference to a Kubernetes Secret object
containing the webhook token.
type: object
properties:
name:
description: The name of the Kubernetes Secret object
which contains the webhook token.
type: string
key:
description: The key which contains the webhook token
within the Kubernetes Secret object referenced by name.
type: string
required:
- name
- key
sslverify:
description: Whether requests to webhooks should be made over
SSL.
type: boolean
serviceAccountName:
description: Service Account the receive adapter Pod should be
using.
type: string
sink:
description: The destination of events received from webhooks.
type: object
properties:
ref:
description: Reference to an addressable Kubernetes object
to be used as the destination of events.
type: object
properties:
apiVersion:
type: string
kind:
type: string
namespace:
type: string
name:
type: string
required:
- apiVersion
- kind
- name
uri:
description: URI to use as the destination of events.
type: string
format: uri
oneOf:
- required: ['ref']
- required: ['uri']
required:
- projectUrl
- eventTypes
- accessToken
- secretToken
- sink
status:
type: object
properties:
webhookID:
description: ID of the project hook registered with GitLab
type: integer
sinkUri:
type: string
format: uri
ceAttributes:
type: array
items:
type: object
properties:
type:
type: string
source:
type: string
required:
- type
- source
observedGeneration:
type: integer
format: int64
conditions:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
enum: ['True', 'False', Unknown]
severity:
type: string
enum: [Error, Warning, Info]
reason:
type: string
message:
type: string
lastTransitionTime:
type: string
format: date-time
required:
- type
- status
additionalPrinterColumns:
- name: Ready
type: string
jsonPath: .status.conditions[?(@.type=='Ready')].status
- name: Reason
type: string
jsonPath: .status.conditions[?(@.type=='Ready')].reason
- name: Sink
type: string
jsonPath: .status.sinkUri
- name: Age
type: date
jsonPath: .metadata.creationTimestamp