mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Do not make watch requests without resourceVersion (#3089)
* Do not make watch requests without resourceVersion Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com> * Check resource version from given namespace Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
7988f068cb
commit
54eaaefe62
@ -280,7 +280,7 @@ export abstract class KubeObjectStore<T extends KubeObject = any> extends ItemSt
|
|||||||
|
|
||||||
async update(item: T, data: Partial<T>): Promise<T> {
|
async update(item: T, data: Partial<T>): Promise<T> {
|
||||||
const newItem = await item.update<T>(data);
|
const newItem = await item.update<T>(data);
|
||||||
|
|
||||||
ensureObjectSelfLink(this.api, newItem);
|
ensureObjectSelfLink(this.api, newItem);
|
||||||
|
|
||||||
const index = this.items.findIndex(item => item.getId() === newItem.getId());
|
const index = this.items.findIndex(item => item.getId() === newItem.getId());
|
||||||
@ -332,6 +332,10 @@ export abstract class KubeObjectStore<T extends KubeObject = any> extends ItemSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
private watchNamespace(namespace: string, abortController: AbortController) {
|
private watchNamespace(namespace: string, abortController: AbortController) {
|
||||||
|
if (!this.api.getResourceVersion(namespace)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let timedRetry: NodeJS.Timeout;
|
let timedRetry: NodeJS.Timeout;
|
||||||
const watch = () => this.api.watch({
|
const watch = () => this.api.watch({
|
||||||
namespace,
|
namespace,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user