kubernetes-fluent-client 3.0.3 → 4.0.0-rc-http2-watch

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.
Files changed (42) hide show
  1. package/.prettierignore +4 -0
  2. package/README.md +24 -0
  3. package/dist/cli.js +21 -1
  4. package/dist/fileSystem.d.ts +11 -0
  5. package/dist/fileSystem.d.ts.map +1 -0
  6. package/dist/fileSystem.js +42 -0
  7. package/dist/fileSystem.test.d.ts +2 -0
  8. package/dist/fileSystem.test.d.ts.map +1 -0
  9. package/dist/fileSystem.test.js +75 -0
  10. package/dist/fluent/watch.d.ts +2 -0
  11. package/dist/fluent/watch.d.ts.map +1 -1
  12. package/dist/fluent/watch.js +147 -27
  13. package/dist/generate.d.ts +71 -11
  14. package/dist/generate.d.ts.map +1 -1
  15. package/dist/generate.js +130 -117
  16. package/dist/generate.test.js +293 -346
  17. package/dist/postProcessing.d.ts +246 -0
  18. package/dist/postProcessing.d.ts.map +1 -0
  19. package/dist/postProcessing.js +497 -0
  20. package/dist/postProcessing.test.d.ts +2 -0
  21. package/dist/postProcessing.test.d.ts.map +1 -0
  22. package/dist/postProcessing.test.js +550 -0
  23. package/e2e/cli.e2e.test.ts +127 -0
  24. package/e2e/crds/policyreports.default.expected/policyreport-v1alpha1.ts +332 -0
  25. package/e2e/crds/policyreports.default.expected/policyreport-v1alpha2.ts +360 -0
  26. package/e2e/crds/policyreports.default.expected/policyreport-v1beta1.ts +360 -0
  27. package/e2e/crds/policyreports.no.post.expected/policyreport-v1alpha1.ts +331 -0
  28. package/e2e/crds/policyreports.no.post.expected/policyreport-v1alpha2.ts +360 -0
  29. package/e2e/crds/policyreports.no.post.expected/policyreport-v1beta1.ts +360 -0
  30. package/e2e/crds/test.yaml/policyreports.test.yaml +1008 -0
  31. package/e2e/crds/test.yaml/uds-podmonitors.test.yaml +1245 -0
  32. package/e2e/crds/uds-podmonitors.default.expected/podmonitor-v1.ts +1333 -0
  33. package/e2e/crds/uds-podmonitors.no.post.expected/podmonitor-v1.ts +1360 -0
  34. package/package.json +6 -5
  35. package/src/cli.ts +25 -1
  36. package/src/fileSystem.test.ts +67 -0
  37. package/src/fileSystem.ts +25 -0
  38. package/src/fluent/watch.ts +174 -35
  39. package/src/generate.test.ts +368 -358
  40. package/src/generate.ts +173 -154
  41. package/src/postProcessing.test.ts +742 -0
  42. package/src/postProcessing.ts +568 -0
