Browse Source

re-display URLs (#3208)

Feroze Mohideen 2 years ago
parent
commit
92a7f7e018

+ 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) {
                 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++;
-                matchedWebHost = values.ingress.porter_hosts[0];
             }
         }
 
+        // if multiple web services have a subdomain, return nothing
         if (matchedWebCount > 1) {
             return "";
         }