Sha256: d422d41e29b0b5411b3d3ff63804f541989ae4c7c08219082e8fcf925c40b3b0

Contents?: true

Size: 879 Bytes

Versions: 36

Compression:

Stored size: 879 Bytes

Contents

# frozen_string_literal: true

# tau docker container check existing
module DockerContainerCheckExisting
  # Backend method for docker container check existing.
  # @return [Boolean] is container existing?
  def docker_container_check_existing(container)
    log.debug "Checking if container \"#{container}\" is existing"

    return false unless docker_check_daemon

    stdout_str = run _docker_container_cmd_check_existing container

    if stdout_str.to_s.chomp.empty?
      log.debug "Container \"#{container}\" is not existing"
      return false
    end

    log.debug "Container \"#{container}\" is existing"
    true
  end

  private

  # Format command to check if docker container exists.
  def _docker_container_cmd_check_existing(container)
    format(
      config.active['cmd_docker_container_check_existing_docker_ps'],
      container: container
    )
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
takeltau-0.42.7 lib/takeltau/docker/container/check/existing.rb
takeltau-0.42.5 lib/takeltau/docker/container/check/existing.rb
takeltau-0.42.4 lib/takeltau/docker/container/check/existing.rb
takeltau-0.42.3 lib/takeltau/docker/container/check/existing.rb
takeltau-0.42.0 lib/takeltau/docker/container/check/existing.rb
takeltau-0.41.10 lib/takeltau/docker/container/check/existing.rb
takeltau-0.41.9 lib/takeltau/docker/container/check/existing.rb
takeltau-0.41.0 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.11 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.9 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.7 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.6 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.4 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.3 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.1 lib/takeltau/docker/container/check/existing.rb
takeltau-0.40.0 lib/takeltau/docker/container/check/existing.rb
takeltau-0.39.18 lib/takeltau/docker/container/check/existing.rb
takeltau-0.39.16 lib/takeltau/docker/container/check/existing.rb
takeltau-0.39.11 lib/takeltau/docker/container/check/existing.rb
takeltau-0.39.7 lib/takeltau/docker/container/check/existing.rb