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