default garden/baggageclaim addr to forwarded addr
otherwise it falls back on the instance's ip, which won't be correct as
it's often set to listen on 127.0.0.1 when forwarding
@@ -36,6 +36,12 @@ chown -R vcap:vcap $LOG_DIR
garden_addr = addr
end
+ if garden_addr.empty?
+ if_p("garden.forward_address") do |addr|
+ garden_addr = addr
+ end
+ end
+
if garden_addr.empty?
if_link("garden") do |garden|
instance = garden.instances.find { |i| i.id == spec.id }
@@ -56,6 +62,12 @@ chown -R vcap:vcap $LOG_DIR
baggageclaim_url = url
end
+ if baggageclaim_url.empty?
+ if_p("baggageclaim.forward_address") do |addr|
+ baggageclaim_url = "http://#{addr}"
+ end
+ end
+
if baggageclaim_url.empty?
if_link("baggageclaim") do |baggageclaim|
instance = baggageclaim.instances.find { |i| i.id == spec.id }
