Update bootstrap detection logic to support bosh local_dns
@@ -18,6 +18,7 @@ def discover_external_ip
<%
cluster_ips = nil
+ node_host = nil
if_link('mysql') do
bootstrap_ip = nil
cluster_ips = link('mysql').instances.map do |instance|
@@ -30,12 +31,14 @@ def discover_external_ip
if_link('arbitrator') do
cluster_ips += link('arbitrator').instances.map { |instance| instance.address }
end
+
+ node_host = link('mysql').instances.detect {|instance| instance.id == spec.id}.address
end.else do
# cluster_ips may contain nil values due to lack of flexibility in spiff
cluster_ips = p('cf_mysql.mysql.cluster_ips').compact
+ node_host = discover_external_ip
end
- node_host = discover_external_ip
if_p('cf_mysql.mysql.advertise_host') do |advertise_host|
node_host = advertise_host
end
