Skip to content

Commit 80adf5e

Browse files
committed
Merge release branch 4.18 to 4.19
* 4.18: UI: ignore error when list public ips for CKS clusters on Shared network (#8489)
2 parents 0de469a + 65f5712 commit 80adf5e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

ui/src/views/compute/KubernetesServiceTab.vue

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default {
205205
virtualmachines: [],
206206
vmColumns: [],
207207
networkLoading: false,
208-
network: {},
208+
network: null,
209209
publicIpAddress: null,
210210
currentTab: 'details',
211211
cksSshStartingPort: 2222,
@@ -386,7 +386,27 @@ export default {
386386
this.virtualmachines.map(x => { x.ipaddress = x.nic[0].ipaddress })
387387
this.instanceLoading = false
388388
},
389-
fetchPublicIpAddress () {
389+
fetchNetwork () {
390+
this.networkLoading = true
391+
return new Promise((resolve, reject) => {
392+
api('listNetworks', {
393+
listAll: true,
394+
id: this.resource.networkid
395+
}).then(json => {
396+
const networks = json.listnetworksresponse.network
397+
if (this.arrayHasItems(networks)) {
398+
this.network = networks[0]
399+
}
400+
})
401+
this.networkLoading = false
402+
})
403+
},
404+
async fetchPublicIpAddress () {
405+
await this.fetchNetwork()
406+
if (this.network && this.network.type === 'Shared') {
407+
this.publicIpAddress = null
408+
return
409+
}
390410
this.networkLoading = true
391411
var params = {
392412
listAll: true,

0 commit comments

Comments
 (0)