Merge remote-tracking branch 'origin/master' into vue_react_migration

# Conflicts:
#	src/common/cluster-store.ts
#	src/common/cluster-store_spec.ts
This commit is contained in:
Roman committed 2020-07-04 12:50:23 +03:00
commit f9c0c5d825
23 files changed
+258 -161

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { app, remote } from "electron"
import { ensureDirSync, writeFileSync } from "fs-extra"
import * as path from "path"
// Writes kubeconfigs to "embedded" store, i.e. .../Lens/kubeconfigs/
export function writeEmbeddedKubeConfig(clusterId: string, kubeConfig: string): string {
// This can be called from main & renderer
const a = (app || remote.app)
const kubeConfigBase = path.join(a.getPath("userData"), "kubeconfigs")
ensureDirSync(kubeConfigBase)
const kubeConfigFile = path.join(kubeConfigBase, clusterId)
writeFileSync(kubeConfigFile, kubeConfig)
return kubeConfigFile
}