@@ -0,0 +1,360 @@
1
+ // This file is auto-generated by kubernetes-fluent-client, do not edit manually
2
+ import { GenericKind, RegisterKind } from "kubernetes-fluent-client";
3
+ /**
4
+ * PolicyReport is the Schema for the policyreports API
5
+ */
6
+ export class PolicyReport extends GenericKind {
7
+ /**
8
+ * APIVersion defines the versioned schema of this representation of an object. Servers
9
+ * should convert recognized schemas to the latest internal value, and may reject
10
+ * unrecognized values. More info:
11
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
12
+ */
13
+ declare apiVersion?: string;
14
+ /**
15
+ * Kind is a string value representing the REST resource this object represents. Servers may
16
+ * infer this from the endpoint the client submits requests to. Cannot be updated. In
17
+ * CamelCase. More info:
18
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
19
+ */
20
+ declare kind?: string;
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ declare metadata?: { [key: string]: any };
23
+ /**
24
+ * PolicyReportResult provides result details
25
+ */
26
+ results?: ResultElement[];
27
+ /**
28
+ * Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node)
29
+ */
30
+ scope?: Scope;
31
+ /**
32
+ * ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or
33
+ * none of, but not both of, Scope or ScopeSelector should be specified.
34
+ */
35
+ scopeSelector?: ScopeSelector;
36
+ /**
37
+ * PolicyReportSummary provides a summary of results
38
+ */
39
+ summary?: Summary;
40
+ }
41
+
42
+ /**
43
+ * PolicyReportResult provides the result for an individual policy
44
+ */
45
+ export interface ResultElement {
46
+ /**
47
+ * Category indicates policy category
48
+ */
49
+ category?: string;
50
+ /**
51
+ * Description is a short user friendly message for the policy rule
52
+ */
53
+ message?: string;
54
+ /**
55
+ * Policy is the name or identifier of the policy
56
+ */
57
+ policy: string;
58
+ /**
59
+ * Properties provides additional information for the policy rule
60
+ */
61
+ properties?: { [key: string]: string };
62
+ /**
63
+ * Subjects is an optional reference to the checked Kubernetes resources
64
+ */
65
+ resources?: Resource[];
66
+ /**
67
+ * SubjectSelector is an optional label selector for checked Kubernetes resources. For
68
+ * example, a policy result may apply to all pods that match a label. Either a Subject or a
69
+ * SubjectSelector can be specified. If neither are provided, the result is assumed to be
70
+ * for the policy report scope.
71
+ */
72
+ resourceSelector?: ResourceSelector;
73
+ /**
74
+ * Result indicates the outcome of the policy rule execution
75
+ */
76
+ result?: ResultEnum;
77
+ /**
78
+ * Rule is the name or identifier of the rule within the policy
79
+ */
80
+ rule?: string;
81
+ /**
82
+ * Scored indicates if this result is scored
83
+ */
84
+ scored?: boolean;
85
+ /**
86
+ * Severity indicates policy check result criticality
87
+ */
88
+ severity?: Severity;
89
+ /**
90
+ * Source is an identifier for the policy engine that manages this report
91
+ */
92
+ source?: string;
93
+ /**
94
+ * Timestamp indicates the time the result was found
95
+ */
96
+ timestamp?: Timestamp;
97
+ }
98
+
99
+ /**
100
+ * SubjectSelector is an optional label selector for checked Kubernetes resources. For
101
+ * example, a policy result may apply to all pods that match a label. Either a Subject or a
102
+ * SubjectSelector can be specified. If neither are provided, the result is assumed to be
103
+ * for the policy report scope.
104
+ */
105
+ export interface ResourceSelector {
106
+ /**
107
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
108
+ */
109
+ matchExpressions?: ResourceSelectorMatchExpression[];
110
+ /**
111
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
112
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
113
+ * "In", and the values array contains only "value". The requirements are ANDed.
114
+ */
115
+ matchLabels?: { [key: string]: string };
116
+ }
117
+
118
+ /**
119
+ * A label selector requirement is a selector that contains values, a key, and an operator
120
+ * that relates the key and values.
121
+ */
122
+ export interface ResourceSelectorMatchExpression {
123
+ /**
124
+ * key is the label key that the selector applies to.
125
+ */
126
+ key: string;
127
+ /**
128
+ * operator represents a key's relationship to a set of values. Valid operators are In,
129
+ * NotIn, Exists and DoesNotExist.
130
+ */
131
+ operator: string;
132
+ /**
133
+ * values is an array of string values. If the operator is In or NotIn, the values array
134
+ * must be non-empty. If the operator is Exists or DoesNotExist, the values array must be
135
+ * empty. This array is replaced during a strategic merge patch.
136
+ */
137
+ values?: string[];
138
+ }
139
+
140
+ /**
141
+ * ObjectReference contains enough information to let you inspect or modify the referred
142
+ * object. --- New uses of this type are discouraged because of difficulty describing its
143
+ * usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not
144
+ * generally honored. For instance, ResourceVersion and FieldPath are both very rarely
145
+ * valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for
146
+ * individual usage. In most embedded usages, there are particular restrictions like, "must
147
+ * refer only to types A and B" or "UID not honored" or "name must be restricted". Those
148
+ * cannot be well described when embedded. 3. Inconsistent validation. Because the usages
149
+ * are different, the validation rules are different by usage, which makes it hard for users
150
+ * to predict what will happen. 4. The fields are both imprecise and overly precise. Kind
151
+ * is not a precise mapping to a URL. This can produce ambiguity during interpretation and
152
+ * require a REST mapping. In most cases, the dependency is on the group,resource tuple and
153
+ * the version of the actual struct is irrelevant. 5. We cannot easily change it. Because
154
+ * this type is embedded in many locations, updates to this type will affect numerous
155
+ * schemas. Don't make new APIs embed an underspecified API type they do not control.
156
+ * Instead of using this type, create a locally provided and used type that is well-focused
157
+ * on your reference. For example, ServiceReferences for admission registration:
158
+ * https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
159
+ * .
160
+ */
161
+ export interface Resource {
162
+ /**
163
+ * API version of the referent.
164
+ */
165
+ apiVersion?: string;
166
+ /**
167
+ * If referring to a piece of an object instead of an entire object, this string should
168
+ * contain a valid JSON/Go field access statement, such as
169
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
170
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
171
+ * "name" refers to the name of the container that triggered the event) or if no container
172
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
173
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
174
+ * this design is not final and this field is subject to change in the future.
175
+ */
176
+ fieldPath?: string;
177
+ /**
178
+ * Kind of the referent. More info:
179
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
180
+ */
181
+ kind?: string;
182
+ /**
183
+ * Name of the referent. More info:
184
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
185
+ */
186
+ name?: string;
187
+ /**
188
+ * Namespace of the referent. More info:
189
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
190
+ */
191
+ namespace?: string;
192
+ /**
193
+ * Specific resourceVersion to which this reference is made, if any. More info:
194
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
195
+ */
196
+ resourceVersion?: string;
197
+ /**
198
+ * UID of the referent. More info:
199
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
200
+ */
201
+ uid?: string;
202
+ }
203
+
204
+ /**
205
+ * Result indicates the outcome of the policy rule execution
206
+ */
207
+ export enum ResultEnum {
208
+ Error = "error",
209
+ Fail = "fail",
210
+ Pass = "pass",
211
+ Skip = "skip",
212
+ Warn = "warn",
213
+ }
214
+
215
+ /**
216
+ * Severity indicates policy check result criticality
217
+ */
218
+ export enum Severity {
219
+ Critical = "critical",
220
+ High = "high",
221
+ Info = "info",
222
+ Low = "low",
223
+ Medium = "medium",
224
+ }
225
+
226
+ /**
227
+ * Timestamp indicates the time the result was found
228
+ */
229
+ export interface Timestamp {
230
+ /**
231
+ * Non-negative fractions of a second at nanosecond resolution. Negative second values with
232
+ * fractions must still have non-negative nanos values that count forward in time. Must be
233
+ * from 0 to 999,999,999 inclusive. This field may be limited in precision depending on
234
+ * context.
235
+ */
236
+ nanos: number;
237
+ /**
238
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from
239
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
240
+ */
241
+ seconds: number;
242
+ }
243
+
244
+ /**
245
+ * Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node)
246
+ */
247
+ export interface Scope {
248
+ /**
249
+ * API version of the referent.
250
+ */
251
+ apiVersion?: string;
252
+ /**
253
+ * If referring to a piece of an object instead of an entire object, this string should
254
+ * contain a valid JSON/Go field access statement, such as
255
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
256
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
257
+ * "name" refers to the name of the container that triggered the event) or if no container
258
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
259
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
260
+ * this design is not final and this field is subject to change in the future.
261
+ */
262
+ fieldPath?: string;
263
+ /**
264
+ * Kind of the referent. More info:
265
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
266
+ */
267
+ kind?: string;
268
+ /**
269
+ * Name of the referent. More info:
270
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
271
+ */
272
+ name?: string;
273
+ /**
274
+ * Namespace of the referent. More info:
275
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
276
+ */
277
+ namespace?: string;
278
+ /**
279
+ * Specific resourceVersion to which this reference is made, if any. More info:
280
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
281
+ */
282
+ resourceVersion?: string;
283
+ /**
284
+ * UID of the referent. More info:
285
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
286
+ */
287
+ uid?: string;
288
+ }
289
+
290
+ /**
291
+ * ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or
292
+ * none of, but not both of, Scope or ScopeSelector should be specified.
293
+ */
294
+ export interface ScopeSelector {
295
+ /**
296
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
297
+ */
298
+ matchExpressions?: ScopeSelectorMatchExpression[];
299
+ /**
300
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
301
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
302
+ * "In", and the values array contains only "value". The requirements are ANDed.
303
+ */
304
+ matchLabels?: { [key: string]: string };
305
+ }
306
+
307
+ /**
308
+ * A label selector requirement is a selector that contains values, a key, and an operator
309
+ * that relates the key and values.
310
+ */
311
+ export interface ScopeSelectorMatchExpression {
312
+ /**
313
+ * key is the label key that the selector applies to.
314
+ */
315
+ key: string;
316
+ /**
317
+ * operator represents a key's relationship to a set of values. Valid operators are In,
318
+ * NotIn, Exists and DoesNotExist.
319
+ */
320
+ operator: string;
321
+ /**
322
+ * values is an array of string values. If the operator is In or NotIn, the values array
323
+ * must be non-empty. If the operator is Exists or DoesNotExist, the values array must be
324
+ * empty. This array is replaced during a strategic merge patch.
325
+ */
326
+ values?: string[];
327
+ }
328
+
329
+ /**
330
+ * PolicyReportSummary provides a summary of results
331
+ */
332
+ export interface Summary {
333
+ /**
334
+ * Error provides the count of policies that could not be evaluated
335
+ */
336
+ error?: number;
337
+ /**
338
+ * Fail provides the count of policies whose requirements were not met
339
+ */
340
+ fail?: number;
341
+ /**
342
+ * Pass provides the count of policies whose requirements were met
343
+ */
344
+ pass?: number;
345
+ /**
346
+ * Skip indicates the count of policies that were not selected for evaluation
347
+ */
348
+ skip?: number;
349
+ /**
350
+ * Warn provides the count of non-scored policies whose requirements were not met
351
+ */
352
+ warn?: number;
353
+ }
354
+
355
+ RegisterKind(PolicyReport, {
356
+ group: "wgpolicyk8s.io",
357
+ version: "v1beta1",
358
+ kind: "PolicyReport",
359
+ plural: "policyreports",
360
+ });
@@ -0,0 +1,331 @@
1
+ /**
2
+ * PolicyReport is the Schema for the policyreports API
3
+ */
4
+ export interface PolicyReport {
5
+ /**
6
+ * APIVersion defines the versioned schema of this representation of an object. Servers
7
+ * should convert recognized schemas to the latest internal value, and may reject
8
+ * unrecognized values. More info:
9
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
10
+ */
11
+ apiVersion?: string;
12
+ /**
13
+ * Kind is a string value representing the REST resource this object represents. Servers may
14
+ * infer this from the endpoint the client submits requests to. Cannot be updated. In
15
+ * CamelCase. More info:
16
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
17
+ */
18
+ kind?: string;
19
+ metadata?: { [key: string]: any };
20
+ /**
21
+ * PolicyReportResult provides result details
22
+ */
23
+ results?: Result[];
24
+ /**
25
+ * Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node)
26
+ */
27
+ scope?: Scope;
28
+ /**
29
+ * ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or
30
+ * none of, but not both of, Scope or ScopeSelector should be specified.
31
+ */
32
+ scopeSelector?: ScopeSelector;
33
+ /**
34
+ * PolicyReportSummary provides a summary of results
35
+ */
36
+ summary?: Summary;
37
+ [property: string]: any;
38
+ }
39
+
40
+ /**
41
+ * PolicyReportResult provides the result for an individual policy
42
+ */
43
+ export interface Result {
44
+ /**
45
+ * Category indicates policy category
46
+ */
47
+ category?: string;
48
+ /**
49
+ * Data provides additional information for the policy rule
50
+ */
51
+ data?: { [key: string]: string };
52
+ /**
53
+ * Message is a short user friendly description of the policy rule
54
+ */
55
+ message?: string;
56
+ /**
57
+ * Policy is the name of the policy
58
+ */
59
+ policy: string;
60
+ /**
61
+ * Resources is an optional reference to the resource checked by the policy and rule
62
+ */
63
+ resources?: Resource[];
64
+ /**
65
+ * ResourceSelector is an optional selector for policy results that apply to multiple
66
+ * resources. For example, a policy result may apply to all pods that match a label. Either
67
+ * a Resource or a ResourceSelector can be specified. If neither are provided, the result is
68
+ * assumed to be for the policy report scope.
69
+ */
70
+ resourceSelector?: ResourceSelector;
71
+ /**
72
+ * Rule is the name of the policy rule
73
+ */
74
+ rule?: string;
75
+ /**
76
+ * Scored indicates if this policy rule is scored
77
+ */
78
+ scored?: boolean;
79
+ /**
80
+ * Severity indicates policy severity
81
+ */
82
+ severity?: Severity;
83
+ /**
84
+ * Status indicates the result of the policy rule check
85
+ */
86
+ status?: Status;
87
+ [property: string]: any;
88
+ }
89
+
90
+ /**
91
+ * ResourceSelector is an optional selector for policy results that apply to multiple
92
+ * resources. For example, a policy result may apply to all pods that match a label. Either
93
+ * a Resource or a ResourceSelector can be specified. If neither are provided, the result is
94
+ * assumed to be for the policy report scope.
95
+ */
96
+ export interface ResourceSelector {
97
+ /**
98
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
99
+ */
100
+ matchExpressions?: ResourceSelectorMatchExpression[];
101
+ /**
102
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
103
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
104
+ * "In", and the values array contains only "value". The requirements are ANDed.
105
+ */
106
+ matchLabels?: { [key: string]: string };
107
+ [property: string]: any;
108
+ }
109
+
110
+ /**
111
+ * A label selector requirement is a selector that contains values, a key, and an operator
112
+ * that relates the key and values.
113
+ */
114
+ export interface ResourceSelectorMatchExpression {
115
+ /**
116
+ * key is the label key that the selector applies to.
117
+ */
118
+ key: string;
119
+ /**
120
+ * operator represents a key's relationship to a set of values. Valid operators are In,
121
+ * NotIn, Exists and DoesNotExist.
122
+ */
123
+ operator: string;
124
+ /**
125
+ * values is an array of string values. If the operator is In or NotIn, the values array
126
+ * must be non-empty. If the operator is Exists or DoesNotExist, the values array must be
127
+ * empty. This array is replaced during a strategic merge patch.
128
+ */
129
+ values?: string[];
130
+ [property: string]: any;
131
+ }
132
+
133
+ /**
134
+ * ObjectReference contains enough information to let you inspect or modify the referred
135
+ * object. --- New uses of this type are discouraged because of difficulty describing its
136
+ * usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not
137
+ * generally honored. For instance, ResourceVersion and FieldPath are both very rarely
138
+ * valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for
139
+ * individual usage. In most embedded usages, there are particular restrictions like, "must
140
+ * refer only to types A and B" or "UID not honored" or "name must be restricted". Those
141
+ * cannot be well described when embedded. 3. Inconsistent validation. Because the usages
142
+ * are different, the validation rules are different by usage, which makes it hard for users
143
+ * to predict what will happen. 4. The fields are both imprecise and overly precise. Kind
144
+ * is not a precise mapping to a URL. This can produce ambiguity during interpretation and
145
+ * require a REST mapping. In most cases, the dependency is on the group,resource tuple and
146
+ * the version of the actual struct is irrelevant. 5. We cannot easily change it. Because
147
+ * this type is embedded in many locations, updates to this type will affect numerous
148
+ * schemas. Don't make new APIs embed an underspecified API type they do not control.
149
+ * Instead of using this type, create a locally provided and used type that is well-focused
150
+ * on your reference. For example, ServiceReferences for admission registration:
151
+ * https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
152
+ * .
153
+ */
154
+ export interface Resource {
155
+ /**
156
+ * API version of the referent.
157
+ */
158
+ apiVersion?: string;
159
+ /**
160
+ * If referring to a piece of an object instead of an entire object, this string should
161
+ * contain a valid JSON/Go field access statement, such as
162
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
163
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
164
+ * "name" refers to the name of the container that triggered the event) or if no container
165
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
166
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
167
+ * this design is not final and this field is subject to change in the future.
168
+ */
169
+ fieldPath?: string;
170
+ /**
171
+ * Kind of the referent. More info:
172
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
173
+ */
174
+ kind?: string;
175
+ /**
176
+ * Name of the referent. More info:
177
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
178
+ */
179
+ name?: string;
180
+ /**
181
+ * Namespace of the referent. More info:
182
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
183
+ */
184
+ namespace?: string;
185
+ /**
186
+ * Specific resourceVersion to which this reference is made, if any. More info:
187
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
188
+ */
189
+ resourceVersion?: string;
190
+ /**
191
+ * UID of the referent. More info:
192
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
193
+ */
194
+ uid?: string;
195
+ [property: string]: any;
196
+ }
197
+
198
+ /**
199
+ * Severity indicates policy severity
200
+ */
201
+ export enum Severity {
202
+ High = "high",
203
+ Low = "low",
204
+ Medium = "medium",
205
+ }
206
+
207
+ /**
208
+ * Status indicates the result of the policy rule check
209
+ */
210
+ export enum Status {
211
+ Error = "error",
212
+ Fail = "fail",
213
+ Pass = "pass",
214
+ Skip = "skip",
215
+ Warn = "warn",
216
+ }
217
+
218
+ /**
219
+ * Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node)
220
+ */
221
+ export interface Scope {
222
+ /**
223
+ * API version of the referent.
224
+ */
225
+ apiVersion?: string;
226
+ /**
227
+ * If referring to a piece of an object instead of an entire object, this string should
228
+ * contain a valid JSON/Go field access statement, such as
229
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
230
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
231
+ * "name" refers to the name of the container that triggered the event) or if no container
232
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
233
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
234
+ * this design is not final and this field is subject to change in the future.
235
+ */
236
+ fieldPath?: string;
237
+ /**
238
+ * Kind of the referent. More info:
239
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
240
+ */
241
+ kind?: string;
242
+ /**
243
+ * Name of the referent. More info:
244
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
245
+ */
246
+ name?: string;
247
+ /**
248
+ * Namespace of the referent. More info:
249
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
250
+ */
251
+ namespace?: string;
252
+ /**
253
+ * Specific resourceVersion to which this reference is made, if any. More info:
254
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
255
+ */
256
+ resourceVersion?: string;
257
+ /**
258
+ * UID of the referent. More info:
259
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
260
+ */
261
+ uid?: string;
262
+ [property: string]: any;
263
+ }
264
+
265
+ /**
266
+ * ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or
267
+ * none of, but not both of, Scope or ScopeSelector should be specified.
268
+ */
269
+ export interface ScopeSelector {
270
+ /**
271
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
272
+ */
273
+ matchExpressions?: ScopeSelectorMatchExpression[];
274
+ /**
275
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
276
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
277
+ * "In", and the values array contains only "value". The requirements are ANDed.
278
+ */
279
+ matchLabels?: { [key: string]: string };
280
+ [property: string]: any;
281
+ }
282
+
283
+ /**
284
+ * A label selector requirement is a selector that contains values, a key, and an operator
285
+ * that relates the key and values.
286
+ */
287
+ export interface ScopeSelectorMatchExpression {
288
+ /**
289
+ * key is the label key that the selector applies to.
290
+ */
291
+ key: string;
292
+ /**
293
+ * operator represents a key's relationship to a set of values. Valid operators are In,
294
+ * NotIn, Exists and DoesNotExist.
295
+ */
296
+ operator: string;
297
+ /**
298
+ * values is an array of string values. If the operator is In or NotIn, the values array
299
+ * must be non-empty. If the operator is Exists or DoesNotExist, the values array must be
300
+ * empty. This array is replaced during a strategic merge patch.
301
+ */
302
+ values?: string[];
303
+ [property: string]: any;
304
+ }
305
+
306
+ /**
307
+ * PolicyReportSummary provides a summary of results
308
+ */
309
+ export interface Summary {
310
+ /**
311
+ * Error provides the count of policies that could not be evaluated
312
+ */
313
+ error?: number;
314
+ /**
315
+ * Fail provides the count of policies whose requirements were not met
316
+ */
317
+ fail?: number;
318
+ /**
319
+ * Pass provides the count of policies whose requirements were met
320
+ */
321
+ pass?: number;
322
+ /**
323
+ * Skip indicates the count of policies that were not selected for evaluation
324
+ */
325
+ skip?: number;
326
+ /**
327
+ * Warn provides the count of unscored policies whose requirements were not met
328
+ */
329
+ warn?: number;
330
+ [property: string]: any;
331
+ }