Skip to content

Commit

Permalink
Simpler detect_deploy_domain
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Oct 23, 2024
1 parent 64dce8c commit 61fc240
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions k
Original file line number Diff line number Diff line change
Expand Up @@ -2317,18 +2317,12 @@ end

def detect_deploy_domain(primary_subdomain = "argocd")
in_argo_repo do
if File.exist?("platform-applications/cloudflared.yaml")
begin
YAML.load_file("platform/cloudflared/config.yaml")
.fetch("ingress")
.find { |ingress| ingress["hostname"].start_with?(primary_subdomain) }
.then { |ingress| ingress["hostname"].split(".").drop(1).join(".") }
rescue StandardError
"example.com"
end
else
"example.com"
end
YAML.load_file("platform/cloudflared/config.yaml")
.fetch("ingress")
.find { |ingress| ingress["hostname"].start_with?(primary_subdomain) }
.then { |ingress| ingress["hostname"].split(".").drop(1).join(".") }
rescue StandardError
"example.com"
end
end

Expand Down

0 comments on commit 61fc240

Please sign in to comment.