pepr 0.36.0 → 0.37.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/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/templates.d.ts +4 -3
- package/dist/cli/init/templates.d.ts.map +1 -1
- package/dist/cli/init/utils.d.ts.map +1 -1
- package/dist/cli/init/walkthrough.d.ts +10 -3
- package/dist/cli/init/walkthrough.d.ts.map +1 -1
- package/dist/cli/types.d.ts +3 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli.js +253 -31
- package/dist/controller.js +138 -1
- package/dist/lib/adjudicators.d.ts +63 -0
- package/dist/lib/adjudicators.d.ts.map +1 -0
- package/dist/lib/adjudicators.test.d.ts +2 -0
- package/dist/lib/adjudicators.test.d.ts.map +1 -0
- package/dist/lib/assets/loader.d.ts.map +1 -1
- package/dist/lib/assets/pods.d.ts +1 -0
- package/dist/lib/assets/pods.d.ts.map +1 -1
- package/dist/lib/capability.d.ts +1 -0
- package/dist/lib/capability.d.ts.map +1 -1
- package/dist/lib/capability.test.d.ts +2 -0
- package/dist/lib/capability.test.d.ts.map +1 -0
- package/dist/lib/controller/index.d.ts.map +1 -1
- package/dist/lib/controller/store.d.ts +4 -0
- package/dist/lib/controller/store.d.ts.map +1 -1
- package/dist/lib/controller/store.test.d.ts +2 -0
- package/dist/lib/controller/store.test.d.ts.map +1 -0
- package/dist/lib/filter.d.ts +2 -3
- package/dist/lib/filter.d.ts.map +1 -1
- package/dist/lib/filter.test.d.ts +2 -1
- package/dist/lib/filter.test.d.ts.map +1 -1
- package/dist/lib/finalizer.d.ts +6 -0
- package/dist/lib/finalizer.d.ts.map +1 -0
- package/dist/lib/finalizer.test.d.ts +2 -0
- package/dist/lib/finalizer.test.d.ts.map +1 -0
- package/dist/lib/helpers.d.ts +2 -2
- package/dist/lib/helpers.d.ts.map +1 -1
- package/dist/lib/helpers.test.d.ts +1 -1
- package/dist/lib/helpers.test.d.ts.map +1 -1
- package/dist/lib/k8s.d.ts.map +1 -1
- package/dist/lib/module.d.ts +2 -1
- package/dist/lib/module.d.ts.map +1 -1
- package/dist/lib/mutate-processor.d.ts +2 -1
- package/dist/lib/mutate-processor.d.ts.map +1 -1
- package/dist/lib/mutate-request.d.ts +1 -2
- package/dist/lib/mutate-request.d.ts.map +1 -1
- package/dist/lib/schedule.d.ts +1 -2
- package/dist/lib/schedule.d.ts.map +1 -1
- package/dist/lib/storage.d.ts.map +1 -1
- package/dist/lib/types.d.ts +113 -6
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/validate-processor.d.ts +4 -2
- package/dist/lib/validate-processor.d.ts.map +1 -1
- package/dist/lib/validate-request.d.ts +1 -1
- package/dist/lib/validate-request.d.ts.map +1 -1
- package/dist/lib/watch-processor.d.ts +1 -1
- package/dist/lib/watch-processor.d.ts.map +1 -1
- package/dist/lib.js +383 -204
- package/dist/lib.js.map +4 -4
- package/package.json +13 -12
- package/src/cli/build.ts +3 -3
- package/src/cli/init/index.ts +20 -11
- package/src/cli/init/templates.ts +1 -1
- package/src/cli/init/utils.test.ts +11 -20
- package/src/cli/init/utils.ts +5 -0
- package/src/cli/init/walkthrough.test.ts +92 -11
- package/src/cli/init/walkthrough.ts +71 -16
- package/src/cli/monitor.ts +1 -1
- package/src/cli/types.ts +3 -0
- package/src/cli.ts +4 -2
- package/src/fixtures/data/create-pod.json +1 -1
- package/src/fixtures/data/delete-pod.json +1 -1
- package/src/lib/adjudicators.test.ts +1232 -0
- package/src/lib/adjudicators.ts +235 -0
- package/src/lib/assets/index.ts +1 -1
- package/src/lib/assets/loader.ts +1 -0
- package/src/lib/assets/webhooks.ts +1 -1
- package/src/lib/capability.test.ts +655 -0
- package/src/lib/capability.ts +104 -11
- package/src/lib/controller/index.ts +7 -4
- package/src/lib/controller/store.test.ts +131 -0
- package/src/lib/controller/store.ts +43 -5
- package/src/lib/filter.test.ts +194 -8
- package/src/lib/filter.ts +46 -107
- package/src/lib/finalizer.test.ts +236 -0
- package/src/lib/finalizer.ts +63 -0
- package/src/lib/helpers.test.ts +329 -69
- package/src/lib/helpers.ts +141 -100
- package/src/lib/k8s.ts +4 -0
- package/src/lib/module.ts +3 -3
- package/src/lib/mutate-processor.ts +5 -4
- package/src/lib/mutate-request.test.ts +1 -2
- package/src/lib/mutate-request.ts +1 -3
- package/src/lib/schedule.ts +1 -1
- package/src/lib/storage.ts +5 -6
- package/src/lib/types.ts +148 -5
- package/src/lib/validate-processor.ts +5 -2
- package/src/lib/validate-request.test.ts +1 -4
- package/src/lib/validate-request.ts +1 -1
- package/src/lib/watch-processor.ts +19 -5
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { GenericClass, GroupVersionKind, KubernetesObject } from "kubernetes-fluent-client";
|
|
2
|
-
import {
|
|
2
|
+
import { WatchPhase } from "kubernetes-fluent-client/dist/fluent/types";
|
|
3
3
|
import { PeprMutateRequest } from "./mutate-request";
|
|
4
4
|
import { PeprValidateRequest } from "./validate-request";
|
|
5
|
+
import { Logger } from "pino";
|
|
6
|
+
export declare enum Operation {
|
|
7
|
+
CREATE = "CREATE",
|
|
8
|
+
UPDATE = "UPDATE",
|
|
9
|
+
DELETE = "DELETE",
|
|
10
|
+
CONNECT = "CONNECT"
|
|
11
|
+
}
|
|
5
12
|
/**
|
|
6
13
|
* Specifically for deploying images with a private registry
|
|
7
14
|
*/
|
|
@@ -70,24 +77,33 @@ export type WhenSelector<T extends GenericClass> = {
|
|
|
70
77
|
/** Register an action to be executed when a Kubernetes resource is deleted. */
|
|
71
78
|
IsDeleted: () => BindingAll<T>;
|
|
72
79
|
};
|
|
80
|
+
export interface RegExpFilter {
|
|
81
|
+
obj: RegExp;
|
|
82
|
+
source: string;
|
|
83
|
+
}
|
|
73
84
|
export type Binding = {
|
|
74
85
|
event: Event;
|
|
75
86
|
isMutate?: boolean;
|
|
76
87
|
isValidate?: boolean;
|
|
77
88
|
isWatch?: boolean;
|
|
78
89
|
isQueue?: boolean;
|
|
90
|
+
isFinalize?: boolean;
|
|
79
91
|
readonly model: GenericClass;
|
|
80
92
|
readonly kind: GroupVersionKind;
|
|
81
93
|
readonly filters: {
|
|
82
94
|
name: string;
|
|
95
|
+
regexName: string;
|
|
83
96
|
namespaces: string[];
|
|
97
|
+
regexNamespaces: string[];
|
|
84
98
|
labels: Record<string, string>;
|
|
85
99
|
annotations: Record<string, string>;
|
|
86
100
|
deletionTimestamp: boolean;
|
|
87
101
|
};
|
|
102
|
+
alias?: string;
|
|
88
103
|
readonly mutateCallback?: MutateAction<GenericClass, InstanceType<GenericClass>>;
|
|
89
104
|
readonly validateCallback?: ValidateAction<GenericClass, InstanceType<GenericClass>>;
|
|
90
|
-
readonly watchCallback?:
|
|
105
|
+
readonly watchCallback?: WatchLogAction<GenericClass, InstanceType<GenericClass>>;
|
|
106
|
+
readonly finalizeCallback?: FinalizeAction<GenericClass, InstanceType<GenericClass>>;
|
|
91
107
|
};
|
|
92
108
|
export type BindingFilter<T extends GenericClass> = CommonActionChain<T> & {
|
|
93
109
|
/**
|
|
@@ -132,10 +148,14 @@ export type BindingFilter<T extends GenericClass> = CommonActionChain<T> & {
|
|
|
132
148
|
export type BindingWithName<T extends GenericClass> = BindingFilter<T> & {
|
|
133
149
|
/** Only apply the action if the resource name matches the specified name. */
|
|
134
150
|
WithName: (name: string) => BindingFilter<T>;
|
|
151
|
+
/** Only apply the action if the resource name matches the specified regex name. */
|
|
152
|
+
WithNameRegex: (name: RegExp) => BindingFilter<T>;
|
|
135
153
|
};
|
|
136
154
|
export type BindingAll<T extends GenericClass> = BindingWithName<T> & {
|
|
137
155
|
/** Only apply the action if the resource is in one of the specified namespaces.*/
|
|
138
156
|
InNamespace: (...namespaces: string[]) => BindingWithName<T>;
|
|
157
|
+
/** Only apply the action if the resource is in one of the specified regex namespaces.*/
|
|
158
|
+
InNamespaceRegex: (...namespaces: RegExp[]) => BindingWithName<T>;
|
|
139
159
|
};
|
|
140
160
|
export type CommonActionChain<T extends GenericClass> = MutateActionChain<T> & {
|
|
141
161
|
/**
|
|
@@ -147,6 +167,7 @@ export type CommonActionChain<T extends GenericClass> = MutateActionChain<T> & {
|
|
|
147
167
|
* @param action The action to be executed when the Kubernetes resource is processed by the AdmissionController.
|
|
148
168
|
*/
|
|
149
169
|
Mutate: (action: MutateAction<T, InstanceType<T>>) => MutateActionChain<T>;
|
|
170
|
+
Alias: (alias: string) => BindingFilter<T>;
|
|
150
171
|
};
|
|
151
172
|
export type ValidateActionChain<T extends GenericClass> = {
|
|
152
173
|
/**
|
|
@@ -160,7 +181,7 @@ export type ValidateActionChain<T extends GenericClass> = {
|
|
|
160
181
|
* @param action
|
|
161
182
|
* @returns
|
|
162
183
|
*/
|
|
163
|
-
Watch: (action:
|
|
184
|
+
Watch: (action: WatchLogAction<T, InstanceType<T>>) => FinalizeActionChain<T>;
|
|
164
185
|
/**
|
|
165
186
|
* Establish a reconcile for the specified resource. The callback function will be executed after the admission controller has
|
|
166
187
|
* processed the resource and the request has been persisted to the cluster.
|
|
@@ -172,7 +193,7 @@ export type ValidateActionChain<T extends GenericClass> = {
|
|
|
172
193
|
* @param action
|
|
173
194
|
* @returns
|
|
174
195
|
*/
|
|
175
|
-
Reconcile: (action:
|
|
196
|
+
Reconcile: (action: WatchLogAction<T, InstanceType<T>>) => FinalizeActionChain<T>;
|
|
176
197
|
};
|
|
177
198
|
export type MutateActionChain<T extends GenericClass> = ValidateActionChain<T> & {
|
|
178
199
|
/**
|
|
@@ -198,11 +219,97 @@ export type MutateActionChain<T extends GenericClass> = ValidateActionChain<T> &
|
|
|
198
219
|
*/
|
|
199
220
|
Validate: (action: ValidateAction<T, InstanceType<T>>) => ValidateActionChain<T>;
|
|
200
221
|
};
|
|
201
|
-
export type MutateAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (req: PeprMutateRequest<K
|
|
202
|
-
export type ValidateAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (req: PeprValidateRequest<K
|
|
222
|
+
export type MutateAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (req: PeprMutateRequest<K>, logger?: Logger) => Promise<void> | void | Promise<PeprMutateRequest<K>> | PeprMutateRequest<K>;
|
|
223
|
+
export type ValidateAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (req: PeprValidateRequest<K>, logger?: Logger) => Promise<ValidateActionResponse> | ValidateActionResponse;
|
|
224
|
+
export type WatchLogAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (update: K, phase: WatchPhase, logger?: Logger) => Promise<void> | void;
|
|
203
225
|
export type ValidateActionResponse = {
|
|
204
226
|
allowed: boolean;
|
|
205
227
|
statusCode?: number;
|
|
206
228
|
statusMessage?: string;
|
|
207
229
|
};
|
|
230
|
+
export type FinalizeAction<T extends GenericClass, K extends KubernetesObject = InstanceType<T>> = (update: K, logger?: Logger) => Promise<void> | void;
|
|
231
|
+
export type FinalizeActionChain<T extends GenericClass> = {
|
|
232
|
+
/**
|
|
233
|
+
* Establish a finalizer for the specified resource. The callback given will be executed by the watch
|
|
234
|
+
* controller after it has received notification of an update adding a deletionTimestamp.
|
|
235
|
+
*
|
|
236
|
+
* **Beta Function**: This method is still in early testing and edge cases may still exist.
|
|
237
|
+
*
|
|
238
|
+
* @since 0.35.0
|
|
239
|
+
*
|
|
240
|
+
* @param action
|
|
241
|
+
* @returns
|
|
242
|
+
*/
|
|
243
|
+
Finalize: (action: FinalizeAction<T, InstanceType<T>>) => void;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* A Kubernetes admission request to be processed by a capability.
|
|
247
|
+
*/
|
|
248
|
+
export interface AdmissionRequest<T = KubernetesObject> {
|
|
249
|
+
/** UID is an identifier for the individual request/response. */
|
|
250
|
+
readonly uid: string;
|
|
251
|
+
/** Kind is the fully-qualified type of object being submitted (for example, v1.Pod or autoscaling.v1.Scale) */
|
|
252
|
+
readonly kind: GroupVersionKind;
|
|
253
|
+
/** Resource is the fully-qualified resource being requested (for example, v1.pods) */
|
|
254
|
+
readonly resource: GroupVersionResource;
|
|
255
|
+
/** SubResource is the sub-resource being requested, if any (for example, "status" or "scale") */
|
|
256
|
+
readonly subResource?: string;
|
|
257
|
+
/** RequestKind is the fully-qualified type of the original API request (for example, v1.Pod or autoscaling.v1.Scale). */
|
|
258
|
+
readonly requestKind?: GroupVersionKind;
|
|
259
|
+
/** RequestResource is the fully-qualified resource of the original API request (for example, v1.pods). */
|
|
260
|
+
readonly requestResource?: GroupVersionResource;
|
|
261
|
+
/** RequestSubResource is the sub-resource of the original API request, if any (for example, "status" or "scale"). */
|
|
262
|
+
readonly requestSubResource?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and
|
|
265
|
+
* rely on the server to generate the name. If that is the case, this method will return the empty string.
|
|
266
|
+
*/
|
|
267
|
+
readonly name: string;
|
|
268
|
+
/** Namespace is the namespace associated with the request (if any). */
|
|
269
|
+
readonly namespace?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Operation is the operation being performed. This may be different than the operation
|
|
272
|
+
* requested. e.g. a patch can result in either a CREATE or UPDATE Operation.
|
|
273
|
+
*/
|
|
274
|
+
readonly operation: Operation;
|
|
275
|
+
/** UserInfo is information about the requesting user */
|
|
276
|
+
readonly userInfo: {
|
|
277
|
+
/** The name that uniquely identifies this user among all active users. */
|
|
278
|
+
username?: string;
|
|
279
|
+
/**
|
|
280
|
+
* A unique value that identifies this user across time. If this user is deleted
|
|
281
|
+
* and another user by the same name is added, they will have different UIDs.
|
|
282
|
+
*/
|
|
283
|
+
uid?: string;
|
|
284
|
+
/** The names of groups this user is a part of. */
|
|
285
|
+
groups?: string[];
|
|
286
|
+
/** Any additional information provided by the authenticator. */
|
|
287
|
+
extra?: {
|
|
288
|
+
[key: string]: string[];
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
/** Object is the object from the incoming request prior to default values being applied */
|
|
292
|
+
readonly object: T;
|
|
293
|
+
/** OldObject is the existing object. Only populated for UPDATE or DELETE requests. */
|
|
294
|
+
readonly oldObject?: T;
|
|
295
|
+
/** DryRun indicates that modifications will definitely not be persisted for this request. Defaults to false. */
|
|
296
|
+
readonly dryRun?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Options contains the options for the operation being performed.
|
|
299
|
+
* e.g. `meta.k8s.io/v1.DeleteOptions` or `meta.k8s.io/v1.CreateOptions`. This may be
|
|
300
|
+
* different than the options the caller provided. e.g. for a patch request the performed
|
|
301
|
+
* Operation might be a CREATE, in which case the Options will a
|
|
302
|
+
* `meta.k8s.io/v1.CreateOptions` even though the caller provided `meta.k8s.io/v1.PatchOptions`.
|
|
303
|
+
*/
|
|
304
|
+
readonly options?: any;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion
|
|
308
|
+
* to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling
|
|
309
|
+
*/
|
|
310
|
+
export interface GroupVersionResource {
|
|
311
|
+
readonly group: string;
|
|
312
|
+
readonly version: string;
|
|
313
|
+
readonly resource: string;
|
|
314
|
+
}
|
|
208
315
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBA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CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Capability } from "./capability";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ValidateResponse } from "./k8s";
|
|
3
|
+
import { AdmissionRequest } from "./types";
|
|
4
|
+
import { ModuleConfig } from "./module";
|
|
5
|
+
export declare function validateProcessor(config: ModuleConfig, capabilities: Capability[], req: AdmissionRequest, reqMetadata: Record<string, string>): Promise<ValidateResponse[]>;
|
|
4
6
|
//# sourceMappingURL=validate-processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-processor.d.ts","sourceRoot":"","sources":["../../src/lib/validate-processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"validate-processor.d.ts","sourceRoot":"","sources":["../../src/lib/validate-processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,UAAU,EAAE,EAC1B,GAAG,EAAE,gBAAgB,EACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA+D7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KubernetesObject } from "kubernetes-fluent-client";
|
|
2
|
-
import { AdmissionRequest } from "./
|
|
2
|
+
import { AdmissionRequest } from "./types";
|
|
3
3
|
import { ValidateActionResponse } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* The RequestWrapper class provides methods to modify Kubernetes objects in the context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-request.d.ts","sourceRoot":"","sources":["../../src/lib/validate-request.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,
|
|
1
|
+
{"version":3,"file":"validate-request.d.ts","sourceRoot":"","sources":["../../src/lib/validate-request.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,CAAC,SAAS,gBAAgB;;IACzD,GAAG,EAAE,CAAC,CAAC;IAIP;;;OAGG;IACH,IAAI,WAAW,kBAEd;IAED;;;OAGG;IACH,IAAI,OAAO,wBAEV;IAED;;;OAGG;gBACS,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAgBtC;;;;;OAKG;IACH,QAAQ,QAAS,MAAM,aAErB;IAEF;;;;;OAKG;IACH,aAAa,QAAS,MAAM,aAE1B;IAEF;;;;OAIG;IACH,OAAO,QAAO,sBAAsB,CAIlC;IAEF;;;;;;OAMG;IACH,IAAI,mBAAoB,MAAM,eAAe,MAAM,KAAG,sBAAsB,CAM1E;CACH"}
|
|
@@ -14,6 +14,6 @@ export declare function getOrCreateQueue(obj: KubernetesObject): Queue<Kubernete
|
|
|
14
14
|
*
|
|
15
15
|
* @param capabilities The capabilities to load watches for
|
|
16
16
|
*/
|
|
17
|
-
export declare function setupWatch(capabilities: Capability[]): void;
|
|
17
|
+
export declare function setupWatch(capabilities: Capability[], ignoredNamespaces?: string[]): void;
|
|
18
18
|
export declare function logEvent(event: WatchEvent, message?: string, obj?: KubernetesObject): void;
|
|
19
19
|
//# sourceMappingURL=watch-processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-processor.d.ts","sourceRoot":"","sources":["../../src/lib/watch-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,gBAAgB,EAAY,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"watch-processor.d.ts","sourceRoot":"","sources":["../../src/lib/watch-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,gBAAgB,EAAY,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAOhC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,gBAAgB,UAkB7C;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,2BAMrD;AAuBD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAMlF;AAkGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,MAAW,EAAE,GAAG,CAAC,EAAE,gBAAgB,QAOvF"}
|