Skip to content

Commit

Permalink
frontend: fix calling /parseKubeConfig
Browse files Browse the repository at this point in the history
This endpoint is used only for parsing stateless clusters kubeconfig.
So, it should only be called when dynamic clusters is enabled. When the
flag was disabled the endpoint was unavailable. This fixes calling the
endpoint unnecessarily when dynamic cluster is disabled.

Signed-off-by: Kautilya Tripathi <[email protected]>
  • Loading branch information
knrt10 committed Jan 30, 2024
1 parent d0aea57 commit d0167f8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/App/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,18 @@ export default function Layout({}: LayoutProps) {
dispatch(setConfig(configToStore));
}
}

/**
* Fetches the stateless cluster config from the indexDB and then sends the backend to parse it
* only if the stateless cluster config is enabled in the backend.
*/
if (config?.isDynamicClusterEnabled) {
fetchStatelessClusterKubeConfigs(config.statelessClusters);
}
})
.catch(err => {
console.error('Error getting config:', err);
});

fetchStatelessClusterKubeConfigs(dispatch);
};

return (
Expand Down

0 comments on commit d0167f8

Please sign in to comment.