You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2024/01/16 01:21:10 UTC

(cloudstack) 01/01: NSX,UI: Deduplicate network list when creating kubernetes clusters

This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch nsx-k8s-network-list-dedup
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 818ef2b2df96e92fb98dfd440d48f71c3c310571
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Mon Jan 15 20:21:01 2024 -0500

    NSX,UI: Deduplicate network list when creating kubernetes clusters
---
 ui/src/views/compute/CreateKubernetesCluster.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/src/views/compute/CreateKubernetesCluster.vue b/ui/src/views/compute/CreateKubernetesCluster.vue
index 1240531ddd7..eb1c6c0d2b9 100644
--- a/ui/src/views/compute/CreateKubernetesCluster.vue
+++ b/ui/src/views/compute/CreateKubernetesCluster.vue
@@ -421,7 +421,8 @@ export default {
         var listNetworks = json.listnetworksresponse.network
         if (this.arrayHasItems(listNetworks)) {
           listNetworks = listNetworks.filter(n => n.type !== 'L2')
-          this.networks = this.networks.concat(listNetworks)
+          var ids = new Set(this.networks.map(n => n.id))
+          this.networks = [...this.networks, ...listNetworks.filter(n => !ids.has(n.id))]
         }
       }).finally(() => {
         this.networkLoading = false