|
| 1 | +diff --git a/dist/cache.js b/dist/cache.js |
| 2 | +index d58eea314385e5b5dea1f5d9104ba9446deb6364..3554cef6ba6cd1c8186bf0fa880eab2c5a4f3289 100644 |
| 3 | +--- a/dist/cache.js |
| 4 | ++++ b/dist/cache.js |
| 5 | +@@ -1,11 +1,12 @@ |
| 6 | + import { ADD, CHANGE, CONNECT, DELETE, ERROR, UPDATE, } from './informer.js'; |
| 7 | + import { ObjectSerializer } from './serializer.js'; |
| 8 | + export class ListWatch { |
| 9 | +- constructor(path, watch, listFn, autoStart = true, labelSelector) { |
| 10 | ++ constructor(path, watch, listFn, autoStart = true, labelSelector, fieldSelector) { |
| 11 | + this.path = path; |
| 12 | + this.watch = watch; |
| 13 | + this.listFn = listFn; |
| 14 | + this.labelSelector = labelSelector; |
| 15 | ++ this.fieldSelector = fieldSelector; |
| 16 | + this.objects = new Map(); |
| 17 | + this.indexCache = {}; |
| 18 | + this.callbackCache = {}; |
| 19 | +@@ -113,6 +114,9 @@ export class ListWatch { |
| 20 | + if (this.labelSelector !== undefined) { |
| 21 | + queryParams.labelSelector = ObjectSerializer.serialize(this.labelSelector, 'string'); |
| 22 | + } |
| 23 | ++ if (this.fieldSelector !== undefined) { |
| 24 | ++ queryParams.fieldSelector = ObjectSerializer.serialize(this.fieldSelector, 'string'); |
| 25 | ++ } |
| 26 | + this.request = await this.watch.watch(this.path, queryParams, this.watchHandler.bind(this), this.doneHandler.bind(this)); |
| 27 | + } |
| 28 | + addOrUpdateItems(items) { |
| 29 | +diff --git a/dist/informer.d.ts b/dist/informer.d.ts |
| 30 | +index 903de9078b4b11a5fd933802be042e1a4f966079..4177cf12b5705a373def8f22d235416cd82114c6 100644 |
| 31 | +--- a/dist/informer.d.ts |
| 32 | ++++ b/dist/informer.d.ts |
| 33 | +@@ -16,4 +16,4 @@ export interface Informer<T extends KubernetesObject> { |
| 34 | + start(): Promise<void>; |
| 35 | + stop(): Promise<void>; |
| 36 | + } |
| 37 | +-export declare function makeInformer<T extends KubernetesObject>(kubeconfig: KubeConfig, path: string, listPromiseFn: ListPromise<T>, labelSelector?: string): Informer<T>; |
| 38 | ++export declare function makeInformer<T extends KubernetesObject>(kubeconfig: KubeConfig, path: string, listPromiseFn: ListPromise<T>, labelSelector?: string, fieldSelector?: string): Informer<T>; |
| 39 | +diff --git a/dist/informer.js b/dist/informer.js |
| 40 | +index 0dc471fc3e2d8e653a4c4795211b4774563d2d14..ae33a4357308b77bfb4e7588807e9ac0d7643ba3 100644 |
| 41 | +--- a/dist/informer.js |
| 42 | ++++ b/dist/informer.js |
| 43 | +@@ -9,8 +9,8 @@ export const DELETE = 'delete'; |
| 44 | + export const CONNECT = 'connect'; |
| 45 | + // This is issued when there is an error |
| 46 | + export const ERROR = 'error'; |
| 47 | +-export function makeInformer(kubeconfig, path, listPromiseFn, labelSelector) { |
| 48 | ++export function makeInformer(kubeconfig, path, listPromiseFn, labelSelector, fieldSelector) { |
| 49 | + const watch = new Watch(kubeconfig); |
| 50 | +- return new ListWatch(path, watch, listPromiseFn, false, labelSelector); |
| 51 | ++ return new ListWatch(path, watch, listPromiseFn, false, labelSelector, fieldSelector); |
| 52 | + } |
| 53 | + //# sourceMappingURL=informer.js.map |
0 commit comments