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,332 @@
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?: Result[];
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 Result {
46
+ /**
47
+ * Category indicates policy category
48
+ */
49
+ category?: string;
50
+ /**
51
+ * Data provides additional information for the policy rule
52
+ */
53
+ data?: { [key: string]: string };
54
+ /**
55
+ * Message is a short user friendly description of the policy rule
56
+ */
57
+ message?: string;
58
+ /**
59
+ * Policy is the name of the policy
60
+ */
61
+ policy: string;
62
+ /**
63
+ * Resources is an optional reference to the resource checked by the policy and rule
64
+ */
65
+ resources?: Resource[];
66
+ /**
67
+ * ResourceSelector is an optional selector for policy results that apply to multiple
68
+ * resources. For example, a policy result may apply to all pods that match a label. Either
69
+ * a Resource or a ResourceSelector can be specified. If neither are provided, the result is
70
+ * assumed to be for the policy report scope.
71
+ */
72
+ resourceSelector?: ResourceSelector;
73
+ /**
74
+ * Rule is the name of the policy rule
75
+ */
76
+ rule?: string;
77
+ /**
78
+ * Scored indicates if this policy rule is scored
79
+ */
80
+ scored?: boolean;
81
+ /**
82
+ * Severity indicates policy severity
83
+ */
84
+ severity?: Severity;
85
+ /**
86
+ * Status indicates the result of the policy rule check
87
+ */
88
+ status?: Status;
89
+ }
90
+
91
+ /**
92
+ * ResourceSelector is an optional selector for policy results that apply to multiple
93
+ * resources. For example, a policy result may apply to all pods that match a label. Either
94
+ * a Resource or a ResourceSelector can be specified. If neither are provided, the result is
95
+ * assumed to be for the policy report scope.
96
+ */
97
+ export interface ResourceSelector {
98
+ /**
99
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
100
+ */
101
+ matchExpressions?: ResourceSelectorMatchExpression[];
102
+ /**
103
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
104
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
105
+ * "In", and the values array contains only "value". The requirements are ANDed.
106
+ */
107
+ matchLabels?: { [key: string]: string };
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
+ }
131
+
132
+ /**
133
+ * ObjectReference contains enough information to let you inspect or modify the referred
134
+ * object. --- New uses of this type are discouraged because of difficulty describing its
135
+ * usage when embedded in APIs. 1. Ignored fields. It includes many fields which are not
136
+ * generally honored. For instance, ResourceVersion and FieldPath are both very rarely
137
+ * valid in actual usage. 2. Invalid usage help. It is impossible to add specific help for
138
+ * individual usage. In most embedded usages, there are particular restrictions like, "must
139
+ * refer only to types A and B" or "UID not honored" or "name must be restricted". Those
140
+ * cannot be well described when embedded. 3. Inconsistent validation. Because the usages
141
+ * are different, the validation rules are different by usage, which makes it hard for users
142
+ * to predict what will happen. 4. The fields are both imprecise and overly precise. Kind
143
+ * is not a precise mapping to a URL. This can produce ambiguity during interpretation and
144
+ * require a REST mapping. In most cases, the dependency is on the group,resource tuple and
145
+ * the version of the actual struct is irrelevant. 5. We cannot easily change it. Because
146
+ * this type is embedded in many locations, updates to this type will affect numerous
147
+ * schemas. Don't make new APIs embed an underspecified API type they do not control.
148
+ * Instead of using this type, create a locally provided and used type that is well-focused
149
+ * on your reference. For example, ServiceReferences for admission registration:
150
+ * https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
151
+ * .
152
+ */
153
+ export interface Resource {
154
+ /**
155
+ * API version of the referent.
156
+ */
157
+ apiVersion?: string;
158
+ /**
159
+ * If referring to a piece of an object instead of an entire object, this string should
160
+ * contain a valid JSON/Go field access statement, such as
161
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
162
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
163
+ * "name" refers to the name of the container that triggered the event) or if no container
164
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
165
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
166
+ * this design is not final and this field is subject to change in the future.
167
+ */
168
+ fieldPath?: string;
169
+ /**
170
+ * Kind of the referent. More info:
171
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
172
+ */
173
+ kind?: string;
174
+ /**
175
+ * Name of the referent. More info:
176
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
177
+ */
178
+ name?: string;
179
+ /**
180
+ * Namespace of the referent. More info:
181
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
182
+ */
183
+ namespace?: string;
184
+ /**
185
+ * Specific resourceVersion to which this reference is made, if any. More info:
186
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
187
+ */
188
+ resourceVersion?: string;
189
+ /**
190
+ * UID of the referent. More info:
191
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
192
+ */
193
+ uid?: string;
194
+ }
195
+
196
+ /**
197
+ * Severity indicates policy severity
198
+ */
199
+ export enum Severity {
200
+ High = "high",
201
+ Low = "low",
202
+ Medium = "medium",
203
+ }
204
+
205
+ /**
206
+ * Status indicates the result of the policy rule check
207
+ */
208
+ export enum Status {
209
+ Error = "error",
210
+ Fail = "fail",
211
+ Pass = "pass",
212
+ Skip = "skip",
213
+ Warn = "warn",
214
+ }
215
+
216
+ /**
217
+ * Scope is an optional reference to the report scope (e.g. a Deployment, Namespace, or Node)
218
+ */
219
+ export interface Scope {
220
+ /**
221
+ * API version of the referent.
222
+ */
223
+ apiVersion?: string;
224
+ /**
225
+ * If referring to a piece of an object instead of an entire object, this string should
226
+ * contain a valid JSON/Go field access statement, such as
227
+ * desiredState.manifest.containers[2]. For example, if the object reference is to a
228
+ * container within a pod, this would take on a value like: "spec.containers{name}" (where
229
+ * "name" refers to the name of the container that triggered the event) or if no container
230
+ * name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax
231
+ * is chosen only to have some well-defined way of referencing a part of an object. TODO:
232
+ * this design is not final and this field is subject to change in the future.
233
+ */
234
+ fieldPath?: string;
235
+ /**
236
+ * Kind of the referent. More info:
237
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
238
+ */
239
+ kind?: string;
240
+ /**
241
+ * Name of the referent. More info:
242
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
243
+ */
244
+ name?: string;
245
+ /**
246
+ * Namespace of the referent. More info:
247
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
248
+ */
249
+ namespace?: string;
250
+ /**
251
+ * Specific resourceVersion to which this reference is made, if any. More info:
252
+ * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
253
+ */
254
+ resourceVersion?: string;
255
+ /**
256
+ * UID of the referent. More info:
257
+ * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
258
+ */
259
+ uid?: string;
260
+ }
261
+
262
+ /**
263
+ * ScopeSelector is an optional selector for multiple scopes (e.g. Pods). Either one of, or
264
+ * none of, but not both of, Scope or ScopeSelector should be specified.
265
+ */
266
+ export interface ScopeSelector {
267
+ /**
268
+ * matchExpressions is a list of label selector requirements. The requirements are ANDed.
269
+ */
270
+ matchExpressions?: ScopeSelectorMatchExpression[];
271
+ /**
272
+ * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
273
+ * equivalent to an element of matchExpressions, whose key field is "key", the operator is
274
+ * "In", and the values array contains only "value". The requirements are ANDed.
275
+ */
276
+ matchLabels?: { [key: string]: string };
277
+ }
278
+
279
+ /**
280
+ * A label selector requirement is a selector that contains values, a key, and an operator
281
+ * that relates the key and values.
282
+ */
283
+ export interface ScopeSelectorMatchExpression {
284
+ /**
285
+ * key is the label key that the selector applies to.
286
+ */
287
+ key: string;
288
+ /**
289
+ * operator represents a key's relationship to a set of values. Valid operators are In,
290
+ * NotIn, Exists and DoesNotExist.
291
+ */
292
+ operator: string;
293
+ /**
294
+ * values is an array of string values. If the operator is In or NotIn, the values array
295
+ * must be non-empty. If the operator is Exists or DoesNotExist, the values array must be
296
+ * empty. This array is replaced during a strategic merge patch.
297
+ */
298
+ values?: string[];
299
+ }
300
+
301
+ /**
302
+ * PolicyReportSummary provides a summary of results
303
+ */
304
+ export interface Summary {
305
+ /**
306
+ * Error provides the count of policies that could not be evaluated
307
+ */
308
+ error?: number;
309
+ /**
310
+ * Fail provides the count of policies whose requirements were not met
311
+ */
312
+ fail?: number;
313
+ /**
314
+ * Pass provides the count of policies whose requirements were met
315
+ */
316
+ pass?: number;
317
+ /**
318
+ * Skip indicates the count of policies that were not selected for evaluation
319
+ */
320
+ skip?: number;
321
+ /**
322
+ * Warn provides the count of unscored policies whose requirements were not met
323
+ */
324
+ warn?: number;
325
+ }
326
+
327
+ RegisterKind(PolicyReport, {
328
+ group: "wgpolicyk8s.io",
329
+ version: "v1alpha1",
330
+ kind: "PolicyReport",
331
+ plural: "policyreports",
332
+ });
@@ -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: "v1alpha2",
358
+ kind: "PolicyReport",
359
+ plural: "policyreports",
360
+ });