Make forCluster() to consume clusterId as arg

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

No files matched your search

+2 -2
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}`,
},
});
}
+1 -1
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();