diff --git a/packages/core/src/main/cluster/manager.ts b/packages/core/src/main/cluster/manager.ts index e49293de8e..d0ef0e1054 100644 --- a/packages/core/src/main/cluster/manager.ts +++ b/packages/core/src/main/cluster/manager.ts @@ -88,7 +88,10 @@ export class ClusterManager { protected updateCatalog(clusters: Cluster[]) { 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); } }