Sha256: f9cd5a4e15a42a49ed561fc131140fc127f68771badcc2a45c922304c93a66d6

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

# tau docker check daemon
module DockerCheckDaemon
  # Backend method for docker check daemon.
  # @return [Boolean] is the docker daemon running?
  # rubocop:disable Metrics/MethodLength
  # rubocop:disable Metrics/AbcSize
  def docker_check_daemon
    return true if @docker_daemon_running

    return false unless command_available_else_error? config.active['cmd_docker']

    log.debug 'Check if the docker daemon is running'

    cmd_docker_info = format(
      config.active['cmd_docker_check_daemon_docker_info'],
      docker: config.active['cmd_docker']
    )
    status = try cmd_docker_info

    unless status.exitstatus.zero?
      log.error 'The docker daemon is not running'
      return false
    end

    log.debug 'The docker daemon is running'
    @docker_daemon_running = true
    true
  end
  # rubocop:enable Metrics/AbcSize
  # rubocop:enable Metrics/MethodLength
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
takeltau-0.43.10 lib/takeltau/docker/check/daemon.rb