Sha256: 24e44116c583d69235f9620b9ccc6979db1178cf5530614b015b5f8e9ce1defa

Contents?: true

Size: 1.2 KB

Versions: 24

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

# takelage docker image check outdated
module DockerImageCheckOutdated
  # Backend method for docker image check outdated.
  # @return [Boolean] is docker image tag older than latest remote image tag?
  def docker_image_check_outdated(tag)
    log.debug "Check if docker image version \"#{tag}\" is outdated"

    return false unless docker_check_running

    return false if _docker_outdated_tag_latest? tag

    tag_latest_remote = docker_image_tag_latest_remote
    tags = [tag, docker_image_tag_latest_remote]
    # rubocop:disable Style/RedundantSort
    outdated = (tag != VersionSorter.sort(tags).last)
    # rubocop:enable Style/RedundantSort

    _docker_outdated_log_info tag, tag_latest_remote if outdated

    outdated
  end

  private

  # Check if the tag is "latest".
  def _docker_outdated_tag_latest?(tag)
    return false unless tag == 'latest'

    log.debug 'Docker image version "latest" is by definition never outdated'
    true
  end

  # Log info if docker image is outdated.
  def _docker_outdated_log_info(tag, tag_latest_remote)
    log.debug "Docker image version is outdated: #{tag}"
    log.debug "Docker image version is available: #{tag_latest_remote}"
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
takelage-0.22.2 lib/takelage/docker/image/check/outdated.rb
takelage-0.22.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.22.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.21.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.21.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.20.2 lib/takelage/docker/image/check/outdated.rb
takelage-0.20.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.20.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.19.2 lib/takelage/docker/image/check/outdated.rb
takelage-0.19.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.19.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.18.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.18.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.17.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.17.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.16.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.15.1 lib/takelage/docker/image/check/outdated.rb
takelage-0.15.0 lib/takelage/docker/image/check/outdated.rb
takelage-0.14.5 lib/takelage/docker/image/check/outdated.rb
takelage-0.14.4 lib/takelage/docker/image/check/outdated.rb