Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comparision of docker versions #18902

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/ci/libraries/_initialization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ function initialization::ga_env() {
function initialization::ver() {
# convert SemVer number to comparable string (strips pre-release version)
# shellcheck disable=SC2086,SC2183
printf "%04d%04d%04d%.0s" ${1//[.-]/ }
printf "%03d%03d%03d%.0s" ${1//[.-]/}
potiuk marked this conversation as resolved.
Show resolved Hide resolved
}

function initialization::check_docker_version() {
Expand All @@ -947,7 +947,8 @@ function initialization::check_docker_version() {
local min_docker_version="20.10.0"
local min_comparable_docker_version
min_comparable_docker_version=$(initialization::ver "${min_docker_version}")
if (( comparable_docker_version < min_comparable_docker_version )); then
# The #0 Strips leading zeros
if [[ ${comparable_docker_version#0} -lt ${min_comparable_docker_version#0} ]]; then
echo
echo "${COLOR_RED}Your version of docker is too old: ${docker_version}. Please upgrade to at least ${min_docker_version}.${COLOR_RESET}"
echo
Expand Down