fix: update the select_dind_image fn to return the is_dind_image val 22/42822/2
authorNaveen Joy <[email protected]>
Tue, 15 Apr 2025 23:16:26 +0000 (16:16 -0700)
committerNaveen Joy <[email protected]>
Tue, 15 Apr 2025 23:44:47 +0000 (16:44 -0700)
Change-Id: I65f47e4ba3b3aa2b4fe2bf17cf7d3b85729f0f09
Signed-off-by: Naveen Joy <[email protected]>
docker/scripts/lib_apt.sh

index beeb482..ee1c599 100644 (file)
@@ -22,23 +22,18 @@ alias lib_apt_imported=true
 
 select_dind_image() {
     local input_image="$1"
-    local dind_image=""
 
     case "$input_image" in
-      "ubuntu:22.04")
-        dind_image="cruizba/ubuntu-dind:jammy-26.1.3-r2"
-        is_dind_image="true"
-        ;;
-      "ubuntu:24.04")
-        dind_image="cruizba/ubuntu-dind:noble-26.1.3-r2"
-        is_dind_image="true"
-        ;;
-      *)
-        dind_image="$input_image"
-        ;;
+        "ubuntu:22.04")
+            echo "cruizba/ubuntu-dind:jammy-26.1.3-r2|true"
+            ;;
+        "ubuntu:24.04")
+            echo "cruizba/ubuntu-dind:noble-26.1.3-r2|true"
+            ;;
+        *)
+            echo "$input_image|false"
+            ;;
     esac
-
-    echo "$dind_image"
 }
 
 export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"}
@@ -392,7 +387,7 @@ generate_apt_dockerfile() {
     local is_dind_image="false"
 
     # TODO: Enable HST on AARCH64 when supported in vpp/extras/hs-test
-    from_image=$(select_dind_image "$from_image")
+    IFS="|" read -r from_image is_dind_image <<< "$(select_dind_image "$from_image")"
 
     cat <<EOF  >"$DOCKERIGNOREFILE"
 **/__pycache__