Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

add app-dns to secondary haproxy gears #4631

Merged
merged 1 commit into from Feb 1, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions node/lib/openshift-origin-node/model/v2_cart_model.rb
Expand Up @@ -1027,6 +1027,7 @@ def connect_frontend(cartridge, rebuild=false)
frontend = FrontendHttpServer.new(@container)
gear_env = ::OpenShift::Runtime::Utils::Environ.for_gear(@container.container_dir)
web_proxy_cart = web_proxy
app_dns = gear_env["OPENSHIFT_APP_DNS"]

output = ""
begin
Expand Down Expand Up @@ -1063,6 +1064,15 @@ def connect_frontend(cartridge, rebuild=false)
logger.info("Connecting frontend mapping for #{@container.uuid}/#{cartridge.name}: "\
"[#{mapping.frontend}] => [#{backend_uri}] with options: #{mapping.options}")
reported_urls = frontend.connect(mapping.frontend, backend_uri, options)
if cartridge.web_proxy?
gear_fqdn = frontend.fqdn
if gear_fqdn != app_dns
# secondary web-proxy gear
frontend.fqdn = app_dns
reported_urls += frontend.connect(mapping.frontend, backend_uri, options)
frontend.fqdn = gear_fqdn
end
end
if reported_urls
reported_urls.each do |url|
outstr = "Cartridge #{cartridge.name} exposed URL #{url}"
Expand Down