Sha256: 8b4a59145cc86cedaac97b441a6b678311f5091a6188277fcb6cc53ba44733d7

Contents?: true

Size: 895 Bytes

Versions: 36

Compression:

Stored size: 895 Bytes

Contents

# frozen_string_literal: true

# takelage docker container check orphaned
module DockerContainerCheckOrphaned
  # Backend method for docker container check orphaned.
  # @return [Boolean] is container orphaned?
  def docker_container_check_orphaned(container)
    log.debug "Check if container \"#{container}\" is orphaned"

    return false unless docker_check_daemon

    stdout_str = run _docker_container_cmd_check_orphaned container

    if stdout_str.include? '/loginpoint.py'
      log.debug "Container \"#{container}\" isn't orphaned"
      return false
    end

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

  private

  # Format command to check if docker container is orphaned.
  def _docker_container_cmd_check_orphaned(container)
    format(
      config.active['cmd_docker_container_check_orphaned_docker_exec'],
      container: container
    )
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
takelage-0.33.1 lib/takelage/docker/container/check/orphaned.rb
takelage-0.32.4 lib/takelage/docker/container/check/orphaned.rb
takelage-0.32.3 lib/takelage/docker/container/check/orphaned.rb
takelage-0.32.1 lib/takelage/docker/container/check/orphaned.rb
takelage-0.32.0 lib/takelage/docker/container/check/orphaned.rb
takelage-0.31.0 lib/takelage/docker/container/check/orphaned.rb
takelage-0.30.6 lib/takelage/docker/container/check/orphaned.rb
takelage-0.30.5 lib/takelage/docker/container/check/orphaned.rb
takelage-0.30.1 lib/takelage/docker/container/check/orphaned.rb
takelage-0.30.0 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.14 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.13 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.11 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.10 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.8 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.6 lib/takelage/docker/container/check/orphaned.rb
takelage-0.29.0 lib/takelage/docker/container/check/orphaned.rb
takelage-0.28.26 lib/takelage/docker/container/check/orphaned.rb
takelage-0.28.24 lib/takelage/docker/container/check/orphaned.rb
takelage-0.28.14 lib/takelage/docker/container/check/orphaned.rb