From a7f7ea2473a004c1955046e492d96b51befe1253 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 16 Nov 2020 09:25:52 -0500 Subject: [PATCH] split out ??= for headers Signed-off-by: Sebastian Malton --- src/main/cluster.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/cluster.ts b/src/main/cluster.ts index 19ad9bb528..dfdb2e5d5a 100644 --- a/src/main/cluster.ts +++ b/src/main/cluster.ts @@ -86,7 +86,7 @@ export class Cluster implements ClusterModel, ClusterState { } get version(): string { - return String(this.metadata?.version) || "" + return String(this.metadata?.version) || "" } constructor(model: ClusterModel) { @@ -149,7 +149,7 @@ export class Cluster implements ClusterModel, ClusterState { } @action - async activate(force = false ) { + async activate(force = false) { if (this.activated && !force) { return this.pushState(); } @@ -252,12 +252,12 @@ export class Cluster implements ClusterModel, ClusterState { } protected async k8sRequest(path: string, options: RequestPromiseOptions = {}): Promise { - (options.headers ??= {}).Host = `${this.id}.${new URL(this.kubeProxyUrl).host}` // required in ClusterManager.getClusterForRequest() + options.headers ??= {} options.json ??= true options.timeout ??= 30000 + options.headers.Host = `${this.id}.${new URL(this.kubeProxyUrl).host}` // required in ClusterManager.getClusterForRequest() - const apiUrl = this.kubeProxyUrl + path; - return request(apiUrl, options) + return request(this.kubeProxyUrl + path, options) } getMetrics(prometheusPath: string, queryParams: IMetricsReqParams & { query: string }) {