Skip to content

Commit 19bbec4

Browse files
authored
NSX,UI: Deduplicate network list when creating kubernetes clusters (#8513)
1 parent 2b05dd9 commit 19bbec4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/views/compute/CreateKubernetesCluster.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ export default {
421421
var listNetworks = json.listnetworksresponse.network
422422
if (this.arrayHasItems(listNetworks)) {
423423
listNetworks = listNetworks.filter(n => n.type !== 'L2')
424-
this.networks = this.networks.concat(listNetworks)
424+
var ids = new Set(this.networks.map(n => n.id))
425+
this.networks = [...this.networks, ...listNetworks.filter(n => !ids.has(n.id))]
425426
}
426427
}).finally(() => {
427428
this.networkLoading = false

0 commit comments

Comments
 (0)