1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make forCluster() to consume clusterId as arg

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-12-08 15:43:19 +03:00
parent 4b22481ea9
commit 719761c0fd
2 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ export interface KubeJsonApiError extends JsonApiError {
}
export class KubeJsonApi extends JsonApi<KubeJsonApiData> {
static forCluster(cluster: Cluster): KubeJsonApi {
static forCluster(clusterId: string): KubeJsonApi {
const port = LensProxy.getInstance().port;
return new this({
@ -82,7 +82,7 @@ export class KubeJsonApi extends JsonApi<KubeJsonApiData> {
debug: isDebugging,
}, {
headers: {
"Host": `${cluster.id}.localhost:${port}`,
"Host": `${clusterId}.localhost:${port}`,
},
});
}

View File

@ -64,7 +64,7 @@ export class NodeShellSession extends ShellSession {
const args = ["exec", "-i", "-t", "-n", "kube-system", this.podName, "--"];
const nodeApi = new NodesApi({
objectConstructor: Node,
request: KubeJsonApi.forCluster(this.cluster),
request: KubeJsonApi.forCluster(this.cluster.id),
});
const node = await nodeApi.get({ name: this.nodeName });
const nodeOs = node.getOperatingSystem();