1
0
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:
Sebastian Malton 2021-11-08 10:18:07 -05:00
parent 7f6464fe2a
commit bc99a5a27a

View File

@ -28,6 +28,7 @@ import { ShellOpenError, ShellSession } from "./shell-session";
import { get } from "lodash";
import { Node, NodesApi } from "../../common/k8s-api/endpoints";
import { KubeJsonApi } from "../../common/k8s-api/kube-json-api";
import logger from "../logger";
export class NodeShellSession extends ShellSession {
ShellType = "node-shell";
@ -67,14 +68,14 @@ export class NodeShellSession extends ShellSession {
const nodeOs = node.getOperatingSystem();
switch (nodeOs) {
default:
logger.warn(`[NODE-SHELL-SESSION]: could not determine node OS, falling back with assumption of linux`);
case "linux":
args.push("sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))");
break;
case "windows":
args.push("powershell");
break;
default:
throw new Error(`Cannot open node shell for ${this.nodeName}: unknown operating sytem ${nodeOs}`);
}
return super.open(shell, args, env);