From 7cda8f412333a1a641c6ca0f6f2709d63dcb5cdd Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Tue, 29 Aug 2023 17:31:22 -0500 Subject: [PATCH 1/2] Do not fail when KUBE_GIT_VERSION is not set --- hack/prepare-for-integration-tests.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hack/prepare-for-integration-tests.sh b/hack/prepare-for-integration-tests.sh index 921812e0..0aae134f 100755 --- a/hack/prepare-for-integration-tests.sh +++ b/hack/prepare-for-integration-tests.sh @@ -205,13 +205,14 @@ registry_repo_tag="${registry_repo}:${tag}" if [[ "$do_build" == "yes" ]]; then # Rebuild the code + testing_version="${$KUBE_GIT_VERSION:-}" if [[ "$dockerfile_path" != "" ]]; then - log_note "Docker building the app with dockerfile $dockerfile_path and KUBE_GIT_VERSION=$KUBE_GIT_VERSION" - DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --file "$dockerfile_path" --build-arg "KUBE_GIT_VERSION=$KUBE_GIT_VERSION" + log_note "Docker building the app with dockerfile $dockerfile_path and KUBE_GIT_VERSION=$testing_version" + DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --file "$dockerfile_path" --build-arg "KUBE_GIT_VERSION=$testing_version" else - log_note "Docker building the app with KUBE_GIT_VERSION=$KUBE_GIT_VERSION" + log_note "Docker building the app with KUBE_GIT_VERSION=$testing_version" # DOCKER_BUILDKIT=1 is optional on MacOS but required on linux. - DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --build-arg "KUBE_GIT_VERSION=$KUBE_GIT_VERSION" + DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --build-arg "KUBE_GIT_VERSION=$testing_version" fi fi From 23bd3e7cc918d8dab08e945575dd28a5a7d6bb40 Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Tue, 29 Aug 2023 19:58:23 -0500 Subject: [PATCH 2/2] Do not fail hack/prepare-for-integration-tests.sh without KUBE_GIT_VERSION --- hack/prepare-for-integration-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/prepare-for-integration-tests.sh b/hack/prepare-for-integration-tests.sh index 0aae134f..24ba56db 100755 --- a/hack/prepare-for-integration-tests.sh +++ b/hack/prepare-for-integration-tests.sh @@ -205,12 +205,12 @@ registry_repo_tag="${registry_repo}:${tag}" if [[ "$do_build" == "yes" ]]; then # Rebuild the code - testing_version="${$KUBE_GIT_VERSION:-}" + testing_version="${KUBE_GIT_VERSION:-}" if [[ "$dockerfile_path" != "" ]]; then - log_note "Docker building the app with dockerfile $dockerfile_path and KUBE_GIT_VERSION=$testing_version" + log_note "Docker building the app with dockerfile $dockerfile_path and KUBE_GIT_VERSION='$testing_version'" DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --file "$dockerfile_path" --build-arg "KUBE_GIT_VERSION=$testing_version" else - log_note "Docker building the app with KUBE_GIT_VERSION=$testing_version" + log_note "Docker building the app with KUBE_GIT_VERSION='$testing_version'" # DOCKER_BUILDKIT=1 is optional on MacOS but required on linux. DOCKER_BUILDKIT=1 docker build . --tag "$registry_repo_tag" --build-arg "KUBE_GIT_VERSION=$testing_version" fi