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:
parent
4b22481ea9
commit
719761c0fd
@ -73,7 +73,7 @@ export interface KubeJsonApiError extends JsonApiError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class KubeJsonApi extends JsonApi<KubeJsonApiData> {
|
export class KubeJsonApi extends JsonApi<KubeJsonApiData> {
|
||||||
static forCluster(cluster: Cluster): KubeJsonApi {
|
static forCluster(clusterId: string): KubeJsonApi {
|
||||||
const port = LensProxy.getInstance().port;
|
const port = LensProxy.getInstance().port;
|
||||||
|
|
||||||
return new this({
|
return new this({
|
||||||
@ -82,7 +82,7 @@ export class KubeJsonApi extends JsonApi<KubeJsonApiData> {
|
|||||||
debug: isDebugging,
|
debug: isDebugging,
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Host": `${cluster.id}.localhost:${port}`,
|
"Host": `${clusterId}.localhost:${port}`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export class NodeShellSession extends ShellSession {
|
|||||||
const args = ["exec", "-i", "-t", "-n", "kube-system", this.podName, "--"];
|
const args = ["exec", "-i", "-t", "-n", "kube-system", this.podName, "--"];
|
||||||
const nodeApi = new NodesApi({
|
const nodeApi = new NodesApi({
|
||||||
objectConstructor: Node,
|
objectConstructor: Node,
|
||||||
request: KubeJsonApi.forCluster(this.cluster),
|
request: KubeJsonApi.forCluster(this.cluster.id),
|
||||||
});
|
});
|
||||||
const node = await nodeApi.get({ name: this.nodeName });
|
const node = await nodeApi.get({ name: this.nodeName });
|
||||||
const nodeOs = node.getOperatingSystem();
|
const nodeOs = node.getOperatingSystem();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user