From 462cd9f9c7234b0593914507a797017b1286cb89 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 9 Oct 2024 09:32:34 +0100 Subject: [PATCH] rev: apply suggestions from code review Co-authored-by: Marek --- .github/workflows/cd-deploy-nodes-gcp.yml | 4 ++-- .github/workflows/scripts/gcp-get-cached-disks.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd-deploy-nodes-gcp.yml b/.github/workflows/cd-deploy-nodes-gcp.yml index e151ee018d6..1ca6857d3f7 100644 --- a/.github/workflows/cd-deploy-nodes-gcp.yml +++ b/.github/workflows/cd-deploy-nodes-gcp.yml @@ -279,7 +279,7 @@ jobs: DISK_PARAMS="name=${DISK_NAME},device-name=${DISK_NAME},size=400GB,type=pd-ssd" if [ -n "${{ env.CACHED_DISK_NAME }}" ]; then DISK_PARAMS+=",image=${{ env.CACHED_DISK_NAME }}" - elif [ ${{ !inputs.no_cached_disk && github.event_name == 'workflow_dispatch' }} ]; then + elif [ ${{ inputs.no_cached_disk && github.event_name == 'workflow_dispatch' }} ]; then echo "No cached disk required" else echo "No cached disk found for ${{ matrix.network }} in main branch" @@ -391,7 +391,7 @@ jobs: DISK_PARAMS="name=${DISK_NAME},device-name=${DISK_NAME},size=400GB,type=pd-ssd" if [ -n "${{ env.CACHED_DISK_NAME }}" ]; then DISK_PARAMS+=",image=${{ env.CACHED_DISK_NAME }}" - elif [ ${{ !inputs.no_cached_disk && github.event_name == 'workflow_dispatch' }} ]; then + elif [ ${{ inputs.no_cached_disk && github.event_name == 'workflow_dispatch' }} ]; then echo "No cached disk required" else echo "No cached disk found for ${{ matrix.network }} in main branch" diff --git a/.github/workflows/scripts/gcp-get-cached-disks.sh b/.github/workflows/scripts/gcp-get-cached-disks.sh index 4c295c99ec5..228f5ba4b8a 100755 --- a/.github/workflows/scripts/gcp-get-cached-disks.sh +++ b/.github/workflows/scripts/gcp-get-cached-disks.sh @@ -3,9 +3,9 @@ # This script finds a cached Google Cloud Compute image based on specific criteria. # # If there are multiple disks: -# - prefer images generated from the same branch, then -# - if prefer_main_cached_state is true, prefer images from the `main` branch, then -# - use any images from any other branch or branch. +# - if `PREFER_MAIN_CACHED_STATE` is "true", then select an image from the `main` branch, else +# - try to find a cached disk image from the current branch (or PR), else +# - try to find an image from any branch. # # Within each of these categories: # - prefer newer images to older images