This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 34e09cc  Strips suffixes from docker version (#18871)
34e09cc is described below

commit 34e09cc023b77091efdfac6875237bcd138697c2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Oct 10 15:07:04 2021 +0200

    Strips suffixes from docker version (#18871)
    
    This version will strip any + alpha postfixes from docker version.
    Seems that CodeQL uses azure-specific docker version and the
    version suffix is added folowing `+`. This change will strip suffix
    but also will not fail docker version check in case of similar
    error, it will continue running with a warning if version cannot
    be retrieved.
---
 scripts/ci/libraries/_initialization.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/ci/libraries/_initialization.sh 
b/scripts/ci/libraries/_initialization.sh
index dcf8389..ff9fb29 100644
--- a/scripts/ci/libraries/_initialization.sh
+++ b/scripts/ci/libraries/_initialization.sh
@@ -907,7 +907,14 @@ function initialization::ver() {
 
 function initialization::check_docker_version() {
     local docker_version
-    docker_version=$(docker version --format '{{.Client.Version}}')
+    # In GitHub Code QL, the version of docker has +azure suffix which we 
should remove
+    docker_version=$(docker version --format '{{.Client.Version}}' | sed 
's/\+.*$//' || true)
+    if [ "${docker_version}" == "" ]; then
+        echo
+        echo "${COLOR_YELLOW}Your version of docker is unknown. If the scripts 
faill, please make sure to install docker at least: ${min_docker_version} 
version.${COLOR_RESET}"
+        echo
+        return
+    fi
     local comparable_docker_version
     comparable_docker_version=$(initialization::ver "${docker_version}")
     local min_docker_version="20.10.0"

Reply via email to