Skip to content

Commit 61fc240

Browse files
committed
Simpler detect_deploy_domain
1 parent 64dce8c commit 61fc240

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

k

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,18 +2317,12 @@ end
23172317

23182318
def detect_deploy_domain(primary_subdomain = "argocd")
23192319
in_argo_repo do
2320-
if File.exist?("platform-applications/cloudflared.yaml")
2321-
begin
2322-
YAML.load_file("platform/cloudflared/config.yaml")
2323-
.fetch("ingress")
2324-
.find { |ingress| ingress["hostname"].start_with?(primary_subdomain) }
2325-
.then { |ingress| ingress["hostname"].split(".").drop(1).join(".") }
2326-
rescue StandardError
2327-
"example.com"
2328-
end
2329-
else
2330-
"example.com"
2331-
end
2320+
YAML.load_file("platform/cloudflared/config.yaml")
2321+
.fetch("ingress")
2322+
.find { |ingress| ingress["hostname"].start_with?(primary_subdomain) }
2323+
.then { |ingress| ingress["hostname"].split(".").drop(1).join(".") }
2324+
rescue StandardError
2325+
"example.com"
23322326
end
23332327
end
23342328

0 commit comments

Comments
 (0)