You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/10/20 10:35:51 UTC

[cloudstack-primate] branch master updated: kubernetesservicetab: Selecting the right ip (#800)

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

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new 79fa40f  kubernetesservicetab: Selecting the right ip (#800)
79fa40f is described below

commit 79fa40fe2fdbbab7cd534bb32c687d936688f5c5
Author: davidjumani <dj...@gmail.com>
AuthorDate: Tue Oct 20 16:05:43 2020 +0530

    kubernetesservicetab: Selecting the right ip (#800)
---
 src/views/compute/KubernetesServiceTab.vue | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/views/compute/KubernetesServiceTab.vue b/src/views/compute/KubernetesServiceTab.vue
index 869dc03..d78775e 100644
--- a/src/views/compute/KubernetesServiceTab.vue
+++ b/src/views/compute/KubernetesServiceTab.vue
@@ -108,13 +108,13 @@
           </template>
         </a-table>
       </a-tab-pane>
-      <a-tab-pane :tab="$t('label.firewall')" key="firewall">
+      <a-tab-pane :tab="$t('label.firewall')" key="firewall" v-if="publicIpAddress">
         <FirewallRules :resource="this.publicIpAddress" :loading="this.networkLoading" />
       </a-tab-pane>
-      <a-tab-pane :tab="$t('label.portforwarding')" key="portforwarding">
+      <a-tab-pane :tab="$t('label.portforwarding')" key="portforwarding" v-if="publicIpAddress">
         <PortForwarding :resource="this.publicIpAddress" :loading="this.networkLoading" />
       </a-tab-pane>
-      <a-tab-pane :tab="$t('label.loadbalancing')" key="loadbalancing">
+      <a-tab-pane :tab="$t('label.loadbalancing')" key="loadbalancing" v-if="publicIpAddress">
         <LoadBalancing :resource="this.publicIpAddress" :loading="this.networkLoading" />
       </a-tab-pane>
     </a-tabs>
@@ -327,14 +327,15 @@ export default {
           this.resource.projectid !== '') {
           params.projectid = this.resource.projectid
         }
-        if (this.isValidValueForKey(this.resource, 'associatednetworkid')) {
-          params.associatednetworkid = this.resource.associatednetworkid
+        if (this.isValidValueForKey(this.resource, 'networkid')) {
+          params.associatednetworkid = this.resource.networkid
         }
       }
       api('listPublicIpAddresses', params).then(json => {
-        const ips = json.listpublicipaddressesresponse.publicipaddress
+        let ips = json.listpublicipaddressesresponse.publicipaddress
         if (this.arrayHasItems(ips)) {
-          this.publicIpAddress = ips[0]
+          ips = ips.filter(x => x.issourcenat)
+          this.publicIpAddress = ips.length > 0 ? ips[0] : null
         }
       }).catch(error => {
         this.$notifyError(error)