Skip to content

Commit

Permalink
Use domain provided by pool's dns_config
Browse files Browse the repository at this point in the history
debug open socket
  • Loading branch information
yachub committed Feb 15, 2023
1 parent d436dce commit 1f54e37
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/vmpooler/providers/gce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ def machine_type(pool_name)
return provider_config['machine_type'] if provider_config['machine_type']
end

def domain
provider_config['domain']
end

def dns_zone_resource_name
provider_config['dns_zone_resource_name']
def domain(pool_name)
dns_plugin_name = pool_config(pool_name)['dns_plugin']
return dns_config(dns_plugin_name)
end

# Base methods that are implemented:
Expand Down Expand Up @@ -191,7 +188,7 @@ def create_vm(pool_name, new_vmname)
boot: true,
initialize_params: init_params
)
append_domain = domain || global_config[:config]['domain']
append_domain = domain(pool_name)
fqdn = "#{new_vmname}.#{append_domain}" if append_domain

# Assume all pool config is valid i.e. not missing
Expand Down Expand Up @@ -468,7 +465,8 @@ def destroy_vm(pool_name, vm_name)
def vm_ready?(_pool_name, vm_name)
begin
# TODO: we could use a healthcheck resource attached to instance
open_socket(vm_name, domain || global_config[:config]['domain'])
domain = domain(_pool_name)
open_socket(vm_name, domain)
rescue StandardError => _e
return false
end
Expand Down

0 comments on commit 1f54e37

Please sign in to comment.