From 2739e51d3aebb580e451a29e4192c22a61e8b6b6 Mon Sep 17 00:00:00 2001 From: Nitin Garg <113666283+gargnitingoogle@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:50:51 +0530 Subject: [PATCH] [gke-automated-test-tool] fix bug in csi driver build (#2819) This fixes a bug unintentionally introduced in previous commit . In that commit, the bash function uuid was printing out some more information other than the uuid value itself because of the installation step. In bash, the printed log becomes the output of a function, hence the installation inside this function was changing the output of the uuid function breaking the caller. So, I have moved the installation out to wherever we're invoking this function. --- .../testing_on_gke/examples/run-gke-tests.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/perfmetrics/scripts/testing_on_gke/examples/run-gke-tests.sh b/perfmetrics/scripts/testing_on_gke/examples/run-gke-tests.sh index bb23784de3..f2b7f23f71 100755 --- a/perfmetrics/scripts/testing_on_gke/examples/run-gke-tests.sh +++ b/perfmetrics/scripts/testing_on_gke/examples/run-gke-tests.sh @@ -514,13 +514,6 @@ function ensureGcsFuseCsiDriverCode() { } uuid() { - if ! which uuidgen; then - # try to install uuidgen - sudo apt-get update && sudo apt-get install -y uuid-runtime - # confirm that it got installed. - which uuidgen - fi - echo $(uuidgen) | sed -e "s/\-//g" ; } @@ -565,6 +558,12 @@ function createCustomCsiDriverIfNeeded() { make generate-spec-yaml printf "\nBuilding a new custom CSI driver using the above GCSFuse binary ...\n\n" registry=gcr.io/${project_id}/${USER}/${cluster_name} + if ! which uuidgen; then + # try to install uuidgen + sudo apt-get update && sudo apt-get install -y uuid-runtime + # confirm that it got installed. + which uuidgen + fi stagingversion=$(uuid) make build-image-and-push-multi-arch REGISTRY=${registry} GCSFUSE_PATH=gs://${package_bucket} STAGINGVERSION=${stagingversion} printf "\nInstalling the new custom CSI driver built above ...\n\n"