mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update @kubernetes/client-node to 0.11.1 (#278)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
e7511a41ec
commit
01e2ef50b1
6 files changed
+16
-40
No files matched your search
+1
-1
@@ -62,7 +62,7 @@ export abstract class Feature {
|
||||
const result = await client.deleteNamespace("lens-metrics", 'false', undefined, undefined, undefined, "Foreground");
|
||||
const nsVersion = result.body.metadata.resourceVersion;
|
||||
const nsWatch = new Watch(kc);
|
||||
const req = nsWatch.watch('/api/v1/namespaces', {resourceVersion: nsVersion, fieldSelector: "metadata.name=lens-metrics"},
|
||||
const req = await nsWatch.watch('/api/v1/namespaces', {resourceVersion: nsVersion, fieldSelector: "metadata.name=lens-metrics"},
|
||||
(type, obj) => {
|
||||
if(type === 'DELETED') {
|
||||
logger.debug(`namespace ${name} finally gone`)
|
||||
|
||||
@@ -101,11 +101,11 @@ export class NodeShellSession extends ShellSession {
|
||||
}
|
||||
|
||||
protected waitForRunningPod(podId: string) {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
return new Promise<boolean>(async (resolve, reject) => {
|
||||
const kc = this.getKubeConfig();
|
||||
const watch = new k8s.Watch(kc);
|
||||
|
||||
const req = watch.watch(`/api/v1/namespaces/kube-system/pods`, {},
|
||||
const req = await watch.watch(`/api/v1/namespaces/kube-system/pods`, {},
|
||||
// callback is called for each received object.
|
||||
(_type, obj) => {
|
||||
if (obj.metadata.name == podId && obj.status.phase === "Running") {
|
||||
|
||||
@@ -19,7 +19,7 @@ class ApiWatcher {
|
||||
this.response = response
|
||||
}
|
||||
|
||||
public start() {
|
||||
public async start() {
|
||||
if (this.processor) {
|
||||
clearInterval(this.processor)
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class ApiWatcher {
|
||||
events.map(event => this.sendEvent(event))
|
||||
this.response.flushHeaders()
|
||||
}, 50)
|
||||
this.watchRequest = this.watch.watch(this.apiUrl, {}, this.watchHandler.bind(this), this.doneHandler.bind(this))
|
||||
this.watchRequest = await this.watch.watch(this.apiUrl, {}, this.watchHandler.bind(this), this.doneHandler.bind(this))
|
||||
}
|
||||
|
||||
public stop() {
|
||||
|
||||
Reference in new issue
Block a user