Sha256: 29202927f568643053a288c747c5c04fcdb2e97131b761123bce03c318c19b92

Contents?: true

Size: 890 Bytes

Versions: 40

Compression:

Stored size: 890 Bytes

Contents

# frozen_string_literal: true

# tau 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

40 entries across 40 versions & 1 rubygems

Version Path
takeltau-0.43.6 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.43.4 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.43.2 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.43.1 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.42.7 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.42.5 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.42.4 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.42.3 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.42.0 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.41.10 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.41.9 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.41.0 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.11 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.9 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.7 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.6 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.4 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.3 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.1 lib/takeltau/docker/container/check/orphaned.rb
takeltau-0.40.0 lib/takeltau/docker/container/check/orphaned.rb