From fa4813b91d3f368c8454f6b88b1576ed6fd66c29 Mon Sep 17 00:00:00 2001 From: Arjan Bal Date: Tue, 26 Aug 2025 12:19:34 +0530 Subject: [PATCH 1/7] unset location env variables when not required --- .kokoro/psm_interop_kokoro_lib.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index 46daacf1..7959de1f 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -849,8 +849,8 @@ psm::tools::log() { # Determines the cluster name and zone based on the given cluster identifier. # Globals: # GKE_CLUSTER_NAME: Set to reflect the cluster name to use -# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. -# GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). +# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. This variable will be unset for regional clusters. +# GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). This variable will be unset for zonal clusters. # Arguments: # The cluster identifier # Outputs: @@ -861,6 +861,7 @@ activate_gke_cluster() { GKE_CLUSTER_PSM_LB) GKE_CLUSTER_NAME="psm-interop-lb-primary" GKE_CLUSTER_ZONE="us-central1-a" + unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_PSM_SECURITY) GKE_CLUSTER_NAME="psm-interop-security" @@ -869,18 +870,22 @@ activate_gke_cluster() { GKE_CLUSTER_PSM_CSM) GKE_CLUSTER_NAME="psm-interop-csm-gateway" GKE_CLUSTER_REGION="us-central1" + unset GKE_CLUSTER_ZONE ;; GKE_CLUSTER_PSM_BASIC) GKE_CLUSTER_NAME="interop-test-psm-basic" GKE_CLUSTER_ZONE="us-central1-c" + unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_DUALSTACK) GKE_CLUSTER_NAME="psm-interop-dualstack" GKE_CLUSTER_ZONE="us-central1-a" + unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_PSM_INTEROP_FLEET) GKE_CLUSTER_NAME="psm-interop-fleet-cluster" GKE_CLUSTER_ZONE="us-central1-a" + unset GKE_CLUSTER_REGION ;; *) psm::tools::log "Unknown GKE cluster: ${1}" From cc4d82ce7fb6451d744479a813542181ec9839c2 Mon Sep 17 00:00:00 2001 From: Arjan Bal Date: Tue, 26 Aug 2025 12:37:37 +0530 Subject: [PATCH 2/7] Wrap comments --- .kokoro/psm_interop_kokoro_lib.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index 7959de1f..c7bad82e 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -849,8 +849,10 @@ psm::tools::log() { # Determines the cluster name and zone based on the given cluster identifier. # Globals: # GKE_CLUSTER_NAME: Set to reflect the cluster name to use -# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. This variable will be unset for regional clusters. -# GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). This variable will be unset for zonal clusters. +# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. +# This variable will be unset for regional clusters. +# GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). +# This variable will be unset for zonal clusters. # Arguments: # The cluster identifier # Outputs: From ad77fa8db20c7c50dcda3753bd30865549b83d90 Mon Sep 17 00:00:00 2001 From: Arjan Bal Date: Mon, 8 Sep 2025 13:29:28 +0530 Subject: [PATCH 3/7] unset at the beginning of the function --- .kokoro/psm_interop_kokoro_lib.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index c7bad82e..2553ceb8 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -859,11 +859,13 @@ psm::tools::log() { # Writes the output to stdout, stderr ####################################### activate_gke_cluster() { + unset GKE_CLUSTER_REGION + unset GKE_CLUSTER_ZONE + unset GKE_CLUSTER_NAME case $1 in GKE_CLUSTER_PSM_LB) GKE_CLUSTER_NAME="psm-interop-lb-primary" GKE_CLUSTER_ZONE="us-central1-a" - unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_PSM_SECURITY) GKE_CLUSTER_NAME="psm-interop-security" @@ -872,22 +874,18 @@ activate_gke_cluster() { GKE_CLUSTER_PSM_CSM) GKE_CLUSTER_NAME="psm-interop-csm-gateway" GKE_CLUSTER_REGION="us-central1" - unset GKE_CLUSTER_ZONE ;; GKE_CLUSTER_PSM_BASIC) GKE_CLUSTER_NAME="interop-test-psm-basic" GKE_CLUSTER_ZONE="us-central1-c" - unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_DUALSTACK) GKE_CLUSTER_NAME="psm-interop-dualstack" GKE_CLUSTER_ZONE="us-central1-a" - unset GKE_CLUSTER_REGION ;; GKE_CLUSTER_PSM_INTEROP_FLEET) GKE_CLUSTER_NAME="psm-interop-fleet-cluster" GKE_CLUSTER_ZONE="us-central1-a" - unset GKE_CLUSTER_REGION ;; *) psm::tools::log "Unknown GKE cluster: ${1}" From 71fe125e13e862a87beb09b30520ec98dd0153a4 Mon Sep 17 00:00:00 2001 From: Arjan Singh Bal <46515553+arjan-bal@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:18:08 +0530 Subject: [PATCH 4/7] Update .kokoro/psm_interop_kokoro_lib.sh Co-authored-by: Sergii Tkachenko --- .kokoro/psm_interop_kokoro_lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index 2553ceb8..e9642e7b 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -859,6 +859,7 @@ psm::tools::log() { # Writes the output to stdout, stderr ####################################### activate_gke_cluster() { + # Reset the variables: activate_gke_cluster may be called multiple times. unset GKE_CLUSTER_REGION unset GKE_CLUSTER_ZONE unset GKE_CLUSTER_NAME From 74b1ab4ea4c736371de164c338e446065e4feaf3 Mon Sep 17 00:00:00 2001 From: Arjan Bal Date: Mon, 8 Sep 2025 14:19:14 +0530 Subject: [PATCH 5/7] set to empty string instead of using unset --- .kokoro/psm_interop_kokoro_lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index e9642e7b..47c43131 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -860,9 +860,9 @@ psm::tools::log() { ####################################### activate_gke_cluster() { # Reset the variables: activate_gke_cluster may be called multiple times. - unset GKE_CLUSTER_REGION - unset GKE_CLUSTER_ZONE - unset GKE_CLUSTER_NAME + GKE_CLUSTER_REGION="" + GKE_CLUSTER_ZONE="" + GKE_CLUSTER_NAME="" case $1 in GKE_CLUSTER_PSM_LB) GKE_CLUSTER_NAME="psm-interop-lb-primary" From bd6ea8f5f6156e7cfa9b11d233006e7e7ef99f0f Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 8 Sep 2025 09:08:14 -0700 Subject: [PATCH 6/7] Apply suggestion from @sergiitk --- .kokoro/psm_interop_kokoro_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index 47c43131..05b8163d 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -850,7 +850,7 @@ psm::tools::log() { # Globals: # GKE_CLUSTER_NAME: Set to reflect the cluster name to use # GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. -# This variable will be unset for regional clusters. +# This variable will be empty for regional clusters. # GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). # This variable will be unset for zonal clusters. # Arguments: From 6f0f4aca317510ba379de0da37606a77cde73a8a Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 8 Sep 2025 09:08:24 -0700 Subject: [PATCH 7/7] Apply suggestion from @sergiitk --- .kokoro/psm_interop_kokoro_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index 05b8163d..22cd38f8 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -852,7 +852,7 @@ psm::tools::log() { # GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use. # This variable will be empty for regional clusters. # GKE_CLUSTER_REGION: Set to reflect the cluster region to use (for regional clusters). -# This variable will be unset for zonal clusters. +# This variable will be empty for zonal clusters. # Arguments: # The cluster identifier # Outputs: