mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add comment about linux fallback
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
7f6464fe2a
commit
bc99a5a27a
@ -28,6 +28,7 @@ import { ShellOpenError, ShellSession } from "./shell-session";
|
|||||||
import { get } from "lodash";
|
import { get } from "lodash";
|
||||||
import { Node, NodesApi } from "../../common/k8s-api/endpoints";
|
import { Node, NodesApi } from "../../common/k8s-api/endpoints";
|
||||||
import { KubeJsonApi } from "../../common/k8s-api/kube-json-api";
|
import { KubeJsonApi } from "../../common/k8s-api/kube-json-api";
|
||||||
|
import logger from "../logger";
|
||||||
|
|
||||||
export class NodeShellSession extends ShellSession {
|
export class NodeShellSession extends ShellSession {
|
||||||
ShellType = "node-shell";
|
ShellType = "node-shell";
|
||||||
@ -67,14 +68,14 @@ export class NodeShellSession extends ShellSession {
|
|||||||
const nodeOs = node.getOperatingSystem();
|
const nodeOs = node.getOperatingSystem();
|
||||||
|
|
||||||
switch (nodeOs) {
|
switch (nodeOs) {
|
||||||
|
default:
|
||||||
|
logger.warn(`[NODE-SHELL-SESSION]: could not determine node OS, falling back with assumption of linux`);
|
||||||
case "linux":
|
case "linux":
|
||||||
args.push("sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))");
|
args.push("sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))");
|
||||||
break;
|
break;
|
||||||
case "windows":
|
case "windows":
|
||||||
args.push("powershell");
|
args.push("powershell");
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw new Error(`Cannot open node shell for ${this.nodeName}: unknown operating sytem ${nodeOs}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.open(shell, args, env);
|
return super.open(shell, args, env);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user