1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Sort cluster list by label column

Signed-off-by: gitstart <bot@gitstart.com>
This commit is contained in:
gitstart 2023-09-14 15:36:25 +00:00
parent f1a960fd78
commit 839a76e639
No known key found for this signature in database
GPG Key ID: 1029536458B930CC

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);
} }
} }