From 3f2d9128164d0b6b60595bf9fa19fdaecdd3387c Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Tue, 16 Feb 2021 14:49:51 +0200 Subject: [PATCH] Register existing store with new apiBase when re-registering Kube API (#2157) * Update store key after api's apiBase change Signed-off-by: Lauri Nevala * Re-register existing store when registering API Signed-off-by: Lauri Nevala * Revert kube-api changes Signed-off-by: Lauri Nevala --- src/renderer/api/api-manager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/api/api-manager.ts b/src/renderer/api/api-manager.ts index a802851f65..90e63f692b 100644 --- a/src/renderer/api/api-manager.ts +++ b/src/renderer/api/api-manager.ts @@ -23,6 +23,12 @@ export class ApiManager { registerApi(apiBase: string, api: KubeApi) { if (!this.apis.has(apiBase)) { + this.stores.forEach((store) => { + if(store.api === api) { + this.stores.set(apiBase, store); + } + }); + this.apis.set(apiBase, api); } }