Sort cluster list by label column

Signed-off-by: gitstart <bot@gitstart.com>
This commit is contained in:
gitstart committed 2023-09-14 15:36:25 +00:00
1 parent f1a960fd78
commit 839a76e639
1 file changed
+4 -1
+4 -1
View File
@@ -88,7 +88,10 @@ export class ClusterManager {
protected updateCatalog(clusters: Cluster[]) { protected updateCatalog(clusters: Cluster[]) {
this.dependencies.logger.debug("[CLUSTER-MANAGER]: updating catalog from cluster store"); this.dependencies.logger.debug("[CLUSTER-MANAGER]: updating catalog from cluster store");
for (const cluster of clusters) { // Sort clusters based on the path of the kubeconfig file
const sortedClusters = [...clusters].sort((a, b) => a.kubeConfigPath.get().localeCompare(b.kubeConfigPath.get()));
for (const cluster of sortedClusters) {
this.updateEntityFromCluster(cluster); this.updateEntityFromCluster(cluster);
} }
} }