Class: Proxy::AnsibleDirector::Runners::PodmanPullRunner

Inherits:
Dynflow::Runner::Base
  • Object
show all
Includes:
Dynflow::Runner::ProcessManagerCommand
Defined in:
lib/smart_proxy_ansible_director/runners/podman_pull_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(podman_pull_input, suspended_action: nil) ⇒ PodmanPullRunner

Returns a new instance of PodmanPullRunner.



12
13
14
15
# File 'lib/smart_proxy_ansible_director/runners/podman_pull_runner.rb', line 12

def initialize(podman_pull_input, suspended_action: nil)
  super suspended_action: suspended_action
  @ee_registry_url = podman_pull_input[:ee_registry_url]
end

Instance Method Details

#publish_data(message, type = 'debug') ⇒ Object



30
31
32
# File 'lib/smart_proxy_ansible_director/runners/podman_pull_runner.rb', line 30

def publish_data(message, type = 'debug')
    @continuous_output.add_output(message.force_encoding('UTF-8'), type)
end

#refreshObject



24
25
26
27
28
# File 'lib/smart_proxy_ansible_director/runners/podman_pull_runner.rb', line 24

def refresh
  @process_manager.process(timeout: 0.1) unless @process_manager.done?
  puts @continuous_output.humanize
  publish_exit_status(@process_manager.status) if @process_manager.done?
end

#startObject



17
18
19
20
21
22
# File 'lib/smart_proxy_ansible_director/runners/podman_pull_runner.rb', line 17

def start
  cmd = <<~CMD
    podman pull --tls-verify=false #{@ee_registry_url}
  CMD
  initialize_command('bash', '-c', cmd)
end