Feroze Mohideen пре 2 година
родитељ
комит
92a7f7e018
1 измењених фајлова са 9 додато и 6 уклоњено
  1. 9 6
      dashboard/src/main/home/app-dashboard/new-app-flow/serviceTypes.ts

+ 9 - 6
dashboard/src/main/home/app-dashboard/new-app-flow/serviceTypes.ts

@@ -493,16 +493,19 @@ export const Service = {
             if (values == null || values.ingress == null || !values.ingress.enabled) {
             if (values == null || values.ingress == null || !values.ingress.enabled) {
                 continue;
                 continue;
             }
             }
-            if (values.ingress.custom_domain && values.ingress.hosts?.length > 0) {
-                matchedWebCount++;
-                matchedWebHost = values.ingress.hosts[0];
-            }
-            if (values.ingress.porter_hosts?.length > 0) {
+            if (values.ingress.porter_hosts?.length > 0 || (values.ingress.custom_domain && values.ingress.hosts?.length > 0)) {
+                if (values.ingress.custom_domain && values.ingress.hosts?.length > 0) {
+                    // if they have a custom domain, use that
+                    matchedWebHost = values.ingress.hosts[0];
+                } else {
+                    // otherwise, use their porter domain
+                    matchedWebHost = values.ingress.porter_hosts[0];
+                }
                 matchedWebCount++;
                 matchedWebCount++;
-                matchedWebHost = values.ingress.porter_hosts[0];
             }
             }
         }
         }
 
 
+        // if multiple web services have a subdomain, return nothing
         if (matchedWebCount > 1) {
         if (matchedWebCount > 1) {
             return "";
             return "";
         }
         }