Skip to content

Commit 65f5712

Browse files
UI: ignore error when list public ips for CKS clusters on Shared network (#8489)
1 parent 0577b0a commit 65f5712

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
@@ -204,7 +204,7 @@ export default {
204204
virtualmachines: [],
205205
vmColumns: [],
206206
networkLoading: false,
207-
network: {},
207+
network: null,
208208
publicIpAddress: null,
209209
currentTab: 'details',
210210
cksSshStartingPort: 2222,
@@ -382,7 +382,27 @@ export default {
382382
this.virtualmachines.map(x => { x.ipaddress = x.nic[0].ipaddress })
383383
this.instanceLoading = false
384384
},
385-
fetchPublicIpAddress () {
385+
fetchNetwork () {
386+
this.networkLoading = true
387+
return new Promise((resolve, reject) => {
388+
api('listNetworks', {
389+
listAll: true,
390+
id: this.resource.networkid
391+
}).then(json => {
392+
const networks = json.listnetworksresponse.network
393+
if (this.arrayHasItems(networks)) {
394+
this.network = networks[0]
395+
}
396+
})
397+
this.networkLoading = false
398+
})
399+
},
400+
async fetchPublicIpAddress () {
401+
await this.fetchNetwork()
402+
if (this.network && this.network.type === 'Shared') {
403+
this.publicIpAddress = null
404+
return
405+
}
386406
this.networkLoading = true
387407
var params = {
388408
listAll: true,

0 commit comments

Comments
 (0)