Sha256: 14c80f722bab6b4ff02a4d204813e6f20337b8dff99fc64530bb23f391420b80

Contents?: true

Size: 857 Bytes

Versions: 27

Compression:

Stored size: 857 Bytes

Contents

# frozen_string_literal: true

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

    return false unless docker_check_daemon

    stdout_str = run _docker_container_cmd_check_network network

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

    log.debug "Network \"#{network}\" is existing"
    true
  end

  private

  # Prepare command to check if docker network exists.
  def _docker_container_cmd_check_network(network)
    format(
      config.active['cmd_docker_container_check_network_docker_network'],
      network: network
    )
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
takelage-0.28.11 lib/takelage/docker/container/check/network.rb
takelage-0.28.8 lib/takelage/docker/container/check/network.rb
takelage-0.28.7 lib/takelage/docker/container/check/network.rb
takelage-0.28.5 lib/takelage/docker/container/check/network.rb
takelage-0.27.1 lib/takelage/docker/container/check/network.rb
takelage-0.27.0 lib/takelage/docker/container/check/network.rb
takelage-0.26.7 lib/takelage/docker/container/check/network.rb