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 }) {