Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2020-07-03 11:51:19 +03:00
1 parent fc0632a204
commit 9089bfbc01
3 files changed
+6 -3

No files matched your search

+1
View File
@@ -46,6 +46,7 @@ describe("for an empty config", () => {
clusterStore.storeCluster(cluster);
const storedCluster = clusterStore.getCluster(cluster.id);
expect(storedCluster.kubeConfigPath).toBe(cluster.kubeConfigPath)
expect(storedCluster.contextName).toBe(cluster.contextName)
expect(storedCluster.preferences.icon).toBe(cluster.preferences.icon)
expect(storedCluster.preferences.terminalCWD).toBe(cluster.preferences.terminalCWD)
expect(storedCluster.id).toBe(cluster.id)
+1 -1
View File
@@ -35,7 +35,7 @@ export class ContextHandler {
this.id = cluster.id
this.cluster = cluster
this.clusterUrl = url.parse(cluster.apiUrl) //url.parse(kc.getCurrentCluster().server)
this.clusterUrl = url.parse(cluster.apiUrl)
this.contextName = cluster.contextName;
this.defaultNamespace = kc.getContextObject(cluster.contextName).namespace
this.url = `http://${this.id}.localhost:${cluster.port}/`
+4 -2
View File
@@ -16,8 +16,7 @@ export function migration(store: any) {
console.log("num clusters to migrate: ", storedClusters.length)
for (const cluster of storedClusters ) {
// TODO Should probably guard this, not to make the whole migration fail if one cluster fails!?
try {
// take the embedded kubeconfig and dump it into a file
const kubeConfigFile = writeEmbeddedKubeConfig(cluster.id, cluster.kubeConfig)
cluster.kubeConfigPath = kubeConfigFile
@@ -28,6 +27,9 @@ export function migration(store: any) {
delete cluster.kubeConfig
clusters.push(cluster)
} catch(error) {
console.error("failed to migrate kubeconfig for cluster:", cluster.id)
}
}
// "overwrite" the cluster configs