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 <lauri.nevala@gmail.com>

* Re-register existing store when registering API

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>

* Revert kube-api changes

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2021-02-16 14:49:51 +02:00
1 parent 1e5d682b9b
commit 3f2d912816
1 file changed
+6
+6
View File
@@ -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);
}
}