mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cluster-store refactoring -- part 1
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
d4bbaf4f34
commit
afb54694f4
14 files changed
+168
-461
No files matched your search
@@ -1,21 +1,21 @@
|
||||
// Move embedded kubeconfig into separate file and add reference to it to cluster settings
|
||||
|
||||
import path from "path"
|
||||
import { app } from "electron"
|
||||
import { app, remote } from "electron"
|
||||
import { migration } from "../migration-wrapper";
|
||||
import { ensureDirSync } from "fs-extra"
|
||||
import { KubeConfig } from "@kubernetes/client-node";
|
||||
import { writeEmbeddedKubeConfig } from "../../common/utils/kubeconfig"
|
||||
import { ClusterBaseInfo } from "../../main/cluster";
|
||||
import { ClusterModel } from "../../common/cluster-store";
|
||||
|
||||
export default migration({
|
||||
version: "3.6.0-beta.1",
|
||||
run(store, log: (...args: any[]) => void) {
|
||||
const migratingClusters: ClusterBaseInfo[] = []
|
||||
const migratingClusters: ClusterModel[] = []
|
||||
|
||||
const kubeConfigBase = path.join(app.getPath("userData"), "kubeconfigs")
|
||||
const kubeConfigBase = path.join((app || remote.app).getPath("userData"), "kubeconfigs")
|
||||
ensureDirSync(kubeConfigBase)
|
||||
const storedClusters: ClusterBaseInfo[] = store.get("clusters")
|
||||
const storedClusters: ClusterModel[] = store.get("clusters")
|
||||
if (!storedClusters) return
|
||||
|
||||
log("Number of clusters to migrate: ", storedClusters.length)
|
||||
|
||||
Reference in new issue
Block a user