Class: Kitchen::Pulumi::SystemHostsResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/pulumi/system_hosts_resolver.rb

Overview

SystemHostsResolver is the class of objects which resolve for systems the hosts which are contained in outputs.

Instance Method Summary collapse

Instance Method Details

#resolve(hosts_output:, system:) ⇒ Object

resolve resolves the hosts.

Parameters:

  • hosts_output (::String)

    the name of the Pulumi output which has a value of hosts for the system.

  • system (::Kitchen::Pulumi::System)

    the system.

Raises:


18
19
20
21
22
# File 'lib/kitchen/pulumi/system_hosts_resolver.rb', line 18

def resolve(hosts_output:, system:)
  system.add_hosts hosts: @outputs.fetch(hosts_output)
rescue ::KeyError => e
  raise ::Kitchen::Pulumi::Error, "Resolving hosts failed\n#{e}"
end