@k8ts/sample-interfaces 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_mix.d.ts +4 -0
- package/dist/_mix.d.ts.map +1 -0
- package/dist/_mix.js +7 -0
- package/dist/_mix.js.map +1 -0
- package/dist/acme.cert-manager.io.d.ts +4832 -0
- package/dist/acme.cert-manager.io.d.ts.map +1 -0
- package/dist/acme.cert-manager.io.js +2476 -0
- package/dist/acme.cert-manager.io.js.map +1 -0
- package/dist/gateway.networking.k8s.io.d.ts +8786 -0
- package/dist/gateway.networking.k8s.io.d.ts.map +1 -0
- package/dist/gateway.networking.k8s.io.js +3668 -0
- package/dist/gateway.networking.k8s.io.js.map +1 -0
- package/dist/helm.toolkit.fluxcd.io.d.ts +4560 -0
- package/dist/helm.toolkit.fluxcd.io.d.ts.map +1 -0
- package/dist/helm.toolkit.fluxcd.io.js +2274 -0
- package/dist/helm.toolkit.fluxcd.io.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/k8s.d.ts +18772 -0
- package/dist/k8s.d.ts.map +1 -0
- package/dist/k8s.js +12173 -0
- package/dist/k8s.js.map +1 -0
- package/dist/kustomize.toolkit.fluxcd.io.d.ts +2202 -0
- package/dist/kustomize.toolkit.fluxcd.io.d.ts.map +1 -0
- package/dist/kustomize.toolkit.fluxcd.io.js +1196 -0
- package/dist/kustomize.toolkit.fluxcd.io.js.map +1 -0
- package/dist/notification.toolkit.fluxcd.io.d.ts +1851 -0
- package/dist/notification.toolkit.fluxcd.io.d.ts.map +1 -0
- package/dist/notification.toolkit.fluxcd.io.js +1489 -0
- package/dist/notification.toolkit.fluxcd.io.js.map +1 -0
- package/dist/source.toolkit.fluxcd.io.d.ts +3733 -0
- package/dist/source.toolkit.fluxcd.io.d.ts.map +1 -0
- package/dist/source.toolkit.fluxcd.io.js +2539 -0
- package/dist/source.toolkit.fluxcd.io.js.map +1 -0
- package/package.json +68 -0
- package/src/_mix.ts +3 -0
- package/src/acme.cert-manager.io.ts +8202 -0
- package/src/gateway.networking.k8s.io.ts +12226 -0
- package/src/helm.toolkit.fluxcd.io.ts +7010 -0
- package/src/index.ts +1 -0
- package/src/k8s.ts +31018 -0
- package/src/kustomize.toolkit.fluxcd.io.ts +3560 -0
- package/src/notification.toolkit.fluxcd.io.ts +2944 -0
- package/src/source.toolkit.fluxcd.io.ts +6277 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,2944 @@
|
|
|
1
|
+
// generated by cdk8s
|
|
2
|
+
import { ApiObject, ApiObjectMetadata, GroupVersionKind } from "cdk8s"
|
|
3
|
+
import { Construct } from "constructs"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Alert is the Schema for the alerts API
|
|
7
|
+
*
|
|
8
|
+
* @schema Alert
|
|
9
|
+
*/
|
|
10
|
+
export class Alert extends ApiObject {
|
|
11
|
+
/** Returns the apiVersion and kind for "Alert" */
|
|
12
|
+
public static GVK: GroupVersionKind = {
|
|
13
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta1",
|
|
14
|
+
kind: "Alert"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Renders a Kubernetes manifest for "Alert".
|
|
19
|
+
*
|
|
20
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
21
|
+
*
|
|
22
|
+
* @param props Initialization props
|
|
23
|
+
*/
|
|
24
|
+
public static manifest(props: AlertProps = {}): any {
|
|
25
|
+
return {
|
|
26
|
+
...Alert.GVK,
|
|
27
|
+
...toJson_AlertProps(props)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Defines a "Alert" API object
|
|
33
|
+
*
|
|
34
|
+
* @param scope The scope in which to define this object
|
|
35
|
+
* @param id A scope-local name for the object
|
|
36
|
+
* @param props Initialization props
|
|
37
|
+
*/
|
|
38
|
+
public constructor(scope: Construct, id: string, props: AlertProps = {}) {
|
|
39
|
+
super(scope, id, {
|
|
40
|
+
...Alert.GVK,
|
|
41
|
+
...props
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Renders the object to Kubernetes JSON. */
|
|
46
|
+
public toJson(): any {
|
|
47
|
+
const resolved = super.toJson()
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
...Alert.GVK,
|
|
51
|
+
...toJson_AlertProps(resolved)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Alert is the Schema for the alerts API
|
|
58
|
+
*
|
|
59
|
+
* @schema Alert
|
|
60
|
+
*/
|
|
61
|
+
export interface AlertProps {
|
|
62
|
+
/** @schema Alert#metadata */
|
|
63
|
+
metadata?: ApiObjectMetadata
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* AlertSpec defines an alerting rule for events involving a list of objects
|
|
67
|
+
*
|
|
68
|
+
* @schema Alert#spec
|
|
69
|
+
*/
|
|
70
|
+
spec?: AlertSpec
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Converts an object of type 'AlertProps' to JSON representation. */
|
|
74
|
+
/* eslint-disable max-len, quote-props */
|
|
75
|
+
export function toJson_AlertProps(obj: AlertProps | undefined): Record<string, any> | undefined {
|
|
76
|
+
if (obj === undefined) {
|
|
77
|
+
return undefined
|
|
78
|
+
}
|
|
79
|
+
const result = {
|
|
80
|
+
metadata: obj.metadata,
|
|
81
|
+
spec: toJson_AlertSpec(obj.spec)
|
|
82
|
+
}
|
|
83
|
+
// filter undefined values
|
|
84
|
+
return Object.entries(result).reduce(
|
|
85
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
86
|
+
{}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
/* eslint-enable max-len, quote-props */
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* AlertSpec defines an alerting rule for events involving a list of objects
|
|
93
|
+
*
|
|
94
|
+
* @schema AlertSpec
|
|
95
|
+
*/
|
|
96
|
+
export interface AlertSpec {
|
|
97
|
+
/**
|
|
98
|
+
* Filter events based on severity, defaults to ('info'). If set to 'info' no events will be
|
|
99
|
+
* filtered.
|
|
100
|
+
*
|
|
101
|
+
* @schema AlertSpec#eventSeverity
|
|
102
|
+
*/
|
|
103
|
+
eventSeverity?: AlertSpecEventSeverity
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Filter events based on the involved objects.
|
|
107
|
+
*
|
|
108
|
+
* @schema AlertSpec#eventSources
|
|
109
|
+
*/
|
|
110
|
+
eventSources: AlertSpecEventSources[]
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A list of Golang regular expressions to be used for excluding messages.
|
|
114
|
+
*
|
|
115
|
+
* @schema AlertSpec#exclusionList
|
|
116
|
+
*/
|
|
117
|
+
exclusionList?: string[]
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Send events using this provider.
|
|
121
|
+
*
|
|
122
|
+
* @schema AlertSpec#providerRef
|
|
123
|
+
*/
|
|
124
|
+
providerRef: AlertSpecProviderRef
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Short description of the impact and affected cluster.
|
|
128
|
+
*
|
|
129
|
+
* @schema AlertSpec#summary
|
|
130
|
+
*/
|
|
131
|
+
summary?: string
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* This flag tells the controller to suspend subsequent events dispatching. Defaults to false.
|
|
135
|
+
*
|
|
136
|
+
* @default false.
|
|
137
|
+
* @schema AlertSpec#suspend
|
|
138
|
+
*/
|
|
139
|
+
suspend?: boolean
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Converts an object of type 'AlertSpec' to JSON representation. */
|
|
143
|
+
/* eslint-disable max-len, quote-props */
|
|
144
|
+
export function toJson_AlertSpec(obj: AlertSpec | undefined): Record<string, any> | undefined {
|
|
145
|
+
if (obj === undefined) {
|
|
146
|
+
return undefined
|
|
147
|
+
}
|
|
148
|
+
const result = {
|
|
149
|
+
eventSeverity: obj.eventSeverity,
|
|
150
|
+
eventSources: obj.eventSources?.map(y => toJson_AlertSpecEventSources(y)),
|
|
151
|
+
exclusionList: obj.exclusionList?.map(y => y),
|
|
152
|
+
providerRef: toJson_AlertSpecProviderRef(obj.providerRef),
|
|
153
|
+
summary: obj.summary,
|
|
154
|
+
suspend: obj.suspend
|
|
155
|
+
}
|
|
156
|
+
// filter undefined values
|
|
157
|
+
return Object.entries(result).reduce(
|
|
158
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
159
|
+
{}
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
/* eslint-enable max-len, quote-props */
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Filter events based on severity, defaults to ('info'). If set to 'info' no events will be
|
|
166
|
+
* filtered.
|
|
167
|
+
*
|
|
168
|
+
* @schema AlertSpecEventSeverity
|
|
169
|
+
*/
|
|
170
|
+
export enum AlertSpecEventSeverity {
|
|
171
|
+
/** Info */
|
|
172
|
+
INFO = "info",
|
|
173
|
+
/** Error */
|
|
174
|
+
ERROR = "error"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
179
|
+
* object at cluster level
|
|
180
|
+
*
|
|
181
|
+
* @schema AlertSpecEventSources
|
|
182
|
+
*/
|
|
183
|
+
export interface AlertSpecEventSources {
|
|
184
|
+
/**
|
|
185
|
+
* API version of the referent
|
|
186
|
+
*
|
|
187
|
+
* @schema AlertSpecEventSources#apiVersion
|
|
188
|
+
*/
|
|
189
|
+
apiVersion?: string
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Kind of the referent
|
|
193
|
+
*
|
|
194
|
+
* @schema AlertSpecEventSources#kind
|
|
195
|
+
*/
|
|
196
|
+
kind: AlertSpecEventSourcesKind
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
200
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
201
|
+
* and the values array contains only "value". The requirements are ANDed.
|
|
202
|
+
*
|
|
203
|
+
* @schema AlertSpecEventSources#matchLabels
|
|
204
|
+
*/
|
|
205
|
+
matchLabels?: { [key: string]: string }
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Name of the referent
|
|
209
|
+
*
|
|
210
|
+
* @schema AlertSpecEventSources#name
|
|
211
|
+
*/
|
|
212
|
+
name: string
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Namespace of the referent
|
|
216
|
+
*
|
|
217
|
+
* @schema AlertSpecEventSources#namespace
|
|
218
|
+
*/
|
|
219
|
+
namespace?: string
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Converts an object of type 'AlertSpecEventSources' to JSON representation. */
|
|
223
|
+
/* eslint-disable max-len, quote-props */
|
|
224
|
+
export function toJson_AlertSpecEventSources(
|
|
225
|
+
obj: AlertSpecEventSources | undefined
|
|
226
|
+
): Record<string, any> | undefined {
|
|
227
|
+
if (obj === undefined) {
|
|
228
|
+
return undefined
|
|
229
|
+
}
|
|
230
|
+
const result = {
|
|
231
|
+
apiVersion: obj.apiVersion,
|
|
232
|
+
kind: obj.kind,
|
|
233
|
+
matchLabels:
|
|
234
|
+
obj.matchLabels === undefined
|
|
235
|
+
? undefined
|
|
236
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
237
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
238
|
+
{}
|
|
239
|
+
),
|
|
240
|
+
name: obj.name,
|
|
241
|
+
namespace: obj.namespace
|
|
242
|
+
}
|
|
243
|
+
// filter undefined values
|
|
244
|
+
return Object.entries(result).reduce(
|
|
245
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
246
|
+
{}
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
/* eslint-enable max-len, quote-props */
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Send events using this provider.
|
|
253
|
+
*
|
|
254
|
+
* @schema AlertSpecProviderRef
|
|
255
|
+
*/
|
|
256
|
+
export interface AlertSpecProviderRef {
|
|
257
|
+
/**
|
|
258
|
+
* Name of the referent.
|
|
259
|
+
*
|
|
260
|
+
* @schema AlertSpecProviderRef#name
|
|
261
|
+
*/
|
|
262
|
+
name: string
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Converts an object of type 'AlertSpecProviderRef' to JSON representation. */
|
|
266
|
+
/* eslint-disable max-len, quote-props */
|
|
267
|
+
export function toJson_AlertSpecProviderRef(
|
|
268
|
+
obj: AlertSpecProviderRef | undefined
|
|
269
|
+
): Record<string, any> | undefined {
|
|
270
|
+
if (obj === undefined) {
|
|
271
|
+
return undefined
|
|
272
|
+
}
|
|
273
|
+
const result = {
|
|
274
|
+
name: obj.name
|
|
275
|
+
}
|
|
276
|
+
// filter undefined values
|
|
277
|
+
return Object.entries(result).reduce(
|
|
278
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
279
|
+
{}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
/* eslint-enable max-len, quote-props */
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Kind of the referent
|
|
286
|
+
*
|
|
287
|
+
* @schema AlertSpecEventSourcesKind
|
|
288
|
+
*/
|
|
289
|
+
export enum AlertSpecEventSourcesKind {
|
|
290
|
+
/** Bucket */
|
|
291
|
+
BUCKET = "Bucket",
|
|
292
|
+
/** GitRepository */
|
|
293
|
+
GIT_REPOSITORY = "GitRepository",
|
|
294
|
+
/** Kustomization */
|
|
295
|
+
KUSTOMIZATION = "Kustomization",
|
|
296
|
+
/** HelmRelease */
|
|
297
|
+
HELM_RELEASE = "HelmRelease",
|
|
298
|
+
/** HelmChart */
|
|
299
|
+
HELM_CHART = "HelmChart",
|
|
300
|
+
/** HelmRepository */
|
|
301
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
302
|
+
/** ImageRepository */
|
|
303
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
304
|
+
/** ImagePolicy */
|
|
305
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
306
|
+
/** ImageUpdateAutomation */
|
|
307
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
308
|
+
/** OCIRepository */
|
|
309
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Alert is the Schema for the alerts API
|
|
314
|
+
*
|
|
315
|
+
* @schema AlertV1Beta2
|
|
316
|
+
*/
|
|
317
|
+
export class AlertV1Beta2 extends ApiObject {
|
|
318
|
+
/** Returns the apiVersion and kind for "AlertV1Beta2" */
|
|
319
|
+
public static GVK: GroupVersionKind = {
|
|
320
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta2",
|
|
321
|
+
kind: "Alert"
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Renders a Kubernetes manifest for "AlertV1Beta2".
|
|
326
|
+
*
|
|
327
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
328
|
+
*
|
|
329
|
+
* @param props Initialization props
|
|
330
|
+
*/
|
|
331
|
+
public static manifest(props: AlertV1Beta2Props = {}): any {
|
|
332
|
+
return {
|
|
333
|
+
...AlertV1Beta2.GVK,
|
|
334
|
+
...toJson_AlertV1Beta2Props(props)
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Defines a "AlertV1Beta2" API object
|
|
340
|
+
*
|
|
341
|
+
* @param scope The scope in which to define this object
|
|
342
|
+
* @param id A scope-local name for the object
|
|
343
|
+
* @param props Initialization props
|
|
344
|
+
*/
|
|
345
|
+
public constructor(scope: Construct, id: string, props: AlertV1Beta2Props = {}) {
|
|
346
|
+
super(scope, id, {
|
|
347
|
+
...AlertV1Beta2.GVK,
|
|
348
|
+
...props
|
|
349
|
+
})
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** Renders the object to Kubernetes JSON. */
|
|
353
|
+
public toJson(): any {
|
|
354
|
+
const resolved = super.toJson()
|
|
355
|
+
|
|
356
|
+
return {
|
|
357
|
+
...AlertV1Beta2.GVK,
|
|
358
|
+
...toJson_AlertV1Beta2Props(resolved)
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Alert is the Schema for the alerts API
|
|
365
|
+
*
|
|
366
|
+
* @schema AlertV1Beta2
|
|
367
|
+
*/
|
|
368
|
+
export interface AlertV1Beta2Props {
|
|
369
|
+
/** @schema AlertV1Beta2#metadata */
|
|
370
|
+
metadata?: ApiObjectMetadata
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* AlertSpec defines an alerting rule for events involving a list of objects.
|
|
374
|
+
*
|
|
375
|
+
* @schema AlertV1Beta2#spec
|
|
376
|
+
*/
|
|
377
|
+
spec?: AlertV1Beta2Spec
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Converts an object of type 'AlertV1Beta2Props' to JSON representation. */
|
|
381
|
+
/* eslint-disable max-len, quote-props */
|
|
382
|
+
export function toJson_AlertV1Beta2Props(
|
|
383
|
+
obj: AlertV1Beta2Props | undefined
|
|
384
|
+
): Record<string, any> | undefined {
|
|
385
|
+
if (obj === undefined) {
|
|
386
|
+
return undefined
|
|
387
|
+
}
|
|
388
|
+
const result = {
|
|
389
|
+
metadata: obj.metadata,
|
|
390
|
+
spec: toJson_AlertV1Beta2Spec(obj.spec)
|
|
391
|
+
}
|
|
392
|
+
// filter undefined values
|
|
393
|
+
return Object.entries(result).reduce(
|
|
394
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
395
|
+
{}
|
|
396
|
+
)
|
|
397
|
+
}
|
|
398
|
+
/* eslint-enable max-len, quote-props */
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* AlertSpec defines an alerting rule for events involving a list of objects.
|
|
402
|
+
*
|
|
403
|
+
* @schema AlertV1Beta2Spec
|
|
404
|
+
*/
|
|
405
|
+
export interface AlertV1Beta2Spec {
|
|
406
|
+
/**
|
|
407
|
+
* EventMetadata is an optional field for adding metadata to events dispatched by the
|
|
408
|
+
* controller. This can be used for enhancing the context of the event. If a field would
|
|
409
|
+
* override one already present on the original event as generated by the emitter, then the
|
|
410
|
+
* override doesn't happen, i.e. the original value is preserved, and an info log is printed.
|
|
411
|
+
*
|
|
412
|
+
* @schema AlertV1Beta2Spec#eventMetadata
|
|
413
|
+
*/
|
|
414
|
+
eventMetadata?: { [key: string]: string }
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* EventSeverity specifies how to filter events based on severity. If set to 'info' no events
|
|
418
|
+
* will be filtered.
|
|
419
|
+
*
|
|
420
|
+
* @schema AlertV1Beta2Spec#eventSeverity
|
|
421
|
+
*/
|
|
422
|
+
eventSeverity?: AlertV1Beta2SpecEventSeverity
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* EventSources specifies how to filter events based on the involved object kind, name and
|
|
426
|
+
* namespace.
|
|
427
|
+
*
|
|
428
|
+
* @schema AlertV1Beta2Spec#eventSources
|
|
429
|
+
*/
|
|
430
|
+
eventSources: AlertV1Beta2SpecEventSources[]
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* ExclusionList specifies a list of Golang regular expressions to be used for excluding
|
|
434
|
+
* messages.
|
|
435
|
+
*
|
|
436
|
+
* @schema AlertV1Beta2Spec#exclusionList
|
|
437
|
+
*/
|
|
438
|
+
exclusionList?: string[]
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* InclusionList specifies a list of Golang regular expressions to be used for including
|
|
442
|
+
* messages.
|
|
443
|
+
*
|
|
444
|
+
* @schema AlertV1Beta2Spec#inclusionList
|
|
445
|
+
*/
|
|
446
|
+
inclusionList?: string[]
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* ProviderRef specifies which Provider this Alert should use.
|
|
450
|
+
*
|
|
451
|
+
* @schema AlertV1Beta2Spec#providerRef
|
|
452
|
+
*/
|
|
453
|
+
providerRef: AlertV1Beta2SpecProviderRef
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Summary holds a short description of the impact and affected cluster.
|
|
457
|
+
*
|
|
458
|
+
* @schema AlertV1Beta2Spec#summary
|
|
459
|
+
*/
|
|
460
|
+
summary?: string
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Suspend tells the controller to suspend subsequent events handling for this Alert.
|
|
464
|
+
*
|
|
465
|
+
* @schema AlertV1Beta2Spec#suspend
|
|
466
|
+
*/
|
|
467
|
+
suspend?: boolean
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/** Converts an object of type 'AlertV1Beta2Spec' to JSON representation. */
|
|
471
|
+
/* eslint-disable max-len, quote-props */
|
|
472
|
+
export function toJson_AlertV1Beta2Spec(
|
|
473
|
+
obj: AlertV1Beta2Spec | undefined
|
|
474
|
+
): Record<string, any> | undefined {
|
|
475
|
+
if (obj === undefined) {
|
|
476
|
+
return undefined
|
|
477
|
+
}
|
|
478
|
+
const result = {
|
|
479
|
+
eventMetadata:
|
|
480
|
+
obj.eventMetadata === undefined
|
|
481
|
+
? undefined
|
|
482
|
+
: Object.entries(obj.eventMetadata).reduce(
|
|
483
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
484
|
+
{}
|
|
485
|
+
),
|
|
486
|
+
eventSeverity: obj.eventSeverity,
|
|
487
|
+
eventSources: obj.eventSources?.map(y => toJson_AlertV1Beta2SpecEventSources(y)),
|
|
488
|
+
exclusionList: obj.exclusionList?.map(y => y),
|
|
489
|
+
inclusionList: obj.inclusionList?.map(y => y),
|
|
490
|
+
providerRef: toJson_AlertV1Beta2SpecProviderRef(obj.providerRef),
|
|
491
|
+
summary: obj.summary,
|
|
492
|
+
suspend: obj.suspend
|
|
493
|
+
}
|
|
494
|
+
// filter undefined values
|
|
495
|
+
return Object.entries(result).reduce(
|
|
496
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
497
|
+
{}
|
|
498
|
+
)
|
|
499
|
+
}
|
|
500
|
+
/* eslint-enable max-len, quote-props */
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* EventSeverity specifies how to filter events based on severity. If set to 'info' no events will
|
|
504
|
+
* be filtered.
|
|
505
|
+
*
|
|
506
|
+
* @schema AlertV1Beta2SpecEventSeverity
|
|
507
|
+
*/
|
|
508
|
+
export enum AlertV1Beta2SpecEventSeverity {
|
|
509
|
+
/** Info */
|
|
510
|
+
INFO = "info",
|
|
511
|
+
/** Error */
|
|
512
|
+
ERROR = "error"
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
517
|
+
* object at cluster level
|
|
518
|
+
*
|
|
519
|
+
* @schema AlertV1Beta2SpecEventSources
|
|
520
|
+
*/
|
|
521
|
+
export interface AlertV1Beta2SpecEventSources {
|
|
522
|
+
/**
|
|
523
|
+
* API version of the referent
|
|
524
|
+
*
|
|
525
|
+
* @schema AlertV1Beta2SpecEventSources#apiVersion
|
|
526
|
+
*/
|
|
527
|
+
apiVersion?: string
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Kind of the referent
|
|
531
|
+
*
|
|
532
|
+
* @schema AlertV1Beta2SpecEventSources#kind
|
|
533
|
+
*/
|
|
534
|
+
kind: AlertV1Beta2SpecEventSourcesKind
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
538
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
539
|
+
* and the values array contains only "value". The requirements are ANDed. MatchLabels requires
|
|
540
|
+
* the name to be set to `*`.
|
|
541
|
+
*
|
|
542
|
+
* @schema AlertV1Beta2SpecEventSources#matchLabels
|
|
543
|
+
*/
|
|
544
|
+
matchLabels?: { [key: string]: string }
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Name of the referent If multiple resources are targeted `*` may be set.
|
|
548
|
+
*
|
|
549
|
+
* @schema AlertV1Beta2SpecEventSources#name
|
|
550
|
+
*/
|
|
551
|
+
name: string
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Namespace of the referent
|
|
555
|
+
*
|
|
556
|
+
* @schema AlertV1Beta2SpecEventSources#namespace
|
|
557
|
+
*/
|
|
558
|
+
namespace?: string
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/** Converts an object of type 'AlertV1Beta2SpecEventSources' to JSON representation. */
|
|
562
|
+
/* eslint-disable max-len, quote-props */
|
|
563
|
+
export function toJson_AlertV1Beta2SpecEventSources(
|
|
564
|
+
obj: AlertV1Beta2SpecEventSources | undefined
|
|
565
|
+
): Record<string, any> | undefined {
|
|
566
|
+
if (obj === undefined) {
|
|
567
|
+
return undefined
|
|
568
|
+
}
|
|
569
|
+
const result = {
|
|
570
|
+
apiVersion: obj.apiVersion,
|
|
571
|
+
kind: obj.kind,
|
|
572
|
+
matchLabels:
|
|
573
|
+
obj.matchLabels === undefined
|
|
574
|
+
? undefined
|
|
575
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
576
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
577
|
+
{}
|
|
578
|
+
),
|
|
579
|
+
name: obj.name,
|
|
580
|
+
namespace: obj.namespace
|
|
581
|
+
}
|
|
582
|
+
// filter undefined values
|
|
583
|
+
return Object.entries(result).reduce(
|
|
584
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
585
|
+
{}
|
|
586
|
+
)
|
|
587
|
+
}
|
|
588
|
+
/* eslint-enable max-len, quote-props */
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* ProviderRef specifies which Provider this Alert should use.
|
|
592
|
+
*
|
|
593
|
+
* @schema AlertV1Beta2SpecProviderRef
|
|
594
|
+
*/
|
|
595
|
+
export interface AlertV1Beta2SpecProviderRef {
|
|
596
|
+
/**
|
|
597
|
+
* Name of the referent.
|
|
598
|
+
*
|
|
599
|
+
* @schema AlertV1Beta2SpecProviderRef#name
|
|
600
|
+
*/
|
|
601
|
+
name: string
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** Converts an object of type 'AlertV1Beta2SpecProviderRef' to JSON representation. */
|
|
605
|
+
/* eslint-disable max-len, quote-props */
|
|
606
|
+
export function toJson_AlertV1Beta2SpecProviderRef(
|
|
607
|
+
obj: AlertV1Beta2SpecProviderRef | undefined
|
|
608
|
+
): Record<string, any> | undefined {
|
|
609
|
+
if (obj === undefined) {
|
|
610
|
+
return undefined
|
|
611
|
+
}
|
|
612
|
+
const result = {
|
|
613
|
+
name: obj.name
|
|
614
|
+
}
|
|
615
|
+
// filter undefined values
|
|
616
|
+
return Object.entries(result).reduce(
|
|
617
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
618
|
+
{}
|
|
619
|
+
)
|
|
620
|
+
}
|
|
621
|
+
/* eslint-enable max-len, quote-props */
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Kind of the referent
|
|
625
|
+
*
|
|
626
|
+
* @schema AlertV1Beta2SpecEventSourcesKind
|
|
627
|
+
*/
|
|
628
|
+
export enum AlertV1Beta2SpecEventSourcesKind {
|
|
629
|
+
/** Bucket */
|
|
630
|
+
BUCKET = "Bucket",
|
|
631
|
+
/** GitRepository */
|
|
632
|
+
GIT_REPOSITORY = "GitRepository",
|
|
633
|
+
/** Kustomization */
|
|
634
|
+
KUSTOMIZATION = "Kustomization",
|
|
635
|
+
/** HelmRelease */
|
|
636
|
+
HELM_RELEASE = "HelmRelease",
|
|
637
|
+
/** HelmChart */
|
|
638
|
+
HELM_CHART = "HelmChart",
|
|
639
|
+
/** HelmRepository */
|
|
640
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
641
|
+
/** ImageRepository */
|
|
642
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
643
|
+
/** ImagePolicy */
|
|
644
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
645
|
+
/** ImageUpdateAutomation */
|
|
646
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
647
|
+
/** OCIRepository */
|
|
648
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Alert is the Schema for the alerts API
|
|
653
|
+
*
|
|
654
|
+
* @schema AlertV1Beta3
|
|
655
|
+
*/
|
|
656
|
+
export class AlertV1Beta3 extends ApiObject {
|
|
657
|
+
/** Returns the apiVersion and kind for "AlertV1Beta3" */
|
|
658
|
+
public static GVK: GroupVersionKind = {
|
|
659
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta3",
|
|
660
|
+
kind: "Alert"
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Renders a Kubernetes manifest for "AlertV1Beta3".
|
|
665
|
+
*
|
|
666
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
667
|
+
*
|
|
668
|
+
* @param props Initialization props
|
|
669
|
+
*/
|
|
670
|
+
public static manifest(props: AlertV1Beta3Props = {}): any {
|
|
671
|
+
return {
|
|
672
|
+
...AlertV1Beta3.GVK,
|
|
673
|
+
...toJson_AlertV1Beta3Props(props)
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Defines a "AlertV1Beta3" API object
|
|
679
|
+
*
|
|
680
|
+
* @param scope The scope in which to define this object
|
|
681
|
+
* @param id A scope-local name for the object
|
|
682
|
+
* @param props Initialization props
|
|
683
|
+
*/
|
|
684
|
+
public constructor(scope: Construct, id: string, props: AlertV1Beta3Props = {}) {
|
|
685
|
+
super(scope, id, {
|
|
686
|
+
...AlertV1Beta3.GVK,
|
|
687
|
+
...props
|
|
688
|
+
})
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/** Renders the object to Kubernetes JSON. */
|
|
692
|
+
public toJson(): any {
|
|
693
|
+
const resolved = super.toJson()
|
|
694
|
+
|
|
695
|
+
return {
|
|
696
|
+
...AlertV1Beta3.GVK,
|
|
697
|
+
...toJson_AlertV1Beta3Props(resolved)
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Alert is the Schema for the alerts API
|
|
704
|
+
*
|
|
705
|
+
* @schema AlertV1Beta3
|
|
706
|
+
*/
|
|
707
|
+
export interface AlertV1Beta3Props {
|
|
708
|
+
/** @schema AlertV1Beta3#metadata */
|
|
709
|
+
metadata?: ApiObjectMetadata
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* AlertSpec defines an alerting rule for events involving a list of objects.
|
|
713
|
+
*
|
|
714
|
+
* @schema AlertV1Beta3#spec
|
|
715
|
+
*/
|
|
716
|
+
spec?: AlertV1Beta3Spec
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Converts an object of type 'AlertV1Beta3Props' to JSON representation. */
|
|
720
|
+
/* eslint-disable max-len, quote-props */
|
|
721
|
+
export function toJson_AlertV1Beta3Props(
|
|
722
|
+
obj: AlertV1Beta3Props | undefined
|
|
723
|
+
): Record<string, any> | undefined {
|
|
724
|
+
if (obj === undefined) {
|
|
725
|
+
return undefined
|
|
726
|
+
}
|
|
727
|
+
const result = {
|
|
728
|
+
metadata: obj.metadata,
|
|
729
|
+
spec: toJson_AlertV1Beta3Spec(obj.spec)
|
|
730
|
+
}
|
|
731
|
+
// filter undefined values
|
|
732
|
+
return Object.entries(result).reduce(
|
|
733
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
734
|
+
{}
|
|
735
|
+
)
|
|
736
|
+
}
|
|
737
|
+
/* eslint-enable max-len, quote-props */
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* AlertSpec defines an alerting rule for events involving a list of objects.
|
|
741
|
+
*
|
|
742
|
+
* @schema AlertV1Beta3Spec
|
|
743
|
+
*/
|
|
744
|
+
export interface AlertV1Beta3Spec {
|
|
745
|
+
/**
|
|
746
|
+
* EventMetadata is an optional field for adding metadata to events dispatched by the
|
|
747
|
+
* controller. This can be used for enhancing the context of the event. If a field would
|
|
748
|
+
* override one already present on the original event as generated by the emitter, then the
|
|
749
|
+
* override doesn't happen, i.e. the original value is preserved, and an info log is printed.
|
|
750
|
+
*
|
|
751
|
+
* @schema AlertV1Beta3Spec#eventMetadata
|
|
752
|
+
*/
|
|
753
|
+
eventMetadata?: { [key: string]: string }
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* EventSeverity specifies how to filter events based on severity. If set to 'info' no events
|
|
757
|
+
* will be filtered.
|
|
758
|
+
*
|
|
759
|
+
* @schema AlertV1Beta3Spec#eventSeverity
|
|
760
|
+
*/
|
|
761
|
+
eventSeverity?: AlertV1Beta3SpecEventSeverity
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* EventSources specifies how to filter events based on the involved object kind, name and
|
|
765
|
+
* namespace.
|
|
766
|
+
*
|
|
767
|
+
* @schema AlertV1Beta3Spec#eventSources
|
|
768
|
+
*/
|
|
769
|
+
eventSources: AlertV1Beta3SpecEventSources[]
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* ExclusionList specifies a list of Golang regular expressions to be used for excluding
|
|
773
|
+
* messages.
|
|
774
|
+
*
|
|
775
|
+
* @schema AlertV1Beta3Spec#exclusionList
|
|
776
|
+
*/
|
|
777
|
+
exclusionList?: string[]
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* InclusionList specifies a list of Golang regular expressions to be used for including
|
|
781
|
+
* messages.
|
|
782
|
+
*
|
|
783
|
+
* @schema AlertV1Beta3Spec#inclusionList
|
|
784
|
+
*/
|
|
785
|
+
inclusionList?: string[]
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* ProviderRef specifies which Provider this Alert should use.
|
|
789
|
+
*
|
|
790
|
+
* @schema AlertV1Beta3Spec#providerRef
|
|
791
|
+
*/
|
|
792
|
+
providerRef: AlertV1Beta3SpecProviderRef
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Summary holds a short description of the impact and affected cluster. Deprecated: Use
|
|
796
|
+
* EventMetadata instead.
|
|
797
|
+
*
|
|
798
|
+
* @schema AlertV1Beta3Spec#summary
|
|
799
|
+
*/
|
|
800
|
+
summary?: string
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Suspend tells the controller to suspend subsequent events handling for this Alert.
|
|
804
|
+
*
|
|
805
|
+
* @schema AlertV1Beta3Spec#suspend
|
|
806
|
+
*/
|
|
807
|
+
suspend?: boolean
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/** Converts an object of type 'AlertV1Beta3Spec' to JSON representation. */
|
|
811
|
+
/* eslint-disable max-len, quote-props */
|
|
812
|
+
export function toJson_AlertV1Beta3Spec(
|
|
813
|
+
obj: AlertV1Beta3Spec | undefined
|
|
814
|
+
): Record<string, any> | undefined {
|
|
815
|
+
if (obj === undefined) {
|
|
816
|
+
return undefined
|
|
817
|
+
}
|
|
818
|
+
const result = {
|
|
819
|
+
eventMetadata:
|
|
820
|
+
obj.eventMetadata === undefined
|
|
821
|
+
? undefined
|
|
822
|
+
: Object.entries(obj.eventMetadata).reduce(
|
|
823
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
824
|
+
{}
|
|
825
|
+
),
|
|
826
|
+
eventSeverity: obj.eventSeverity,
|
|
827
|
+
eventSources: obj.eventSources?.map(y => toJson_AlertV1Beta3SpecEventSources(y)),
|
|
828
|
+
exclusionList: obj.exclusionList?.map(y => y),
|
|
829
|
+
inclusionList: obj.inclusionList?.map(y => y),
|
|
830
|
+
providerRef: toJson_AlertV1Beta3SpecProviderRef(obj.providerRef),
|
|
831
|
+
summary: obj.summary,
|
|
832
|
+
suspend: obj.suspend
|
|
833
|
+
}
|
|
834
|
+
// filter undefined values
|
|
835
|
+
return Object.entries(result).reduce(
|
|
836
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
837
|
+
{}
|
|
838
|
+
)
|
|
839
|
+
}
|
|
840
|
+
/* eslint-enable max-len, quote-props */
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* EventSeverity specifies how to filter events based on severity. If set to 'info' no events will
|
|
844
|
+
* be filtered.
|
|
845
|
+
*
|
|
846
|
+
* @schema AlertV1Beta3SpecEventSeverity
|
|
847
|
+
*/
|
|
848
|
+
export enum AlertV1Beta3SpecEventSeverity {
|
|
849
|
+
/** Info */
|
|
850
|
+
INFO = "info",
|
|
851
|
+
/** Error */
|
|
852
|
+
ERROR = "error"
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
857
|
+
* object at cluster level
|
|
858
|
+
*
|
|
859
|
+
* @schema AlertV1Beta3SpecEventSources
|
|
860
|
+
*/
|
|
861
|
+
export interface AlertV1Beta3SpecEventSources {
|
|
862
|
+
/**
|
|
863
|
+
* API version of the referent
|
|
864
|
+
*
|
|
865
|
+
* @schema AlertV1Beta3SpecEventSources#apiVersion
|
|
866
|
+
*/
|
|
867
|
+
apiVersion?: string
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Kind of the referent
|
|
871
|
+
*
|
|
872
|
+
* @schema AlertV1Beta3SpecEventSources#kind
|
|
873
|
+
*/
|
|
874
|
+
kind: AlertV1Beta3SpecEventSourcesKind
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
878
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
879
|
+
* and the values array contains only "value". The requirements are ANDed. MatchLabels requires
|
|
880
|
+
* the name to be set to `*`.
|
|
881
|
+
*
|
|
882
|
+
* @schema AlertV1Beta3SpecEventSources#matchLabels
|
|
883
|
+
*/
|
|
884
|
+
matchLabels?: { [key: string]: string }
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Name of the referent If multiple resources are targeted `*` may be set.
|
|
888
|
+
*
|
|
889
|
+
* @schema AlertV1Beta3SpecEventSources#name
|
|
890
|
+
*/
|
|
891
|
+
name: string
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Namespace of the referent
|
|
895
|
+
*
|
|
896
|
+
* @schema AlertV1Beta3SpecEventSources#namespace
|
|
897
|
+
*/
|
|
898
|
+
namespace?: string
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/** Converts an object of type 'AlertV1Beta3SpecEventSources' to JSON representation. */
|
|
902
|
+
/* eslint-disable max-len, quote-props */
|
|
903
|
+
export function toJson_AlertV1Beta3SpecEventSources(
|
|
904
|
+
obj: AlertV1Beta3SpecEventSources | undefined
|
|
905
|
+
): Record<string, any> | undefined {
|
|
906
|
+
if (obj === undefined) {
|
|
907
|
+
return undefined
|
|
908
|
+
}
|
|
909
|
+
const result = {
|
|
910
|
+
apiVersion: obj.apiVersion,
|
|
911
|
+
kind: obj.kind,
|
|
912
|
+
matchLabels:
|
|
913
|
+
obj.matchLabels === undefined
|
|
914
|
+
? undefined
|
|
915
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
916
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
917
|
+
{}
|
|
918
|
+
),
|
|
919
|
+
name: obj.name,
|
|
920
|
+
namespace: obj.namespace
|
|
921
|
+
}
|
|
922
|
+
// filter undefined values
|
|
923
|
+
return Object.entries(result).reduce(
|
|
924
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
925
|
+
{}
|
|
926
|
+
)
|
|
927
|
+
}
|
|
928
|
+
/* eslint-enable max-len, quote-props */
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* ProviderRef specifies which Provider this Alert should use.
|
|
932
|
+
*
|
|
933
|
+
* @schema AlertV1Beta3SpecProviderRef
|
|
934
|
+
*/
|
|
935
|
+
export interface AlertV1Beta3SpecProviderRef {
|
|
936
|
+
/**
|
|
937
|
+
* Name of the referent.
|
|
938
|
+
*
|
|
939
|
+
* @schema AlertV1Beta3SpecProviderRef#name
|
|
940
|
+
*/
|
|
941
|
+
name: string
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/** Converts an object of type 'AlertV1Beta3SpecProviderRef' to JSON representation. */
|
|
945
|
+
/* eslint-disable max-len, quote-props */
|
|
946
|
+
export function toJson_AlertV1Beta3SpecProviderRef(
|
|
947
|
+
obj: AlertV1Beta3SpecProviderRef | undefined
|
|
948
|
+
): Record<string, any> | undefined {
|
|
949
|
+
if (obj === undefined) {
|
|
950
|
+
return undefined
|
|
951
|
+
}
|
|
952
|
+
const result = {
|
|
953
|
+
name: obj.name
|
|
954
|
+
}
|
|
955
|
+
// filter undefined values
|
|
956
|
+
return Object.entries(result).reduce(
|
|
957
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
958
|
+
{}
|
|
959
|
+
)
|
|
960
|
+
}
|
|
961
|
+
/* eslint-enable max-len, quote-props */
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Kind of the referent
|
|
965
|
+
*
|
|
966
|
+
* @schema AlertV1Beta3SpecEventSourcesKind
|
|
967
|
+
*/
|
|
968
|
+
export enum AlertV1Beta3SpecEventSourcesKind {
|
|
969
|
+
/** Bucket */
|
|
970
|
+
BUCKET = "Bucket",
|
|
971
|
+
/** GitRepository */
|
|
972
|
+
GIT_REPOSITORY = "GitRepository",
|
|
973
|
+
/** Kustomization */
|
|
974
|
+
KUSTOMIZATION = "Kustomization",
|
|
975
|
+
/** HelmRelease */
|
|
976
|
+
HELM_RELEASE = "HelmRelease",
|
|
977
|
+
/** HelmChart */
|
|
978
|
+
HELM_CHART = "HelmChart",
|
|
979
|
+
/** HelmRepository */
|
|
980
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
981
|
+
/** ImageRepository */
|
|
982
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
983
|
+
/** ImagePolicy */
|
|
984
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
985
|
+
/** ImageUpdateAutomation */
|
|
986
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
987
|
+
/** OCIRepository */
|
|
988
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Provider is the Schema for the providers API
|
|
993
|
+
*
|
|
994
|
+
* @schema Provider
|
|
995
|
+
*/
|
|
996
|
+
export class Provider extends ApiObject {
|
|
997
|
+
/** Returns the apiVersion and kind for "Provider" */
|
|
998
|
+
public static GVK: GroupVersionKind = {
|
|
999
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta1",
|
|
1000
|
+
kind: "Provider"
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Renders a Kubernetes manifest for "Provider".
|
|
1005
|
+
*
|
|
1006
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
1007
|
+
*
|
|
1008
|
+
* @param props Initialization props
|
|
1009
|
+
*/
|
|
1010
|
+
public static manifest(props: ProviderProps = {}): any {
|
|
1011
|
+
return {
|
|
1012
|
+
...Provider.GVK,
|
|
1013
|
+
...toJson_ProviderProps(props)
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Defines a "Provider" API object
|
|
1019
|
+
*
|
|
1020
|
+
* @param scope The scope in which to define this object
|
|
1021
|
+
* @param id A scope-local name for the object
|
|
1022
|
+
* @param props Initialization props
|
|
1023
|
+
*/
|
|
1024
|
+
public constructor(scope: Construct, id: string, props: ProviderProps = {}) {
|
|
1025
|
+
super(scope, id, {
|
|
1026
|
+
...Provider.GVK,
|
|
1027
|
+
...props
|
|
1028
|
+
})
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/** Renders the object to Kubernetes JSON. */
|
|
1032
|
+
public toJson(): any {
|
|
1033
|
+
const resolved = super.toJson()
|
|
1034
|
+
|
|
1035
|
+
return {
|
|
1036
|
+
...Provider.GVK,
|
|
1037
|
+
...toJson_ProviderProps(resolved)
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Provider is the Schema for the providers API
|
|
1044
|
+
*
|
|
1045
|
+
* @schema Provider
|
|
1046
|
+
*/
|
|
1047
|
+
export interface ProviderProps {
|
|
1048
|
+
/** @schema Provider#metadata */
|
|
1049
|
+
metadata?: ApiObjectMetadata
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* ProviderSpec defines the desired state of Provider
|
|
1053
|
+
*
|
|
1054
|
+
* @schema Provider#spec
|
|
1055
|
+
*/
|
|
1056
|
+
spec?: ProviderSpec
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/** Converts an object of type 'ProviderProps' to JSON representation. */
|
|
1060
|
+
/* eslint-disable max-len, quote-props */
|
|
1061
|
+
export function toJson_ProviderProps(
|
|
1062
|
+
obj: ProviderProps | undefined
|
|
1063
|
+
): Record<string, any> | undefined {
|
|
1064
|
+
if (obj === undefined) {
|
|
1065
|
+
return undefined
|
|
1066
|
+
}
|
|
1067
|
+
const result = {
|
|
1068
|
+
metadata: obj.metadata,
|
|
1069
|
+
spec: toJson_ProviderSpec(obj.spec)
|
|
1070
|
+
}
|
|
1071
|
+
// filter undefined values
|
|
1072
|
+
return Object.entries(result).reduce(
|
|
1073
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1074
|
+
{}
|
|
1075
|
+
)
|
|
1076
|
+
}
|
|
1077
|
+
/* eslint-enable max-len, quote-props */
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* ProviderSpec defines the desired state of Provider
|
|
1081
|
+
*
|
|
1082
|
+
* @schema ProviderSpec
|
|
1083
|
+
*/
|
|
1084
|
+
export interface ProviderSpec {
|
|
1085
|
+
/**
|
|
1086
|
+
* HTTP/S webhook address of this provider
|
|
1087
|
+
*
|
|
1088
|
+
* @schema ProviderSpec#address
|
|
1089
|
+
*/
|
|
1090
|
+
address?: string
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* CertSecretRef can be given the name of a secret containing a PEM-encoded CA certificate
|
|
1094
|
+
* (`caFile`)
|
|
1095
|
+
*
|
|
1096
|
+
* @schema ProviderSpec#certSecretRef
|
|
1097
|
+
*/
|
|
1098
|
+
certSecretRef?: ProviderSpecCertSecretRef
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Alert channel for this provider
|
|
1102
|
+
*
|
|
1103
|
+
* @schema ProviderSpec#channel
|
|
1104
|
+
*/
|
|
1105
|
+
channel?: string
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* HTTP/S address of the proxy
|
|
1109
|
+
*
|
|
1110
|
+
* @schema ProviderSpec#proxy
|
|
1111
|
+
*/
|
|
1112
|
+
proxy?: string
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Secret reference containing the provider webhook URL using "address" as data key
|
|
1116
|
+
*
|
|
1117
|
+
* @schema ProviderSpec#secretRef
|
|
1118
|
+
*/
|
|
1119
|
+
secretRef?: ProviderSpecSecretRef
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* This flag tells the controller to suspend subsequent events handling. Defaults to false.
|
|
1123
|
+
*
|
|
1124
|
+
* @default false.
|
|
1125
|
+
* @schema ProviderSpec#suspend
|
|
1126
|
+
*/
|
|
1127
|
+
suspend?: boolean
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Timeout for sending alerts to the provider.
|
|
1131
|
+
*
|
|
1132
|
+
* @schema ProviderSpec#timeout
|
|
1133
|
+
*/
|
|
1134
|
+
timeout?: string
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Type of provider
|
|
1138
|
+
*
|
|
1139
|
+
* @schema ProviderSpec#type
|
|
1140
|
+
*/
|
|
1141
|
+
type: ProviderSpecType
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Bot username for this provider
|
|
1145
|
+
*
|
|
1146
|
+
* @schema ProviderSpec#username
|
|
1147
|
+
*/
|
|
1148
|
+
username?: string
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/** Converts an object of type 'ProviderSpec' to JSON representation. */
|
|
1152
|
+
/* eslint-disable max-len, quote-props */
|
|
1153
|
+
export function toJson_ProviderSpec(
|
|
1154
|
+
obj: ProviderSpec | undefined
|
|
1155
|
+
): Record<string, any> | undefined {
|
|
1156
|
+
if (obj === undefined) {
|
|
1157
|
+
return undefined
|
|
1158
|
+
}
|
|
1159
|
+
const result = {
|
|
1160
|
+
address: obj.address,
|
|
1161
|
+
certSecretRef: toJson_ProviderSpecCertSecretRef(obj.certSecretRef),
|
|
1162
|
+
channel: obj.channel,
|
|
1163
|
+
proxy: obj.proxy,
|
|
1164
|
+
secretRef: toJson_ProviderSpecSecretRef(obj.secretRef),
|
|
1165
|
+
suspend: obj.suspend,
|
|
1166
|
+
timeout: obj.timeout,
|
|
1167
|
+
type: obj.type,
|
|
1168
|
+
username: obj.username
|
|
1169
|
+
}
|
|
1170
|
+
// filter undefined values
|
|
1171
|
+
return Object.entries(result).reduce(
|
|
1172
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1173
|
+
{}
|
|
1174
|
+
)
|
|
1175
|
+
}
|
|
1176
|
+
/* eslint-enable max-len, quote-props */
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* CertSecretRef can be given the name of a secret containing a PEM-encoded CA certificate
|
|
1180
|
+
* (`caFile`)
|
|
1181
|
+
*
|
|
1182
|
+
* @schema ProviderSpecCertSecretRef
|
|
1183
|
+
*/
|
|
1184
|
+
export interface ProviderSpecCertSecretRef {
|
|
1185
|
+
/**
|
|
1186
|
+
* Name of the referent.
|
|
1187
|
+
*
|
|
1188
|
+
* @schema ProviderSpecCertSecretRef#name
|
|
1189
|
+
*/
|
|
1190
|
+
name: string
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/** Converts an object of type 'ProviderSpecCertSecretRef' to JSON representation. */
|
|
1194
|
+
/* eslint-disable max-len, quote-props */
|
|
1195
|
+
export function toJson_ProviderSpecCertSecretRef(
|
|
1196
|
+
obj: ProviderSpecCertSecretRef | undefined
|
|
1197
|
+
): Record<string, any> | undefined {
|
|
1198
|
+
if (obj === undefined) {
|
|
1199
|
+
return undefined
|
|
1200
|
+
}
|
|
1201
|
+
const result = {
|
|
1202
|
+
name: obj.name
|
|
1203
|
+
}
|
|
1204
|
+
// filter undefined values
|
|
1205
|
+
return Object.entries(result).reduce(
|
|
1206
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1207
|
+
{}
|
|
1208
|
+
)
|
|
1209
|
+
}
|
|
1210
|
+
/* eslint-enable max-len, quote-props */
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Secret reference containing the provider webhook URL using "address" as data key
|
|
1214
|
+
*
|
|
1215
|
+
* @schema ProviderSpecSecretRef
|
|
1216
|
+
*/
|
|
1217
|
+
export interface ProviderSpecSecretRef {
|
|
1218
|
+
/**
|
|
1219
|
+
* Name of the referent.
|
|
1220
|
+
*
|
|
1221
|
+
* @schema ProviderSpecSecretRef#name
|
|
1222
|
+
*/
|
|
1223
|
+
name: string
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/** Converts an object of type 'ProviderSpecSecretRef' to JSON representation. */
|
|
1227
|
+
/* eslint-disable max-len, quote-props */
|
|
1228
|
+
export function toJson_ProviderSpecSecretRef(
|
|
1229
|
+
obj: ProviderSpecSecretRef | undefined
|
|
1230
|
+
): Record<string, any> | undefined {
|
|
1231
|
+
if (obj === undefined) {
|
|
1232
|
+
return undefined
|
|
1233
|
+
}
|
|
1234
|
+
const result = {
|
|
1235
|
+
name: obj.name
|
|
1236
|
+
}
|
|
1237
|
+
// filter undefined values
|
|
1238
|
+
return Object.entries(result).reduce(
|
|
1239
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1240
|
+
{}
|
|
1241
|
+
)
|
|
1242
|
+
}
|
|
1243
|
+
/* eslint-enable max-len, quote-props */
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Type of provider
|
|
1247
|
+
*
|
|
1248
|
+
* @schema ProviderSpecType
|
|
1249
|
+
*/
|
|
1250
|
+
export enum ProviderSpecType {
|
|
1251
|
+
/** Slack */
|
|
1252
|
+
SLACK = "slack",
|
|
1253
|
+
/** Discord */
|
|
1254
|
+
DISCORD = "discord",
|
|
1255
|
+
/** Msteams */
|
|
1256
|
+
MSTEAMS = "msteams",
|
|
1257
|
+
/** Rocket */
|
|
1258
|
+
ROCKET = "rocket",
|
|
1259
|
+
/** Generic */
|
|
1260
|
+
GENERIC = "generic",
|
|
1261
|
+
/** Generic-hmac */
|
|
1262
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
1263
|
+
/** Github */
|
|
1264
|
+
GITHUB = "github",
|
|
1265
|
+
/** Gitlab */
|
|
1266
|
+
GITLAB = "gitlab",
|
|
1267
|
+
/** Bitbucket */
|
|
1268
|
+
BITBUCKET = "bitbucket",
|
|
1269
|
+
/** Azuredevops */
|
|
1270
|
+
AZUREDEVOPS = "azuredevops",
|
|
1271
|
+
/** Googlechat */
|
|
1272
|
+
GOOGLECHAT = "googlechat",
|
|
1273
|
+
/** Webex */
|
|
1274
|
+
WEBEX = "webex",
|
|
1275
|
+
/** Sentry */
|
|
1276
|
+
SENTRY = "sentry",
|
|
1277
|
+
/** Azureeventhub */
|
|
1278
|
+
AZUREEVENTHUB = "azureeventhub",
|
|
1279
|
+
/** Telegram */
|
|
1280
|
+
TELEGRAM = "telegram",
|
|
1281
|
+
/** Lark */
|
|
1282
|
+
LARK = "lark",
|
|
1283
|
+
/** Matrix */
|
|
1284
|
+
MATRIX = "matrix",
|
|
1285
|
+
/** Opsgenie */
|
|
1286
|
+
OPSGENIE = "opsgenie",
|
|
1287
|
+
/** Alertmanager */
|
|
1288
|
+
ALERTMANAGER = "alertmanager",
|
|
1289
|
+
/** Grafana */
|
|
1290
|
+
GRAFANA = "grafana",
|
|
1291
|
+
/** Githubdispatch */
|
|
1292
|
+
GITHUBDISPATCH = "githubdispatch"
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/**
|
|
1296
|
+
* Provider is the Schema for the providers API.
|
|
1297
|
+
*
|
|
1298
|
+
* @schema ProviderV1Beta2
|
|
1299
|
+
*/
|
|
1300
|
+
export class ProviderV1Beta2 extends ApiObject {
|
|
1301
|
+
/** Returns the apiVersion and kind for "ProviderV1Beta2" */
|
|
1302
|
+
public static GVK: GroupVersionKind = {
|
|
1303
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta2",
|
|
1304
|
+
kind: "Provider"
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* Renders a Kubernetes manifest for "ProviderV1Beta2".
|
|
1309
|
+
*
|
|
1310
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
1311
|
+
*
|
|
1312
|
+
* @param props Initialization props
|
|
1313
|
+
*/
|
|
1314
|
+
public static manifest(props: ProviderV1Beta2Props = {}): any {
|
|
1315
|
+
return {
|
|
1316
|
+
...ProviderV1Beta2.GVK,
|
|
1317
|
+
...toJson_ProviderV1Beta2Props(props)
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Defines a "ProviderV1Beta2" API object
|
|
1323
|
+
*
|
|
1324
|
+
* @param scope The scope in which to define this object
|
|
1325
|
+
* @param id A scope-local name for the object
|
|
1326
|
+
* @param props Initialization props
|
|
1327
|
+
*/
|
|
1328
|
+
public constructor(scope: Construct, id: string, props: ProviderV1Beta2Props = {}) {
|
|
1329
|
+
super(scope, id, {
|
|
1330
|
+
...ProviderV1Beta2.GVK,
|
|
1331
|
+
...props
|
|
1332
|
+
})
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/** Renders the object to Kubernetes JSON. */
|
|
1336
|
+
public toJson(): any {
|
|
1337
|
+
const resolved = super.toJson()
|
|
1338
|
+
|
|
1339
|
+
return {
|
|
1340
|
+
...ProviderV1Beta2.GVK,
|
|
1341
|
+
...toJson_ProviderV1Beta2Props(resolved)
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
/**
|
|
1347
|
+
* Provider is the Schema for the providers API.
|
|
1348
|
+
*
|
|
1349
|
+
* @schema ProviderV1Beta2
|
|
1350
|
+
*/
|
|
1351
|
+
export interface ProviderV1Beta2Props {
|
|
1352
|
+
/** @schema ProviderV1Beta2#metadata */
|
|
1353
|
+
metadata?: ApiObjectMetadata
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* ProviderSpec defines the desired state of the Provider.
|
|
1357
|
+
*
|
|
1358
|
+
* @schema ProviderV1Beta2#spec
|
|
1359
|
+
*/
|
|
1360
|
+
spec?: ProviderV1Beta2Spec
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/** Converts an object of type 'ProviderV1Beta2Props' to JSON representation. */
|
|
1364
|
+
/* eslint-disable max-len, quote-props */
|
|
1365
|
+
export function toJson_ProviderV1Beta2Props(
|
|
1366
|
+
obj: ProviderV1Beta2Props | undefined
|
|
1367
|
+
): Record<string, any> | undefined {
|
|
1368
|
+
if (obj === undefined) {
|
|
1369
|
+
return undefined
|
|
1370
|
+
}
|
|
1371
|
+
const result = {
|
|
1372
|
+
metadata: obj.metadata,
|
|
1373
|
+
spec: toJson_ProviderV1Beta2Spec(obj.spec)
|
|
1374
|
+
}
|
|
1375
|
+
// filter undefined values
|
|
1376
|
+
return Object.entries(result).reduce(
|
|
1377
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1378
|
+
{}
|
|
1379
|
+
)
|
|
1380
|
+
}
|
|
1381
|
+
/* eslint-enable max-len, quote-props */
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* ProviderSpec defines the desired state of the Provider.
|
|
1385
|
+
*
|
|
1386
|
+
* @schema ProviderV1Beta2Spec
|
|
1387
|
+
*/
|
|
1388
|
+
export interface ProviderV1Beta2Spec {
|
|
1389
|
+
/**
|
|
1390
|
+
* Address specifies the endpoint, in a generic sense, to where alerts are sent. What kind of
|
|
1391
|
+
* endpoint depends on the specific Provider type being used. For the generic Provider, for
|
|
1392
|
+
* example, this is an HTTP/S address. For other Provider types this could be a project ID or a
|
|
1393
|
+
* namespace.
|
|
1394
|
+
*
|
|
1395
|
+
* @schema ProviderV1Beta2Spec#address
|
|
1396
|
+
*/
|
|
1397
|
+
address?: string
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* CertSecretRef specifies the Secret containing a PEM-encoded CA certificate (in the `ca.crt`
|
|
1401
|
+
* key).
|
|
1402
|
+
*
|
|
1403
|
+
* Note: Support for the `caFile` key has been deprecated.
|
|
1404
|
+
*
|
|
1405
|
+
* @schema ProviderV1Beta2Spec#certSecretRef
|
|
1406
|
+
*/
|
|
1407
|
+
certSecretRef?: ProviderV1Beta2SpecCertSecretRef
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* Channel specifies the destination channel where events should be posted.
|
|
1411
|
+
*
|
|
1412
|
+
* @schema ProviderV1Beta2Spec#channel
|
|
1413
|
+
*/
|
|
1414
|
+
channel?: string
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Interval at which to reconcile the Provider with its Secret references.
|
|
1418
|
+
*
|
|
1419
|
+
* @schema ProviderV1Beta2Spec#interval
|
|
1420
|
+
*/
|
|
1421
|
+
interval?: string
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Proxy the HTTP/S address of the proxy server.
|
|
1425
|
+
*
|
|
1426
|
+
* @schema ProviderV1Beta2Spec#proxy
|
|
1427
|
+
*/
|
|
1428
|
+
proxy?: string
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* SecretRef specifies the Secret containing the authentication credentials for this Provider.
|
|
1432
|
+
*
|
|
1433
|
+
* @schema ProviderV1Beta2Spec#secretRef
|
|
1434
|
+
*/
|
|
1435
|
+
secretRef?: ProviderV1Beta2SpecSecretRef
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* Suspend tells the controller to suspend subsequent events handling for this Provider.
|
|
1439
|
+
*
|
|
1440
|
+
* @schema ProviderV1Beta2Spec#suspend
|
|
1441
|
+
*/
|
|
1442
|
+
suspend?: boolean
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Timeout for sending alerts to the Provider.
|
|
1446
|
+
*
|
|
1447
|
+
* @schema ProviderV1Beta2Spec#timeout
|
|
1448
|
+
*/
|
|
1449
|
+
timeout?: string
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Type specifies which Provider implementation to use.
|
|
1453
|
+
*
|
|
1454
|
+
* @schema ProviderV1Beta2Spec#type
|
|
1455
|
+
*/
|
|
1456
|
+
type: ProviderV1Beta2SpecType
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Username specifies the name under which events are posted.
|
|
1460
|
+
*
|
|
1461
|
+
* @schema ProviderV1Beta2Spec#username
|
|
1462
|
+
*/
|
|
1463
|
+
username?: string
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/** Converts an object of type 'ProviderV1Beta2Spec' to JSON representation. */
|
|
1467
|
+
/* eslint-disable max-len, quote-props */
|
|
1468
|
+
export function toJson_ProviderV1Beta2Spec(
|
|
1469
|
+
obj: ProviderV1Beta2Spec | undefined
|
|
1470
|
+
): Record<string, any> | undefined {
|
|
1471
|
+
if (obj === undefined) {
|
|
1472
|
+
return undefined
|
|
1473
|
+
}
|
|
1474
|
+
const result = {
|
|
1475
|
+
address: obj.address,
|
|
1476
|
+
certSecretRef: toJson_ProviderV1Beta2SpecCertSecretRef(obj.certSecretRef),
|
|
1477
|
+
channel: obj.channel,
|
|
1478
|
+
interval: obj.interval,
|
|
1479
|
+
proxy: obj.proxy,
|
|
1480
|
+
secretRef: toJson_ProviderV1Beta2SpecSecretRef(obj.secretRef),
|
|
1481
|
+
suspend: obj.suspend,
|
|
1482
|
+
timeout: obj.timeout,
|
|
1483
|
+
type: obj.type,
|
|
1484
|
+
username: obj.username
|
|
1485
|
+
}
|
|
1486
|
+
// filter undefined values
|
|
1487
|
+
return Object.entries(result).reduce(
|
|
1488
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1489
|
+
{}
|
|
1490
|
+
)
|
|
1491
|
+
}
|
|
1492
|
+
/* eslint-enable max-len, quote-props */
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* CertSecretRef specifies the Secret containing a PEM-encoded CA certificate (in the `ca.crt` key).
|
|
1496
|
+
*
|
|
1497
|
+
* Note: Support for the `caFile` key has been deprecated.
|
|
1498
|
+
*
|
|
1499
|
+
* @schema ProviderV1Beta2SpecCertSecretRef
|
|
1500
|
+
*/
|
|
1501
|
+
export interface ProviderV1Beta2SpecCertSecretRef {
|
|
1502
|
+
/**
|
|
1503
|
+
* Name of the referent.
|
|
1504
|
+
*
|
|
1505
|
+
* @schema ProviderV1Beta2SpecCertSecretRef#name
|
|
1506
|
+
*/
|
|
1507
|
+
name: string
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/** Converts an object of type 'ProviderV1Beta2SpecCertSecretRef' to JSON representation. */
|
|
1511
|
+
/* eslint-disable max-len, quote-props */
|
|
1512
|
+
export function toJson_ProviderV1Beta2SpecCertSecretRef(
|
|
1513
|
+
obj: ProviderV1Beta2SpecCertSecretRef | undefined
|
|
1514
|
+
): Record<string, any> | undefined {
|
|
1515
|
+
if (obj === undefined) {
|
|
1516
|
+
return undefined
|
|
1517
|
+
}
|
|
1518
|
+
const result = {
|
|
1519
|
+
name: obj.name
|
|
1520
|
+
}
|
|
1521
|
+
// filter undefined values
|
|
1522
|
+
return Object.entries(result).reduce(
|
|
1523
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1524
|
+
{}
|
|
1525
|
+
)
|
|
1526
|
+
}
|
|
1527
|
+
/* eslint-enable max-len, quote-props */
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* SecretRef specifies the Secret containing the authentication credentials for this Provider.
|
|
1531
|
+
*
|
|
1532
|
+
* @schema ProviderV1Beta2SpecSecretRef
|
|
1533
|
+
*/
|
|
1534
|
+
export interface ProviderV1Beta2SpecSecretRef {
|
|
1535
|
+
/**
|
|
1536
|
+
* Name of the referent.
|
|
1537
|
+
*
|
|
1538
|
+
* @schema ProviderV1Beta2SpecSecretRef#name
|
|
1539
|
+
*/
|
|
1540
|
+
name: string
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
/** Converts an object of type 'ProviderV1Beta2SpecSecretRef' to JSON representation. */
|
|
1544
|
+
/* eslint-disable max-len, quote-props */
|
|
1545
|
+
export function toJson_ProviderV1Beta2SpecSecretRef(
|
|
1546
|
+
obj: ProviderV1Beta2SpecSecretRef | undefined
|
|
1547
|
+
): Record<string, any> | undefined {
|
|
1548
|
+
if (obj === undefined) {
|
|
1549
|
+
return undefined
|
|
1550
|
+
}
|
|
1551
|
+
const result = {
|
|
1552
|
+
name: obj.name
|
|
1553
|
+
}
|
|
1554
|
+
// filter undefined values
|
|
1555
|
+
return Object.entries(result).reduce(
|
|
1556
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1557
|
+
{}
|
|
1558
|
+
)
|
|
1559
|
+
}
|
|
1560
|
+
/* eslint-enable max-len, quote-props */
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Type specifies which Provider implementation to use.
|
|
1564
|
+
*
|
|
1565
|
+
* @schema ProviderV1Beta2SpecType
|
|
1566
|
+
*/
|
|
1567
|
+
export enum ProviderV1Beta2SpecType {
|
|
1568
|
+
/** Slack */
|
|
1569
|
+
SLACK = "slack",
|
|
1570
|
+
/** Discord */
|
|
1571
|
+
DISCORD = "discord",
|
|
1572
|
+
/** Msteams */
|
|
1573
|
+
MSTEAMS = "msteams",
|
|
1574
|
+
/** Rocket */
|
|
1575
|
+
ROCKET = "rocket",
|
|
1576
|
+
/** Generic */
|
|
1577
|
+
GENERIC = "generic",
|
|
1578
|
+
/** Generic-hmac */
|
|
1579
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
1580
|
+
/** Github */
|
|
1581
|
+
GITHUB = "github",
|
|
1582
|
+
/** Gitlab */
|
|
1583
|
+
GITLAB = "gitlab",
|
|
1584
|
+
/** Gitea */
|
|
1585
|
+
GITEA = "gitea",
|
|
1586
|
+
/** Bitbucketserver */
|
|
1587
|
+
BITBUCKETSERVER = "bitbucketserver",
|
|
1588
|
+
/** Bitbucket */
|
|
1589
|
+
BITBUCKET = "bitbucket",
|
|
1590
|
+
/** Azuredevops */
|
|
1591
|
+
AZUREDEVOPS = "azuredevops",
|
|
1592
|
+
/** Googlechat */
|
|
1593
|
+
GOOGLECHAT = "googlechat",
|
|
1594
|
+
/** Googlepubsub */
|
|
1595
|
+
GOOGLEPUBSUB = "googlepubsub",
|
|
1596
|
+
/** Webex */
|
|
1597
|
+
WEBEX = "webex",
|
|
1598
|
+
/** Sentry */
|
|
1599
|
+
SENTRY = "sentry",
|
|
1600
|
+
/** Azureeventhub */
|
|
1601
|
+
AZUREEVENTHUB = "azureeventhub",
|
|
1602
|
+
/** Telegram */
|
|
1603
|
+
TELEGRAM = "telegram",
|
|
1604
|
+
/** Lark */
|
|
1605
|
+
LARK = "lark",
|
|
1606
|
+
/** Matrix */
|
|
1607
|
+
MATRIX = "matrix",
|
|
1608
|
+
/** Opsgenie */
|
|
1609
|
+
OPSGENIE = "opsgenie",
|
|
1610
|
+
/** Alertmanager */
|
|
1611
|
+
ALERTMANAGER = "alertmanager",
|
|
1612
|
+
/** Grafana */
|
|
1613
|
+
GRAFANA = "grafana",
|
|
1614
|
+
/** Githubdispatch */
|
|
1615
|
+
GITHUBDISPATCH = "githubdispatch",
|
|
1616
|
+
/** Pagerduty */
|
|
1617
|
+
PAGERDUTY = "pagerduty",
|
|
1618
|
+
/** Datadog */
|
|
1619
|
+
DATADOG = "datadog"
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Provider is the Schema for the providers API
|
|
1624
|
+
*
|
|
1625
|
+
* @schema ProviderV1Beta3
|
|
1626
|
+
*/
|
|
1627
|
+
export class ProviderV1Beta3 extends ApiObject {
|
|
1628
|
+
/** Returns the apiVersion and kind for "ProviderV1Beta3" */
|
|
1629
|
+
public static GVK: GroupVersionKind = {
|
|
1630
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta3",
|
|
1631
|
+
kind: "Provider"
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
/**
|
|
1635
|
+
* Renders a Kubernetes manifest for "ProviderV1Beta3".
|
|
1636
|
+
*
|
|
1637
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
1638
|
+
*
|
|
1639
|
+
* @param props Initialization props
|
|
1640
|
+
*/
|
|
1641
|
+
public static manifest(props: ProviderV1Beta3Props = {}): any {
|
|
1642
|
+
return {
|
|
1643
|
+
...ProviderV1Beta3.GVK,
|
|
1644
|
+
...toJson_ProviderV1Beta3Props(props)
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Defines a "ProviderV1Beta3" API object
|
|
1650
|
+
*
|
|
1651
|
+
* @param scope The scope in which to define this object
|
|
1652
|
+
* @param id A scope-local name for the object
|
|
1653
|
+
* @param props Initialization props
|
|
1654
|
+
*/
|
|
1655
|
+
public constructor(scope: Construct, id: string, props: ProviderV1Beta3Props = {}) {
|
|
1656
|
+
super(scope, id, {
|
|
1657
|
+
...ProviderV1Beta3.GVK,
|
|
1658
|
+
...props
|
|
1659
|
+
})
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/** Renders the object to Kubernetes JSON. */
|
|
1663
|
+
public toJson(): any {
|
|
1664
|
+
const resolved = super.toJson()
|
|
1665
|
+
|
|
1666
|
+
return {
|
|
1667
|
+
...ProviderV1Beta3.GVK,
|
|
1668
|
+
...toJson_ProviderV1Beta3Props(resolved)
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* Provider is the Schema for the providers API
|
|
1675
|
+
*
|
|
1676
|
+
* @schema ProviderV1Beta3
|
|
1677
|
+
*/
|
|
1678
|
+
export interface ProviderV1Beta3Props {
|
|
1679
|
+
/** @schema ProviderV1Beta3#metadata */
|
|
1680
|
+
metadata?: ApiObjectMetadata
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* ProviderSpec defines the desired state of the Provider.
|
|
1684
|
+
*
|
|
1685
|
+
* @schema ProviderV1Beta3#spec
|
|
1686
|
+
*/
|
|
1687
|
+
spec?: ProviderV1Beta3Spec
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/** Converts an object of type 'ProviderV1Beta3Props' to JSON representation. */
|
|
1691
|
+
/* eslint-disable max-len, quote-props */
|
|
1692
|
+
export function toJson_ProviderV1Beta3Props(
|
|
1693
|
+
obj: ProviderV1Beta3Props | undefined
|
|
1694
|
+
): Record<string, any> | undefined {
|
|
1695
|
+
if (obj === undefined) {
|
|
1696
|
+
return undefined
|
|
1697
|
+
}
|
|
1698
|
+
const result = {
|
|
1699
|
+
metadata: obj.metadata,
|
|
1700
|
+
spec: toJson_ProviderV1Beta3Spec(obj.spec)
|
|
1701
|
+
}
|
|
1702
|
+
// filter undefined values
|
|
1703
|
+
return Object.entries(result).reduce(
|
|
1704
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1705
|
+
{}
|
|
1706
|
+
)
|
|
1707
|
+
}
|
|
1708
|
+
/* eslint-enable max-len, quote-props */
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* ProviderSpec defines the desired state of the Provider.
|
|
1712
|
+
*
|
|
1713
|
+
* @schema ProviderV1Beta3Spec
|
|
1714
|
+
*/
|
|
1715
|
+
export interface ProviderV1Beta3Spec {
|
|
1716
|
+
/**
|
|
1717
|
+
* Address specifies the endpoint, in a generic sense, to where alerts are sent. What kind of
|
|
1718
|
+
* endpoint depends on the specific Provider type being used. For the generic Provider, for
|
|
1719
|
+
* example, this is an HTTP/S address. For other Provider types this could be a project ID or a
|
|
1720
|
+
* namespace.
|
|
1721
|
+
*
|
|
1722
|
+
* @schema ProviderV1Beta3Spec#address
|
|
1723
|
+
*/
|
|
1724
|
+
address?: string
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* CertSecretRef specifies the Secret containing a PEM-encoded CA certificate (in the `ca.crt`
|
|
1728
|
+
* key).
|
|
1729
|
+
*
|
|
1730
|
+
* Note: Support for the `caFile` key has been deprecated.
|
|
1731
|
+
*
|
|
1732
|
+
* @schema ProviderV1Beta3Spec#certSecretRef
|
|
1733
|
+
*/
|
|
1734
|
+
certSecretRef?: ProviderV1Beta3SpecCertSecretRef
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* Channel specifies the destination channel where events should be posted.
|
|
1738
|
+
*
|
|
1739
|
+
* @schema ProviderV1Beta3Spec#channel
|
|
1740
|
+
*/
|
|
1741
|
+
channel?: string
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Interval at which to reconcile the Provider with its Secret references. Deprecated and not
|
|
1745
|
+
* used in v1beta3.
|
|
1746
|
+
*
|
|
1747
|
+
* @schema ProviderV1Beta3Spec#interval
|
|
1748
|
+
*/
|
|
1749
|
+
interval?: string
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Proxy the HTTP/S address of the proxy server.
|
|
1753
|
+
*
|
|
1754
|
+
* @schema ProviderV1Beta3Spec#proxy
|
|
1755
|
+
*/
|
|
1756
|
+
proxy?: string
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* SecretRef specifies the Secret containing the authentication credentials for this Provider.
|
|
1760
|
+
*
|
|
1761
|
+
* @schema ProviderV1Beta3Spec#secretRef
|
|
1762
|
+
*/
|
|
1763
|
+
secretRef?: ProviderV1Beta3SpecSecretRef
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* Suspend tells the controller to suspend subsequent events handling for this Provider.
|
|
1767
|
+
*
|
|
1768
|
+
* @schema ProviderV1Beta3Spec#suspend
|
|
1769
|
+
*/
|
|
1770
|
+
suspend?: boolean
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* Timeout for sending alerts to the Provider.
|
|
1774
|
+
*
|
|
1775
|
+
* @schema ProviderV1Beta3Spec#timeout
|
|
1776
|
+
*/
|
|
1777
|
+
timeout?: string
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Type specifies which Provider implementation to use.
|
|
1781
|
+
*
|
|
1782
|
+
* @schema ProviderV1Beta3Spec#type
|
|
1783
|
+
*/
|
|
1784
|
+
type: ProviderV1Beta3SpecType
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* Username specifies the name under which events are posted.
|
|
1788
|
+
*
|
|
1789
|
+
* @schema ProviderV1Beta3Spec#username
|
|
1790
|
+
*/
|
|
1791
|
+
username?: string
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
/** Converts an object of type 'ProviderV1Beta3Spec' to JSON representation. */
|
|
1795
|
+
/* eslint-disable max-len, quote-props */
|
|
1796
|
+
export function toJson_ProviderV1Beta3Spec(
|
|
1797
|
+
obj: ProviderV1Beta3Spec | undefined
|
|
1798
|
+
): Record<string, any> | undefined {
|
|
1799
|
+
if (obj === undefined) {
|
|
1800
|
+
return undefined
|
|
1801
|
+
}
|
|
1802
|
+
const result = {
|
|
1803
|
+
address: obj.address,
|
|
1804
|
+
certSecretRef: toJson_ProviderV1Beta3SpecCertSecretRef(obj.certSecretRef),
|
|
1805
|
+
channel: obj.channel,
|
|
1806
|
+
interval: obj.interval,
|
|
1807
|
+
proxy: obj.proxy,
|
|
1808
|
+
secretRef: toJson_ProviderV1Beta3SpecSecretRef(obj.secretRef),
|
|
1809
|
+
suspend: obj.suspend,
|
|
1810
|
+
timeout: obj.timeout,
|
|
1811
|
+
type: obj.type,
|
|
1812
|
+
username: obj.username
|
|
1813
|
+
}
|
|
1814
|
+
// filter undefined values
|
|
1815
|
+
return Object.entries(result).reduce(
|
|
1816
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1817
|
+
{}
|
|
1818
|
+
)
|
|
1819
|
+
}
|
|
1820
|
+
/* eslint-enable max-len, quote-props */
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* CertSecretRef specifies the Secret containing a PEM-encoded CA certificate (in the `ca.crt` key).
|
|
1824
|
+
*
|
|
1825
|
+
* Note: Support for the `caFile` key has been deprecated.
|
|
1826
|
+
*
|
|
1827
|
+
* @schema ProviderV1Beta3SpecCertSecretRef
|
|
1828
|
+
*/
|
|
1829
|
+
export interface ProviderV1Beta3SpecCertSecretRef {
|
|
1830
|
+
/**
|
|
1831
|
+
* Name of the referent.
|
|
1832
|
+
*
|
|
1833
|
+
* @schema ProviderV1Beta3SpecCertSecretRef#name
|
|
1834
|
+
*/
|
|
1835
|
+
name: string
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
/** Converts an object of type 'ProviderV1Beta3SpecCertSecretRef' to JSON representation. */
|
|
1839
|
+
/* eslint-disable max-len, quote-props */
|
|
1840
|
+
export function toJson_ProviderV1Beta3SpecCertSecretRef(
|
|
1841
|
+
obj: ProviderV1Beta3SpecCertSecretRef | undefined
|
|
1842
|
+
): Record<string, any> | undefined {
|
|
1843
|
+
if (obj === undefined) {
|
|
1844
|
+
return undefined
|
|
1845
|
+
}
|
|
1846
|
+
const result = {
|
|
1847
|
+
name: obj.name
|
|
1848
|
+
}
|
|
1849
|
+
// filter undefined values
|
|
1850
|
+
return Object.entries(result).reduce(
|
|
1851
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1852
|
+
{}
|
|
1853
|
+
)
|
|
1854
|
+
}
|
|
1855
|
+
/* eslint-enable max-len, quote-props */
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* SecretRef specifies the Secret containing the authentication credentials for this Provider.
|
|
1859
|
+
*
|
|
1860
|
+
* @schema ProviderV1Beta3SpecSecretRef
|
|
1861
|
+
*/
|
|
1862
|
+
export interface ProviderV1Beta3SpecSecretRef {
|
|
1863
|
+
/**
|
|
1864
|
+
* Name of the referent.
|
|
1865
|
+
*
|
|
1866
|
+
* @schema ProviderV1Beta3SpecSecretRef#name
|
|
1867
|
+
*/
|
|
1868
|
+
name: string
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/** Converts an object of type 'ProviderV1Beta3SpecSecretRef' to JSON representation. */
|
|
1872
|
+
/* eslint-disable max-len, quote-props */
|
|
1873
|
+
export function toJson_ProviderV1Beta3SpecSecretRef(
|
|
1874
|
+
obj: ProviderV1Beta3SpecSecretRef | undefined
|
|
1875
|
+
): Record<string, any> | undefined {
|
|
1876
|
+
if (obj === undefined) {
|
|
1877
|
+
return undefined
|
|
1878
|
+
}
|
|
1879
|
+
const result = {
|
|
1880
|
+
name: obj.name
|
|
1881
|
+
}
|
|
1882
|
+
// filter undefined values
|
|
1883
|
+
return Object.entries(result).reduce(
|
|
1884
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
1885
|
+
{}
|
|
1886
|
+
)
|
|
1887
|
+
}
|
|
1888
|
+
/* eslint-enable max-len, quote-props */
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* Type specifies which Provider implementation to use.
|
|
1892
|
+
*
|
|
1893
|
+
* @schema ProviderV1Beta3SpecType
|
|
1894
|
+
*/
|
|
1895
|
+
export enum ProviderV1Beta3SpecType {
|
|
1896
|
+
/** Slack */
|
|
1897
|
+
SLACK = "slack",
|
|
1898
|
+
/** Discord */
|
|
1899
|
+
DISCORD = "discord",
|
|
1900
|
+
/** Msteams */
|
|
1901
|
+
MSTEAMS = "msteams",
|
|
1902
|
+
/** Rocket */
|
|
1903
|
+
ROCKET = "rocket",
|
|
1904
|
+
/** Generic */
|
|
1905
|
+
GENERIC = "generic",
|
|
1906
|
+
/** Generic-hmac */
|
|
1907
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
1908
|
+
/** Github */
|
|
1909
|
+
GITHUB = "github",
|
|
1910
|
+
/** Gitlab */
|
|
1911
|
+
GITLAB = "gitlab",
|
|
1912
|
+
/** Gitea */
|
|
1913
|
+
GITEA = "gitea",
|
|
1914
|
+
/** Bitbucketserver */
|
|
1915
|
+
BITBUCKETSERVER = "bitbucketserver",
|
|
1916
|
+
/** Bitbucket */
|
|
1917
|
+
BITBUCKET = "bitbucket",
|
|
1918
|
+
/** Azuredevops */
|
|
1919
|
+
AZUREDEVOPS = "azuredevops",
|
|
1920
|
+
/** Googlechat */
|
|
1921
|
+
GOOGLECHAT = "googlechat",
|
|
1922
|
+
/** Googlepubsub */
|
|
1923
|
+
GOOGLEPUBSUB = "googlepubsub",
|
|
1924
|
+
/** Webex */
|
|
1925
|
+
WEBEX = "webex",
|
|
1926
|
+
/** Sentry */
|
|
1927
|
+
SENTRY = "sentry",
|
|
1928
|
+
/** Azureeventhub */
|
|
1929
|
+
AZUREEVENTHUB = "azureeventhub",
|
|
1930
|
+
/** Telegram */
|
|
1931
|
+
TELEGRAM = "telegram",
|
|
1932
|
+
/** Lark */
|
|
1933
|
+
LARK = "lark",
|
|
1934
|
+
/** Matrix */
|
|
1935
|
+
MATRIX = "matrix",
|
|
1936
|
+
/** Opsgenie */
|
|
1937
|
+
OPSGENIE = "opsgenie",
|
|
1938
|
+
/** Alertmanager */
|
|
1939
|
+
ALERTMANAGER = "alertmanager",
|
|
1940
|
+
/** Grafana */
|
|
1941
|
+
GRAFANA = "grafana",
|
|
1942
|
+
/** Githubdispatch */
|
|
1943
|
+
GITHUBDISPATCH = "githubdispatch",
|
|
1944
|
+
/** Pagerduty */
|
|
1945
|
+
PAGERDUTY = "pagerduty",
|
|
1946
|
+
/** Datadog */
|
|
1947
|
+
DATADOG = "datadog",
|
|
1948
|
+
/** Nats */
|
|
1949
|
+
NATS = "nats"
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* Receiver is the Schema for the receivers API.
|
|
1954
|
+
*
|
|
1955
|
+
* @schema Receiver
|
|
1956
|
+
*/
|
|
1957
|
+
export class Receiver extends ApiObject {
|
|
1958
|
+
/** Returns the apiVersion and kind for "Receiver" */
|
|
1959
|
+
public static GVK: GroupVersionKind = {
|
|
1960
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1",
|
|
1961
|
+
kind: "Receiver"
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Renders a Kubernetes manifest for "Receiver".
|
|
1966
|
+
*
|
|
1967
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
1968
|
+
*
|
|
1969
|
+
* @param props Initialization props
|
|
1970
|
+
*/
|
|
1971
|
+
public static manifest(props: ReceiverProps = {}): any {
|
|
1972
|
+
return {
|
|
1973
|
+
...Receiver.GVK,
|
|
1974
|
+
...toJson_ReceiverProps(props)
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* Defines a "Receiver" API object
|
|
1980
|
+
*
|
|
1981
|
+
* @param scope The scope in which to define this object
|
|
1982
|
+
* @param id A scope-local name for the object
|
|
1983
|
+
* @param props Initialization props
|
|
1984
|
+
*/
|
|
1985
|
+
public constructor(scope: Construct, id: string, props: ReceiverProps = {}) {
|
|
1986
|
+
super(scope, id, {
|
|
1987
|
+
...Receiver.GVK,
|
|
1988
|
+
...props
|
|
1989
|
+
})
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
/** Renders the object to Kubernetes JSON. */
|
|
1993
|
+
public toJson(): any {
|
|
1994
|
+
const resolved = super.toJson()
|
|
1995
|
+
|
|
1996
|
+
return {
|
|
1997
|
+
...Receiver.GVK,
|
|
1998
|
+
...toJson_ReceiverProps(resolved)
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* Receiver is the Schema for the receivers API.
|
|
2005
|
+
*
|
|
2006
|
+
* @schema Receiver
|
|
2007
|
+
*/
|
|
2008
|
+
export interface ReceiverProps {
|
|
2009
|
+
/** @schema Receiver#metadata */
|
|
2010
|
+
metadata?: ApiObjectMetadata
|
|
2011
|
+
|
|
2012
|
+
/**
|
|
2013
|
+
* ReceiverSpec defines the desired state of the Receiver.
|
|
2014
|
+
*
|
|
2015
|
+
* @schema Receiver#spec
|
|
2016
|
+
*/
|
|
2017
|
+
spec?: ReceiverSpec
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
/** Converts an object of type 'ReceiverProps' to JSON representation. */
|
|
2021
|
+
/* eslint-disable max-len, quote-props */
|
|
2022
|
+
export function toJson_ReceiverProps(
|
|
2023
|
+
obj: ReceiverProps | undefined
|
|
2024
|
+
): Record<string, any> | undefined {
|
|
2025
|
+
if (obj === undefined) {
|
|
2026
|
+
return undefined
|
|
2027
|
+
}
|
|
2028
|
+
const result = {
|
|
2029
|
+
metadata: obj.metadata,
|
|
2030
|
+
spec: toJson_ReceiverSpec(obj.spec)
|
|
2031
|
+
}
|
|
2032
|
+
// filter undefined values
|
|
2033
|
+
return Object.entries(result).reduce(
|
|
2034
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2035
|
+
{}
|
|
2036
|
+
)
|
|
2037
|
+
}
|
|
2038
|
+
/* eslint-enable max-len, quote-props */
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* ReceiverSpec defines the desired state of the Receiver.
|
|
2042
|
+
*
|
|
2043
|
+
* @schema ReceiverSpec
|
|
2044
|
+
*/
|
|
2045
|
+
export interface ReceiverSpec {
|
|
2046
|
+
/**
|
|
2047
|
+
* Events specifies the list of event types to handle, e.g. 'push' for GitHub or 'Push Hook' for
|
|
2048
|
+
* GitLab.
|
|
2049
|
+
*
|
|
2050
|
+
* @schema ReceiverSpec#events
|
|
2051
|
+
*/
|
|
2052
|
+
events?: string[]
|
|
2053
|
+
|
|
2054
|
+
/**
|
|
2055
|
+
* Interval at which to reconcile the Receiver with its Secret references.
|
|
2056
|
+
*
|
|
2057
|
+
* @schema ReceiverSpec#interval
|
|
2058
|
+
*/
|
|
2059
|
+
interval?: string
|
|
2060
|
+
|
|
2061
|
+
/**
|
|
2062
|
+
* ResourceFilter is a CEL expression expected to return a boolean that is evaluated for each
|
|
2063
|
+
* resource referenced in the Resources field when a webhook is received. If the expression
|
|
2064
|
+
* returns false then the controller will not request a reconciliation for the resource. When
|
|
2065
|
+
* the expression is specified the controller will parse it and mark the object as terminally
|
|
2066
|
+
* failed if the expression is invalid or does not return a boolean.
|
|
2067
|
+
*
|
|
2068
|
+
* @schema ReceiverSpec#resourceFilter
|
|
2069
|
+
*/
|
|
2070
|
+
resourceFilter?: string
|
|
2071
|
+
|
|
2072
|
+
/**
|
|
2073
|
+
* A list of resources to be notified about changes.
|
|
2074
|
+
*
|
|
2075
|
+
* @schema ReceiverSpec#resources
|
|
2076
|
+
*/
|
|
2077
|
+
resources: ReceiverSpecResources[]
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* SecretRef specifies the Secret containing the token used to validate the payload
|
|
2081
|
+
* authenticity.
|
|
2082
|
+
*
|
|
2083
|
+
* @schema ReceiverSpec#secretRef
|
|
2084
|
+
*/
|
|
2085
|
+
secretRef: ReceiverSpecSecretRef
|
|
2086
|
+
|
|
2087
|
+
/**
|
|
2088
|
+
* Suspend tells the controller to suspend subsequent events handling for this receiver.
|
|
2089
|
+
*
|
|
2090
|
+
* @schema ReceiverSpec#suspend
|
|
2091
|
+
*/
|
|
2092
|
+
suspend?: boolean
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* Type of webhook sender, used to determine the validation procedure and payload
|
|
2096
|
+
* deserialization.
|
|
2097
|
+
*
|
|
2098
|
+
* @schema ReceiverSpec#type
|
|
2099
|
+
*/
|
|
2100
|
+
type: ReceiverSpecType
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
/** Converts an object of type 'ReceiverSpec' to JSON representation. */
|
|
2104
|
+
/* eslint-disable max-len, quote-props */
|
|
2105
|
+
export function toJson_ReceiverSpec(
|
|
2106
|
+
obj: ReceiverSpec | undefined
|
|
2107
|
+
): Record<string, any> | undefined {
|
|
2108
|
+
if (obj === undefined) {
|
|
2109
|
+
return undefined
|
|
2110
|
+
}
|
|
2111
|
+
const result = {
|
|
2112
|
+
events: obj.events?.map(y => y),
|
|
2113
|
+
interval: obj.interval,
|
|
2114
|
+
resourceFilter: obj.resourceFilter,
|
|
2115
|
+
resources: obj.resources?.map(y => toJson_ReceiverSpecResources(y)),
|
|
2116
|
+
secretRef: toJson_ReceiverSpecSecretRef(obj.secretRef),
|
|
2117
|
+
suspend: obj.suspend,
|
|
2118
|
+
type: obj.type
|
|
2119
|
+
}
|
|
2120
|
+
// filter undefined values
|
|
2121
|
+
return Object.entries(result).reduce(
|
|
2122
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2123
|
+
{}
|
|
2124
|
+
)
|
|
2125
|
+
}
|
|
2126
|
+
/* eslint-enable max-len, quote-props */
|
|
2127
|
+
|
|
2128
|
+
/**
|
|
2129
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
2130
|
+
* object at cluster level
|
|
2131
|
+
*
|
|
2132
|
+
* @schema ReceiverSpecResources
|
|
2133
|
+
*/
|
|
2134
|
+
export interface ReceiverSpecResources {
|
|
2135
|
+
/**
|
|
2136
|
+
* API version of the referent
|
|
2137
|
+
*
|
|
2138
|
+
* @schema ReceiverSpecResources#apiVersion
|
|
2139
|
+
*/
|
|
2140
|
+
apiVersion?: string
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* Kind of the referent
|
|
2144
|
+
*
|
|
2145
|
+
* @schema ReceiverSpecResources#kind
|
|
2146
|
+
*/
|
|
2147
|
+
kind: ReceiverSpecResourcesKind
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
2151
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
2152
|
+
* and the values array contains only "value". The requirements are ANDed. MatchLabels requires
|
|
2153
|
+
* the name to be set to `*`.
|
|
2154
|
+
*
|
|
2155
|
+
* @schema ReceiverSpecResources#matchLabels
|
|
2156
|
+
*/
|
|
2157
|
+
matchLabels?: { [key: string]: string }
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* Name of the referent If multiple resources are targeted `*` may be set.
|
|
2161
|
+
*
|
|
2162
|
+
* @schema ReceiverSpecResources#name
|
|
2163
|
+
*/
|
|
2164
|
+
name: string
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* Namespace of the referent
|
|
2168
|
+
*
|
|
2169
|
+
* @schema ReceiverSpecResources#namespace
|
|
2170
|
+
*/
|
|
2171
|
+
namespace?: string
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
/** Converts an object of type 'ReceiverSpecResources' to JSON representation. */
|
|
2175
|
+
/* eslint-disable max-len, quote-props */
|
|
2176
|
+
export function toJson_ReceiverSpecResources(
|
|
2177
|
+
obj: ReceiverSpecResources | undefined
|
|
2178
|
+
): Record<string, any> | undefined {
|
|
2179
|
+
if (obj === undefined) {
|
|
2180
|
+
return undefined
|
|
2181
|
+
}
|
|
2182
|
+
const result = {
|
|
2183
|
+
apiVersion: obj.apiVersion,
|
|
2184
|
+
kind: obj.kind,
|
|
2185
|
+
matchLabels:
|
|
2186
|
+
obj.matchLabels === undefined
|
|
2187
|
+
? undefined
|
|
2188
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
2189
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2190
|
+
{}
|
|
2191
|
+
),
|
|
2192
|
+
name: obj.name,
|
|
2193
|
+
namespace: obj.namespace
|
|
2194
|
+
}
|
|
2195
|
+
// filter undefined values
|
|
2196
|
+
return Object.entries(result).reduce(
|
|
2197
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2198
|
+
{}
|
|
2199
|
+
)
|
|
2200
|
+
}
|
|
2201
|
+
/* eslint-enable max-len, quote-props */
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* SecretRef specifies the Secret containing the token used to validate the payload authenticity.
|
|
2205
|
+
*
|
|
2206
|
+
* @schema ReceiverSpecSecretRef
|
|
2207
|
+
*/
|
|
2208
|
+
export interface ReceiverSpecSecretRef {
|
|
2209
|
+
/**
|
|
2210
|
+
* Name of the referent.
|
|
2211
|
+
*
|
|
2212
|
+
* @schema ReceiverSpecSecretRef#name
|
|
2213
|
+
*/
|
|
2214
|
+
name: string
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
/** Converts an object of type 'ReceiverSpecSecretRef' to JSON representation. */
|
|
2218
|
+
/* eslint-disable max-len, quote-props */
|
|
2219
|
+
export function toJson_ReceiverSpecSecretRef(
|
|
2220
|
+
obj: ReceiverSpecSecretRef | undefined
|
|
2221
|
+
): Record<string, any> | undefined {
|
|
2222
|
+
if (obj === undefined) {
|
|
2223
|
+
return undefined
|
|
2224
|
+
}
|
|
2225
|
+
const result = {
|
|
2226
|
+
name: obj.name
|
|
2227
|
+
}
|
|
2228
|
+
// filter undefined values
|
|
2229
|
+
return Object.entries(result).reduce(
|
|
2230
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2231
|
+
{}
|
|
2232
|
+
)
|
|
2233
|
+
}
|
|
2234
|
+
/* eslint-enable max-len, quote-props */
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Type of webhook sender, used to determine the validation procedure and payload deserialization.
|
|
2238
|
+
*
|
|
2239
|
+
* @schema ReceiverSpecType
|
|
2240
|
+
*/
|
|
2241
|
+
export enum ReceiverSpecType {
|
|
2242
|
+
/** Generic */
|
|
2243
|
+
GENERIC = "generic",
|
|
2244
|
+
/** Generic-hmac */
|
|
2245
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
2246
|
+
/** Github */
|
|
2247
|
+
GITHUB = "github",
|
|
2248
|
+
/** Gitlab */
|
|
2249
|
+
GITLAB = "gitlab",
|
|
2250
|
+
/** Bitbucket */
|
|
2251
|
+
BITBUCKET = "bitbucket",
|
|
2252
|
+
/** Harbor */
|
|
2253
|
+
HARBOR = "harbor",
|
|
2254
|
+
/** Dockerhub */
|
|
2255
|
+
DOCKERHUB = "dockerhub",
|
|
2256
|
+
/** Quay */
|
|
2257
|
+
QUAY = "quay",
|
|
2258
|
+
/** Gcr */
|
|
2259
|
+
GCR = "gcr",
|
|
2260
|
+
/** Nexus */
|
|
2261
|
+
NEXUS = "nexus",
|
|
2262
|
+
/** Acr */
|
|
2263
|
+
ACR = "acr",
|
|
2264
|
+
/** Cdevents */
|
|
2265
|
+
CDEVENTS = "cdevents"
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
/**
|
|
2269
|
+
* Kind of the referent
|
|
2270
|
+
*
|
|
2271
|
+
* @schema ReceiverSpecResourcesKind
|
|
2272
|
+
*/
|
|
2273
|
+
export enum ReceiverSpecResourcesKind {
|
|
2274
|
+
/** Bucket */
|
|
2275
|
+
BUCKET = "Bucket",
|
|
2276
|
+
/** GitRepository */
|
|
2277
|
+
GIT_REPOSITORY = "GitRepository",
|
|
2278
|
+
/** Kustomization */
|
|
2279
|
+
KUSTOMIZATION = "Kustomization",
|
|
2280
|
+
/** HelmRelease */
|
|
2281
|
+
HELM_RELEASE = "HelmRelease",
|
|
2282
|
+
/** HelmChart */
|
|
2283
|
+
HELM_CHART = "HelmChart",
|
|
2284
|
+
/** HelmRepository */
|
|
2285
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
2286
|
+
/** ImageRepository */
|
|
2287
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
2288
|
+
/** ImagePolicy */
|
|
2289
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
2290
|
+
/** ImageUpdateAutomation */
|
|
2291
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
2292
|
+
/** OCIRepository */
|
|
2293
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
/**
|
|
2297
|
+
* Receiver is the Schema for the receivers API
|
|
2298
|
+
*
|
|
2299
|
+
* @schema ReceiverV1Beta1
|
|
2300
|
+
*/
|
|
2301
|
+
export class ReceiverV1Beta1 extends ApiObject {
|
|
2302
|
+
/** Returns the apiVersion and kind for "ReceiverV1Beta1" */
|
|
2303
|
+
public static GVK: GroupVersionKind = {
|
|
2304
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta1",
|
|
2305
|
+
kind: "Receiver"
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* Renders a Kubernetes manifest for "ReceiverV1Beta1".
|
|
2310
|
+
*
|
|
2311
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
2312
|
+
*
|
|
2313
|
+
* @param props Initialization props
|
|
2314
|
+
*/
|
|
2315
|
+
public static manifest(props: ReceiverV1Beta1Props = {}): any {
|
|
2316
|
+
return {
|
|
2317
|
+
...ReceiverV1Beta1.GVK,
|
|
2318
|
+
...toJson_ReceiverV1Beta1Props(props)
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
/**
|
|
2323
|
+
* Defines a "ReceiverV1Beta1" API object
|
|
2324
|
+
*
|
|
2325
|
+
* @param scope The scope in which to define this object
|
|
2326
|
+
* @param id A scope-local name for the object
|
|
2327
|
+
* @param props Initialization props
|
|
2328
|
+
*/
|
|
2329
|
+
public constructor(scope: Construct, id: string, props: ReceiverV1Beta1Props = {}) {
|
|
2330
|
+
super(scope, id, {
|
|
2331
|
+
...ReceiverV1Beta1.GVK,
|
|
2332
|
+
...props
|
|
2333
|
+
})
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
/** Renders the object to Kubernetes JSON. */
|
|
2337
|
+
public toJson(): any {
|
|
2338
|
+
const resolved = super.toJson()
|
|
2339
|
+
|
|
2340
|
+
return {
|
|
2341
|
+
...ReceiverV1Beta1.GVK,
|
|
2342
|
+
...toJson_ReceiverV1Beta1Props(resolved)
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
/**
|
|
2348
|
+
* Receiver is the Schema for the receivers API
|
|
2349
|
+
*
|
|
2350
|
+
* @schema ReceiverV1Beta1
|
|
2351
|
+
*/
|
|
2352
|
+
export interface ReceiverV1Beta1Props {
|
|
2353
|
+
/** @schema ReceiverV1Beta1#metadata */
|
|
2354
|
+
metadata?: ApiObjectMetadata
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* ReceiverSpec defines the desired state of Receiver
|
|
2358
|
+
*
|
|
2359
|
+
* @schema ReceiverV1Beta1#spec
|
|
2360
|
+
*/
|
|
2361
|
+
spec?: ReceiverV1Beta1Spec
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
/** Converts an object of type 'ReceiverV1Beta1Props' to JSON representation. */
|
|
2365
|
+
/* eslint-disable max-len, quote-props */
|
|
2366
|
+
export function toJson_ReceiverV1Beta1Props(
|
|
2367
|
+
obj: ReceiverV1Beta1Props | undefined
|
|
2368
|
+
): Record<string, any> | undefined {
|
|
2369
|
+
if (obj === undefined) {
|
|
2370
|
+
return undefined
|
|
2371
|
+
}
|
|
2372
|
+
const result = {
|
|
2373
|
+
metadata: obj.metadata,
|
|
2374
|
+
spec: toJson_ReceiverV1Beta1Spec(obj.spec)
|
|
2375
|
+
}
|
|
2376
|
+
// filter undefined values
|
|
2377
|
+
return Object.entries(result).reduce(
|
|
2378
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2379
|
+
{}
|
|
2380
|
+
)
|
|
2381
|
+
}
|
|
2382
|
+
/* eslint-enable max-len, quote-props */
|
|
2383
|
+
|
|
2384
|
+
/**
|
|
2385
|
+
* ReceiverSpec defines the desired state of Receiver
|
|
2386
|
+
*
|
|
2387
|
+
* @schema ReceiverV1Beta1Spec
|
|
2388
|
+
*/
|
|
2389
|
+
export interface ReceiverV1Beta1Spec {
|
|
2390
|
+
/**
|
|
2391
|
+
* A list of events to handle, e.g. 'push' for GitHub or 'Push Hook' for GitLab.
|
|
2392
|
+
*
|
|
2393
|
+
* @schema ReceiverV1Beta1Spec#events
|
|
2394
|
+
*/
|
|
2395
|
+
events?: string[]
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* A list of resources to be notified about changes.
|
|
2399
|
+
*
|
|
2400
|
+
* @schema ReceiverV1Beta1Spec#resources
|
|
2401
|
+
*/
|
|
2402
|
+
resources: ReceiverV1Beta1SpecResources[]
|
|
2403
|
+
|
|
2404
|
+
/**
|
|
2405
|
+
* Secret reference containing the token used to validate the payload authenticity
|
|
2406
|
+
*
|
|
2407
|
+
* @schema ReceiverV1Beta1Spec#secretRef
|
|
2408
|
+
*/
|
|
2409
|
+
secretRef: ReceiverV1Beta1SpecSecretRef
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* This flag tells the controller to suspend subsequent events handling. Defaults to false.
|
|
2413
|
+
*
|
|
2414
|
+
* @default false.
|
|
2415
|
+
* @schema ReceiverV1Beta1Spec#suspend
|
|
2416
|
+
*/
|
|
2417
|
+
suspend?: boolean
|
|
2418
|
+
|
|
2419
|
+
/**
|
|
2420
|
+
* Type of webhook sender, used to determine the validation procedure and payload
|
|
2421
|
+
* deserialization.
|
|
2422
|
+
*
|
|
2423
|
+
* @schema ReceiverV1Beta1Spec#type
|
|
2424
|
+
*/
|
|
2425
|
+
type: ReceiverV1Beta1SpecType
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
/** Converts an object of type 'ReceiverV1Beta1Spec' to JSON representation. */
|
|
2429
|
+
/* eslint-disable max-len, quote-props */
|
|
2430
|
+
export function toJson_ReceiverV1Beta1Spec(
|
|
2431
|
+
obj: ReceiverV1Beta1Spec | undefined
|
|
2432
|
+
): Record<string, any> | undefined {
|
|
2433
|
+
if (obj === undefined) {
|
|
2434
|
+
return undefined
|
|
2435
|
+
}
|
|
2436
|
+
const result = {
|
|
2437
|
+
events: obj.events?.map(y => y),
|
|
2438
|
+
resources: obj.resources?.map(y => toJson_ReceiverV1Beta1SpecResources(y)),
|
|
2439
|
+
secretRef: toJson_ReceiverV1Beta1SpecSecretRef(obj.secretRef),
|
|
2440
|
+
suspend: obj.suspend,
|
|
2441
|
+
type: obj.type
|
|
2442
|
+
}
|
|
2443
|
+
// filter undefined values
|
|
2444
|
+
return Object.entries(result).reduce(
|
|
2445
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2446
|
+
{}
|
|
2447
|
+
)
|
|
2448
|
+
}
|
|
2449
|
+
/* eslint-enable max-len, quote-props */
|
|
2450
|
+
|
|
2451
|
+
/**
|
|
2452
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
2453
|
+
* object at cluster level
|
|
2454
|
+
*
|
|
2455
|
+
* @schema ReceiverV1Beta1SpecResources
|
|
2456
|
+
*/
|
|
2457
|
+
export interface ReceiverV1Beta1SpecResources {
|
|
2458
|
+
/**
|
|
2459
|
+
* API version of the referent
|
|
2460
|
+
*
|
|
2461
|
+
* @schema ReceiverV1Beta1SpecResources#apiVersion
|
|
2462
|
+
*/
|
|
2463
|
+
apiVersion?: string
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Kind of the referent
|
|
2467
|
+
*
|
|
2468
|
+
* @schema ReceiverV1Beta1SpecResources#kind
|
|
2469
|
+
*/
|
|
2470
|
+
kind: ReceiverV1Beta1SpecResourcesKind
|
|
2471
|
+
|
|
2472
|
+
/**
|
|
2473
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
2474
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
2475
|
+
* and the values array contains only "value". The requirements are ANDed.
|
|
2476
|
+
*
|
|
2477
|
+
* @schema ReceiverV1Beta1SpecResources#matchLabels
|
|
2478
|
+
*/
|
|
2479
|
+
matchLabels?: { [key: string]: string }
|
|
2480
|
+
|
|
2481
|
+
/**
|
|
2482
|
+
* Name of the referent
|
|
2483
|
+
*
|
|
2484
|
+
* @schema ReceiverV1Beta1SpecResources#name
|
|
2485
|
+
*/
|
|
2486
|
+
name: string
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Namespace of the referent
|
|
2490
|
+
*
|
|
2491
|
+
* @schema ReceiverV1Beta1SpecResources#namespace
|
|
2492
|
+
*/
|
|
2493
|
+
namespace?: string
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
/** Converts an object of type 'ReceiverV1Beta1SpecResources' to JSON representation. */
|
|
2497
|
+
/* eslint-disable max-len, quote-props */
|
|
2498
|
+
export function toJson_ReceiverV1Beta1SpecResources(
|
|
2499
|
+
obj: ReceiverV1Beta1SpecResources | undefined
|
|
2500
|
+
): Record<string, any> | undefined {
|
|
2501
|
+
if (obj === undefined) {
|
|
2502
|
+
return undefined
|
|
2503
|
+
}
|
|
2504
|
+
const result = {
|
|
2505
|
+
apiVersion: obj.apiVersion,
|
|
2506
|
+
kind: obj.kind,
|
|
2507
|
+
matchLabels:
|
|
2508
|
+
obj.matchLabels === undefined
|
|
2509
|
+
? undefined
|
|
2510
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
2511
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2512
|
+
{}
|
|
2513
|
+
),
|
|
2514
|
+
name: obj.name,
|
|
2515
|
+
namespace: obj.namespace
|
|
2516
|
+
}
|
|
2517
|
+
// filter undefined values
|
|
2518
|
+
return Object.entries(result).reduce(
|
|
2519
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2520
|
+
{}
|
|
2521
|
+
)
|
|
2522
|
+
}
|
|
2523
|
+
/* eslint-enable max-len, quote-props */
|
|
2524
|
+
|
|
2525
|
+
/**
|
|
2526
|
+
* Secret reference containing the token used to validate the payload authenticity
|
|
2527
|
+
*
|
|
2528
|
+
* @schema ReceiverV1Beta1SpecSecretRef
|
|
2529
|
+
*/
|
|
2530
|
+
export interface ReceiverV1Beta1SpecSecretRef {
|
|
2531
|
+
/**
|
|
2532
|
+
* Name of the referent.
|
|
2533
|
+
*
|
|
2534
|
+
* @schema ReceiverV1Beta1SpecSecretRef#name
|
|
2535
|
+
*/
|
|
2536
|
+
name: string
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
/** Converts an object of type 'ReceiverV1Beta1SpecSecretRef' to JSON representation. */
|
|
2540
|
+
/* eslint-disable max-len, quote-props */
|
|
2541
|
+
export function toJson_ReceiverV1Beta1SpecSecretRef(
|
|
2542
|
+
obj: ReceiverV1Beta1SpecSecretRef | undefined
|
|
2543
|
+
): Record<string, any> | undefined {
|
|
2544
|
+
if (obj === undefined) {
|
|
2545
|
+
return undefined
|
|
2546
|
+
}
|
|
2547
|
+
const result = {
|
|
2548
|
+
name: obj.name
|
|
2549
|
+
}
|
|
2550
|
+
// filter undefined values
|
|
2551
|
+
return Object.entries(result).reduce(
|
|
2552
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2553
|
+
{}
|
|
2554
|
+
)
|
|
2555
|
+
}
|
|
2556
|
+
/* eslint-enable max-len, quote-props */
|
|
2557
|
+
|
|
2558
|
+
/**
|
|
2559
|
+
* Type of webhook sender, used to determine the validation procedure and payload deserialization.
|
|
2560
|
+
*
|
|
2561
|
+
* @schema ReceiverV1Beta1SpecType
|
|
2562
|
+
*/
|
|
2563
|
+
export enum ReceiverV1Beta1SpecType {
|
|
2564
|
+
/** Generic */
|
|
2565
|
+
GENERIC = "generic",
|
|
2566
|
+
/** Generic-hmac */
|
|
2567
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
2568
|
+
/** Github */
|
|
2569
|
+
GITHUB = "github",
|
|
2570
|
+
/** Gitlab */
|
|
2571
|
+
GITLAB = "gitlab",
|
|
2572
|
+
/** Bitbucket */
|
|
2573
|
+
BITBUCKET = "bitbucket",
|
|
2574
|
+
/** Harbor */
|
|
2575
|
+
HARBOR = "harbor",
|
|
2576
|
+
/** Dockerhub */
|
|
2577
|
+
DOCKERHUB = "dockerhub",
|
|
2578
|
+
/** Quay */
|
|
2579
|
+
QUAY = "quay",
|
|
2580
|
+
/** Gcr */
|
|
2581
|
+
GCR = "gcr",
|
|
2582
|
+
/** Nexus */
|
|
2583
|
+
NEXUS = "nexus",
|
|
2584
|
+
/** Acr */
|
|
2585
|
+
ACR = "acr"
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
/**
|
|
2589
|
+
* Kind of the referent
|
|
2590
|
+
*
|
|
2591
|
+
* @schema ReceiverV1Beta1SpecResourcesKind
|
|
2592
|
+
*/
|
|
2593
|
+
export enum ReceiverV1Beta1SpecResourcesKind {
|
|
2594
|
+
/** Bucket */
|
|
2595
|
+
BUCKET = "Bucket",
|
|
2596
|
+
/** GitRepository */
|
|
2597
|
+
GIT_REPOSITORY = "GitRepository",
|
|
2598
|
+
/** Kustomization */
|
|
2599
|
+
KUSTOMIZATION = "Kustomization",
|
|
2600
|
+
/** HelmRelease */
|
|
2601
|
+
HELM_RELEASE = "HelmRelease",
|
|
2602
|
+
/** HelmChart */
|
|
2603
|
+
HELM_CHART = "HelmChart",
|
|
2604
|
+
/** HelmRepository */
|
|
2605
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
2606
|
+
/** ImageRepository */
|
|
2607
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
2608
|
+
/** ImagePolicy */
|
|
2609
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
2610
|
+
/** ImageUpdateAutomation */
|
|
2611
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
2612
|
+
/** OCIRepository */
|
|
2613
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
/**
|
|
2617
|
+
* Receiver is the Schema for the receivers API.
|
|
2618
|
+
*
|
|
2619
|
+
* @schema ReceiverV1Beta2
|
|
2620
|
+
*/
|
|
2621
|
+
export class ReceiverV1Beta2 extends ApiObject {
|
|
2622
|
+
/** Returns the apiVersion and kind for "ReceiverV1Beta2" */
|
|
2623
|
+
public static GVK: GroupVersionKind = {
|
|
2624
|
+
apiVersion: "notification.toolkit.fluxcd.io/v1beta2",
|
|
2625
|
+
kind: "Receiver"
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
/**
|
|
2629
|
+
* Renders a Kubernetes manifest for "ReceiverV1Beta2".
|
|
2630
|
+
*
|
|
2631
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
2632
|
+
*
|
|
2633
|
+
* @param props Initialization props
|
|
2634
|
+
*/
|
|
2635
|
+
public static manifest(props: ReceiverV1Beta2Props = {}): any {
|
|
2636
|
+
return {
|
|
2637
|
+
...ReceiverV1Beta2.GVK,
|
|
2638
|
+
...toJson_ReceiverV1Beta2Props(props)
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
/**
|
|
2643
|
+
* Defines a "ReceiverV1Beta2" API object
|
|
2644
|
+
*
|
|
2645
|
+
* @param scope The scope in which to define this object
|
|
2646
|
+
* @param id A scope-local name for the object
|
|
2647
|
+
* @param props Initialization props
|
|
2648
|
+
*/
|
|
2649
|
+
public constructor(scope: Construct, id: string, props: ReceiverV1Beta2Props = {}) {
|
|
2650
|
+
super(scope, id, {
|
|
2651
|
+
...ReceiverV1Beta2.GVK,
|
|
2652
|
+
...props
|
|
2653
|
+
})
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
/** Renders the object to Kubernetes JSON. */
|
|
2657
|
+
public toJson(): any {
|
|
2658
|
+
const resolved = super.toJson()
|
|
2659
|
+
|
|
2660
|
+
return {
|
|
2661
|
+
...ReceiverV1Beta2.GVK,
|
|
2662
|
+
...toJson_ReceiverV1Beta2Props(resolved)
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
/**
|
|
2668
|
+
* Receiver is the Schema for the receivers API.
|
|
2669
|
+
*
|
|
2670
|
+
* @schema ReceiverV1Beta2
|
|
2671
|
+
*/
|
|
2672
|
+
export interface ReceiverV1Beta2Props {
|
|
2673
|
+
/** @schema ReceiverV1Beta2#metadata */
|
|
2674
|
+
metadata?: ApiObjectMetadata
|
|
2675
|
+
|
|
2676
|
+
/**
|
|
2677
|
+
* ReceiverSpec defines the desired state of the Receiver.
|
|
2678
|
+
*
|
|
2679
|
+
* @schema ReceiverV1Beta2#spec
|
|
2680
|
+
*/
|
|
2681
|
+
spec?: ReceiverV1Beta2Spec
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
/** Converts an object of type 'ReceiverV1Beta2Props' to JSON representation. */
|
|
2685
|
+
/* eslint-disable max-len, quote-props */
|
|
2686
|
+
export function toJson_ReceiverV1Beta2Props(
|
|
2687
|
+
obj: ReceiverV1Beta2Props | undefined
|
|
2688
|
+
): Record<string, any> | undefined {
|
|
2689
|
+
if (obj === undefined) {
|
|
2690
|
+
return undefined
|
|
2691
|
+
}
|
|
2692
|
+
const result = {
|
|
2693
|
+
metadata: obj.metadata,
|
|
2694
|
+
spec: toJson_ReceiverV1Beta2Spec(obj.spec)
|
|
2695
|
+
}
|
|
2696
|
+
// filter undefined values
|
|
2697
|
+
return Object.entries(result).reduce(
|
|
2698
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2699
|
+
{}
|
|
2700
|
+
)
|
|
2701
|
+
}
|
|
2702
|
+
/* eslint-enable max-len, quote-props */
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* ReceiverSpec defines the desired state of the Receiver.
|
|
2706
|
+
*
|
|
2707
|
+
* @schema ReceiverV1Beta2Spec
|
|
2708
|
+
*/
|
|
2709
|
+
export interface ReceiverV1Beta2Spec {
|
|
2710
|
+
/**
|
|
2711
|
+
* Events specifies the list of event types to handle, e.g. 'push' for GitHub or 'Push Hook' for
|
|
2712
|
+
* GitLab.
|
|
2713
|
+
*
|
|
2714
|
+
* @schema ReceiverV1Beta2Spec#events
|
|
2715
|
+
*/
|
|
2716
|
+
events?: string[]
|
|
2717
|
+
|
|
2718
|
+
/**
|
|
2719
|
+
* Interval at which to reconcile the Receiver with its Secret references.
|
|
2720
|
+
*
|
|
2721
|
+
* @schema ReceiverV1Beta2Spec#interval
|
|
2722
|
+
*/
|
|
2723
|
+
interval?: string
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* A list of resources to be notified about changes.
|
|
2727
|
+
*
|
|
2728
|
+
* @schema ReceiverV1Beta2Spec#resources
|
|
2729
|
+
*/
|
|
2730
|
+
resources: ReceiverV1Beta2SpecResources[]
|
|
2731
|
+
|
|
2732
|
+
/**
|
|
2733
|
+
* SecretRef specifies the Secret containing the token used to validate the payload
|
|
2734
|
+
* authenticity.
|
|
2735
|
+
*
|
|
2736
|
+
* @schema ReceiverV1Beta2Spec#secretRef
|
|
2737
|
+
*/
|
|
2738
|
+
secretRef: ReceiverV1Beta2SpecSecretRef
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Suspend tells the controller to suspend subsequent events handling for this receiver.
|
|
2742
|
+
*
|
|
2743
|
+
* @schema ReceiverV1Beta2Spec#suspend
|
|
2744
|
+
*/
|
|
2745
|
+
suspend?: boolean
|
|
2746
|
+
|
|
2747
|
+
/**
|
|
2748
|
+
* Type of webhook sender, used to determine the validation procedure and payload
|
|
2749
|
+
* deserialization.
|
|
2750
|
+
*
|
|
2751
|
+
* @schema ReceiverV1Beta2Spec#type
|
|
2752
|
+
*/
|
|
2753
|
+
type: ReceiverV1Beta2SpecType
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/** Converts an object of type 'ReceiverV1Beta2Spec' to JSON representation. */
|
|
2757
|
+
/* eslint-disable max-len, quote-props */
|
|
2758
|
+
export function toJson_ReceiverV1Beta2Spec(
|
|
2759
|
+
obj: ReceiverV1Beta2Spec | undefined
|
|
2760
|
+
): Record<string, any> | undefined {
|
|
2761
|
+
if (obj === undefined) {
|
|
2762
|
+
return undefined
|
|
2763
|
+
}
|
|
2764
|
+
const result = {
|
|
2765
|
+
events: obj.events?.map(y => y),
|
|
2766
|
+
interval: obj.interval,
|
|
2767
|
+
resources: obj.resources?.map(y => toJson_ReceiverV1Beta2SpecResources(y)),
|
|
2768
|
+
secretRef: toJson_ReceiverV1Beta2SpecSecretRef(obj.secretRef),
|
|
2769
|
+
suspend: obj.suspend,
|
|
2770
|
+
type: obj.type
|
|
2771
|
+
}
|
|
2772
|
+
// filter undefined values
|
|
2773
|
+
return Object.entries(result).reduce(
|
|
2774
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2775
|
+
{}
|
|
2776
|
+
)
|
|
2777
|
+
}
|
|
2778
|
+
/* eslint-enable max-len, quote-props */
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* CrossNamespaceObjectReference contains enough information to let you locate the typed referenced
|
|
2782
|
+
* object at cluster level
|
|
2783
|
+
*
|
|
2784
|
+
* @schema ReceiverV1Beta2SpecResources
|
|
2785
|
+
*/
|
|
2786
|
+
export interface ReceiverV1Beta2SpecResources {
|
|
2787
|
+
/**
|
|
2788
|
+
* API version of the referent
|
|
2789
|
+
*
|
|
2790
|
+
* @schema ReceiverV1Beta2SpecResources#apiVersion
|
|
2791
|
+
*/
|
|
2792
|
+
apiVersion?: string
|
|
2793
|
+
|
|
2794
|
+
/**
|
|
2795
|
+
* Kind of the referent
|
|
2796
|
+
*
|
|
2797
|
+
* @schema ReceiverV1Beta2SpecResources#kind
|
|
2798
|
+
*/
|
|
2799
|
+
kind: ReceiverV1Beta2SpecResourcesKind
|
|
2800
|
+
|
|
2801
|
+
/**
|
|
2802
|
+
* MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
|
|
2803
|
+
* equivalent to an element of matchExpressions, whose key field is "key", the operator is "In",
|
|
2804
|
+
* and the values array contains only "value". The requirements are ANDed. MatchLabels requires
|
|
2805
|
+
* the name to be set to `*`.
|
|
2806
|
+
*
|
|
2807
|
+
* @schema ReceiverV1Beta2SpecResources#matchLabels
|
|
2808
|
+
*/
|
|
2809
|
+
matchLabels?: { [key: string]: string }
|
|
2810
|
+
|
|
2811
|
+
/**
|
|
2812
|
+
* Name of the referent If multiple resources are targeted `*` may be set.
|
|
2813
|
+
*
|
|
2814
|
+
* @schema ReceiverV1Beta2SpecResources#name
|
|
2815
|
+
*/
|
|
2816
|
+
name: string
|
|
2817
|
+
|
|
2818
|
+
/**
|
|
2819
|
+
* Namespace of the referent
|
|
2820
|
+
*
|
|
2821
|
+
* @schema ReceiverV1Beta2SpecResources#namespace
|
|
2822
|
+
*/
|
|
2823
|
+
namespace?: string
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
/** Converts an object of type 'ReceiverV1Beta2SpecResources' to JSON representation. */
|
|
2827
|
+
/* eslint-disable max-len, quote-props */
|
|
2828
|
+
export function toJson_ReceiverV1Beta2SpecResources(
|
|
2829
|
+
obj: ReceiverV1Beta2SpecResources | undefined
|
|
2830
|
+
): Record<string, any> | undefined {
|
|
2831
|
+
if (obj === undefined) {
|
|
2832
|
+
return undefined
|
|
2833
|
+
}
|
|
2834
|
+
const result = {
|
|
2835
|
+
apiVersion: obj.apiVersion,
|
|
2836
|
+
kind: obj.kind,
|
|
2837
|
+
matchLabels:
|
|
2838
|
+
obj.matchLabels === undefined
|
|
2839
|
+
? undefined
|
|
2840
|
+
: Object.entries(obj.matchLabels).reduce(
|
|
2841
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2842
|
+
{}
|
|
2843
|
+
),
|
|
2844
|
+
name: obj.name,
|
|
2845
|
+
namespace: obj.namespace
|
|
2846
|
+
}
|
|
2847
|
+
// filter undefined values
|
|
2848
|
+
return Object.entries(result).reduce(
|
|
2849
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2850
|
+
{}
|
|
2851
|
+
)
|
|
2852
|
+
}
|
|
2853
|
+
/* eslint-enable max-len, quote-props */
|
|
2854
|
+
|
|
2855
|
+
/**
|
|
2856
|
+
* SecretRef specifies the Secret containing the token used to validate the payload authenticity.
|
|
2857
|
+
*
|
|
2858
|
+
* @schema ReceiverV1Beta2SpecSecretRef
|
|
2859
|
+
*/
|
|
2860
|
+
export interface ReceiverV1Beta2SpecSecretRef {
|
|
2861
|
+
/**
|
|
2862
|
+
* Name of the referent.
|
|
2863
|
+
*
|
|
2864
|
+
* @schema ReceiverV1Beta2SpecSecretRef#name
|
|
2865
|
+
*/
|
|
2866
|
+
name: string
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
/** Converts an object of type 'ReceiverV1Beta2SpecSecretRef' to JSON representation. */
|
|
2870
|
+
/* eslint-disable max-len, quote-props */
|
|
2871
|
+
export function toJson_ReceiverV1Beta2SpecSecretRef(
|
|
2872
|
+
obj: ReceiverV1Beta2SpecSecretRef | undefined
|
|
2873
|
+
): Record<string, any> | undefined {
|
|
2874
|
+
if (obj === undefined) {
|
|
2875
|
+
return undefined
|
|
2876
|
+
}
|
|
2877
|
+
const result = {
|
|
2878
|
+
name: obj.name
|
|
2879
|
+
}
|
|
2880
|
+
// filter undefined values
|
|
2881
|
+
return Object.entries(result).reduce(
|
|
2882
|
+
(r, i) => (i[1] === undefined ? r : { ...r, [i[0]]: i[1] }),
|
|
2883
|
+
{}
|
|
2884
|
+
)
|
|
2885
|
+
}
|
|
2886
|
+
/* eslint-enable max-len, quote-props */
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Type of webhook sender, used to determine the validation procedure and payload deserialization.
|
|
2890
|
+
*
|
|
2891
|
+
* @schema ReceiverV1Beta2SpecType
|
|
2892
|
+
*/
|
|
2893
|
+
export enum ReceiverV1Beta2SpecType {
|
|
2894
|
+
/** Generic */
|
|
2895
|
+
GENERIC = "generic",
|
|
2896
|
+
/** Generic-hmac */
|
|
2897
|
+
GENERIC_HYPHEN_HMAC = "generic-hmac",
|
|
2898
|
+
/** Github */
|
|
2899
|
+
GITHUB = "github",
|
|
2900
|
+
/** Gitlab */
|
|
2901
|
+
GITLAB = "gitlab",
|
|
2902
|
+
/** Bitbucket */
|
|
2903
|
+
BITBUCKET = "bitbucket",
|
|
2904
|
+
/** Harbor */
|
|
2905
|
+
HARBOR = "harbor",
|
|
2906
|
+
/** Dockerhub */
|
|
2907
|
+
DOCKERHUB = "dockerhub",
|
|
2908
|
+
/** Quay */
|
|
2909
|
+
QUAY = "quay",
|
|
2910
|
+
/** Gcr */
|
|
2911
|
+
GCR = "gcr",
|
|
2912
|
+
/** Nexus */
|
|
2913
|
+
NEXUS = "nexus",
|
|
2914
|
+
/** Acr */
|
|
2915
|
+
ACR = "acr"
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
/**
|
|
2919
|
+
* Kind of the referent
|
|
2920
|
+
*
|
|
2921
|
+
* @schema ReceiverV1Beta2SpecResourcesKind
|
|
2922
|
+
*/
|
|
2923
|
+
export enum ReceiverV1Beta2SpecResourcesKind {
|
|
2924
|
+
/** Bucket */
|
|
2925
|
+
BUCKET = "Bucket",
|
|
2926
|
+
/** GitRepository */
|
|
2927
|
+
GIT_REPOSITORY = "GitRepository",
|
|
2928
|
+
/** Kustomization */
|
|
2929
|
+
KUSTOMIZATION = "Kustomization",
|
|
2930
|
+
/** HelmRelease */
|
|
2931
|
+
HELM_RELEASE = "HelmRelease",
|
|
2932
|
+
/** HelmChart */
|
|
2933
|
+
HELM_CHART = "HelmChart",
|
|
2934
|
+
/** HelmRepository */
|
|
2935
|
+
HELM_REPOSITORY = "HelmRepository",
|
|
2936
|
+
/** ImageRepository */
|
|
2937
|
+
IMAGE_REPOSITORY = "ImageRepository",
|
|
2938
|
+
/** ImagePolicy */
|
|
2939
|
+
IMAGE_POLICY = "ImagePolicy",
|
|
2940
|
+
/** ImageUpdateAutomation */
|
|
2941
|
+
IMAGE_UPDATE_AUTOMATION = "ImageUpdateAutomation",
|
|
2942
|
+
/** OCIRepository */
|
|
2943
|
+
OCI_REPOSITORY = "OCIRepository"
|
|
2944
|
+
}
|