mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge remote-tracking branch 'origin/master' into eliminate-gst-from-app-paths
This commit is contained in:
56 files changed
+379
-224
No files matched your search
@@ -25,10 +25,9 @@ import { isLinux, isMac, isPublishConfigured, isTestEnv } from "../common/vars";
|
||||
import { delay } from "../common/utils";
|
||||
import { areArgsUpdateAvailableToBackchannel, AutoUpdateChecking, AutoUpdateLogPrefix, AutoUpdateNoUpdateAvailable, broadcastMessage, onceCorrect, UpdateAvailableChannel, UpdateAvailableToBackchannel } from "../common/ipc";
|
||||
import { once } from "lodash";
|
||||
import { ipcMain } from "electron";
|
||||
import { ipcMain, autoUpdater as electronAutoUpdater } from "electron";
|
||||
import { nextUpdateChannel } from "./utils/update-channel";
|
||||
import { UserStore } from "../common/user-store";
|
||||
import { autoUpdater as electronAutoUpdater } from "electron";
|
||||
|
||||
let installVersion: null | string = null;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import * as tempy from "tempy";
|
||||
import tempy from "tempy";
|
||||
import fse from "fs-extra";
|
||||
import * as yaml from "js-yaml";
|
||||
import { promiseExecFile } from "../../common/utils/promise-exec";
|
||||
|
||||
@@ -119,7 +119,9 @@ export class HelmRepoManager extends Singleton {
|
||||
if (typeof parsedConfig === "object" && parsedConfig) {
|
||||
return parsedConfig as HelmRepoConfig;
|
||||
}
|
||||
} catch { }
|
||||
} catch {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
return {
|
||||
repositories: [],
|
||||
|
||||
@@ -101,7 +101,9 @@ export const initIpcMainHandlers = ({ electronMenuItems, directoryForLensLocalSt
|
||||
const localStorageFilePath = path.resolve(directoryForLensLocalStorage, `${cluster.id}.json`);
|
||||
|
||||
await remove(localStorageFilePath);
|
||||
} catch {}
|
||||
} catch {
|
||||
// ignore error
|
||||
}
|
||||
});
|
||||
|
||||
ipcMainHandle(clusterSetDeletingHandler, (event, clusterId: string) => {
|
||||
|
||||
+11
-11
@@ -356,10 +356,10 @@ export class Kubectl {
|
||||
bashScript += `export PATH="${helmPath}:${kubectlPath}:$PATH"\n`;
|
||||
bashScript += "export KUBECONFIG=\"$tempkubeconfig\"\n";
|
||||
|
||||
bashScript += `NO_PROXY=\",\${NO_PROXY:-localhost},\"\n`;
|
||||
bashScript += `NO_PROXY=\"\${NO_PROXY//,localhost,/,}\"\n`;
|
||||
bashScript += `NO_PROXY=\"\${NO_PROXY//,127.0.0.1,/,}\"\n`;
|
||||
bashScript += `NO_PROXY=\"localhost,127.0.0.1\${NO_PROXY%,}\"\n`;
|
||||
bashScript += `NO_PROXY=",\${NO_PROXY:-localhost},"\n`;
|
||||
bashScript += `NO_PROXY="\${NO_PROXY//,localhost,/,}"\n`;
|
||||
bashScript += `NO_PROXY="\${NO_PROXY//,127.0.0.1,/,}"\n`;
|
||||
bashScript += `NO_PROXY="localhost,127.0.0.1\${NO_PROXY%,}"\n`;
|
||||
bashScript += "export NO_PROXY\n";
|
||||
bashScript += "unset tempkubeconfig\n";
|
||||
await fsPromises.writeFile(bashScriptPath, bashScript.toString(), { mode: 0o644 });
|
||||
@@ -377,18 +377,18 @@ export class Kubectl {
|
||||
zshScript += "test -f \"$OLD_ZDOTDIR/.zshrc\" && . \"$OLD_ZDOTDIR/.zshrc\"\n";
|
||||
|
||||
// voodoo to replace any previous occurrences of kubectl path in the PATH
|
||||
zshScript += `kubectlpath=\"${kubectlPath}"\n`;
|
||||
zshScript += `helmpath=\"${helmPath}"\n`;
|
||||
zshScript += `kubectlpath="${kubectlPath}"\n`;
|
||||
zshScript += `helmpath="${helmPath}"\n`;
|
||||
zshScript += "p=\":$kubectlpath:\"\n";
|
||||
zshScript += "d=\":$PATH:\"\n";
|
||||
zshScript += `d=\${d//$p/:}\n`;
|
||||
zshScript += `d=\${d/#:/}\n`;
|
||||
zshScript += `export PATH=\"$helmpath:$kubectlpath:\${d/%:/}\"\n`;
|
||||
zshScript += `export PATH="$helmpath:$kubectlpath:\${d/%:/}"\n`;
|
||||
zshScript += "export KUBECONFIG=\"$tempkubeconfig\"\n";
|
||||
zshScript += `NO_PROXY=\",\${NO_PROXY:-localhost},\"\n`;
|
||||
zshScript += `NO_PROXY=\"\${NO_PROXY//,localhost,/,}\"\n`;
|
||||
zshScript += `NO_PROXY=\"\${NO_PROXY//,127.0.0.1,/,}\"\n`;
|
||||
zshScript += `NO_PROXY=\"localhost,127.0.0.1\${NO_PROXY%,}\"\n`;
|
||||
zshScript += `NO_PROXY=",\${NO_PROXY:-localhost},"\n`;
|
||||
zshScript += `NO_PROXY="\${NO_PROXY//,localhost,/,}"\n`;
|
||||
zshScript += `NO_PROXY="\${NO_PROXY//,127.0.0.1,/,}"\n`;
|
||||
zshScript += `NO_PROXY="localhost,127.0.0.1\${NO_PROXY%,}"\n`;
|
||||
zshScript += "export NO_PROXY\n";
|
||||
zshScript += "unset tempkubeconfig\n";
|
||||
zshScript += "unset OLD_ZDOTDIR\n";
|
||||
|
||||
@@ -25,7 +25,7 @@ import { exec } from "child_process";
|
||||
import fs from "fs-extra";
|
||||
import * as yaml from "js-yaml";
|
||||
import path from "path";
|
||||
import * as tempy from "tempy";
|
||||
import tempy from "tempy";
|
||||
import logger from "./logger";
|
||||
import { appEventBus } from "../common/app-event-bus/event-bus";
|
||||
import { cloneJsonObject } from "../common/utils";
|
||||
|
||||
@@ -73,6 +73,7 @@ export class NodeShellSession extends ShellSession {
|
||||
switch (nodeOs) {
|
||||
default:
|
||||
logger.warn(`[NODE-SHELL-SESSION]: could not determine node OS, falling back with assumption of linux`);
|
||||
// fallthrough
|
||||
case "linux":
|
||||
args.push("sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))");
|
||||
break;
|
||||
|
||||
@@ -134,7 +134,9 @@ export abstract class ShellSession {
|
||||
for (const shellProcess of this.processes.values()) {
|
||||
try {
|
||||
process.kill(shellProcess.pid);
|
||||
} catch {}
|
||||
} catch {
|
||||
// ignore error
|
||||
}
|
||||
}
|
||||
|
||||
this.processes.clear();
|
||||
@@ -212,7 +214,9 @@ export abstract class ShellSession {
|
||||
if (stats.isDirectory()) {
|
||||
return potentialCwd;
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
// ignore error
|
||||
}
|
||||
}
|
||||
|
||||
return "."; // Always valid
|
||||
|
||||
Reference in new issue
Block a user