From 07b6de314b7dd0c3be9087af13dd257dd79e7f04 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 10 Jan 2024 11:00:26 +0100 Subject: [PATCH 1/3] UI: ignore error when list public ips for CKS clusters --- ui/src/views/compute/KubernetesServiceTab.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/views/compute/KubernetesServiceTab.vue b/ui/src/views/compute/KubernetesServiceTab.vue index 96a99586db91..0fd3798d42dd 100644 --- a/ui/src/views/compute/KubernetesServiceTab.vue +++ b/ui/src/views/compute/KubernetesServiceTab.vue @@ -403,8 +403,8 @@ export default { ips = ips.filter(x => x.issourcenat) this.publicIpAddress = ips.length > 0 ? ips[0] : null } - }).catch(error => { - this.$notifyError(error) + }).catch(() => { + this.publicIpAddress = null }).finally(() => { this.networkLoading = false }) From 6ae57f391c4456b470bb126a0bf54b40c59a95a3 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 18 Apr 2024 10:36:20 +0200 Subject: [PATCH 2/3] Revert "UI: ignore error when list public ips for CKS clusters" This reverts commit 07b6de314b7dd0c3be9087af13dd257dd79e7f04. --- ui/src/views/compute/KubernetesServiceTab.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/views/compute/KubernetesServiceTab.vue b/ui/src/views/compute/KubernetesServiceTab.vue index 0fd3798d42dd..96a99586db91 100644 --- a/ui/src/views/compute/KubernetesServiceTab.vue +++ b/ui/src/views/compute/KubernetesServiceTab.vue @@ -403,8 +403,8 @@ export default { ips = ips.filter(x => x.issourcenat) this.publicIpAddress = ips.length > 0 ? ips[0] : null } - }).catch(() => { - this.publicIpAddress = null + }).catch(error => { + this.$notifyError(error) }).finally(() => { this.networkLoading = false }) From 4b594419e91fa19683ce43e1af36c0be5417bfbd Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 18 Apr 2024 10:36:34 +0200 Subject: [PATCH 3/3] Update 8489 UI: ignore Shared network when fetch public IPs for CKS --- ui/src/views/compute/KubernetesServiceTab.vue | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ui/src/views/compute/KubernetesServiceTab.vue b/ui/src/views/compute/KubernetesServiceTab.vue index 96a99586db91..de5617cfcf10 100644 --- a/ui/src/views/compute/KubernetesServiceTab.vue +++ b/ui/src/views/compute/KubernetesServiceTab.vue @@ -204,7 +204,7 @@ export default { virtualmachines: [], vmColumns: [], networkLoading: false, - network: {}, + network: null, publicIpAddress: null, currentTab: 'details', cksSshStartingPort: 2222, @@ -382,7 +382,27 @@ export default { this.virtualmachines.map(x => { x.ipaddress = x.nic[0].ipaddress }) this.instanceLoading = false }, - fetchPublicIpAddress () { + fetchNetwork () { + this.networkLoading = true + return new Promise((resolve, reject) => { + api('listNetworks', { + listAll: true, + id: this.resource.networkid + }).then(json => { + const networks = json.listnetworksresponse.network + if (this.arrayHasItems(networks)) { + this.network = networks[0] + } + }) + this.networkLoading = false + }) + }, + async fetchPublicIpAddress () { + await this.fetchNetwork() + if (this.network && this.network.type === 'Shared') { + this.publicIpAddress = null + return + } this.networkLoading = true var params = { listAll: true,