From e2f344be395beb04f1d10224cb5ba809e06545cf Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Thu, 15 Aug 2024 17:27:50 +0200 Subject: [PATCH] Ensure exact matching for org and space names in cf CLI commands --- ci/autoscaler/scripts/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/autoscaler/scripts/common.sh b/ci/autoscaler/scripts/common.sh index aa235705c0..0e2797142a 100644 --- a/ci/autoscaler/scripts/common.sh +++ b/ci/autoscaler/scripts/common.sh @@ -105,7 +105,7 @@ function find_or_create_org(){ function find_or_create_space(){ local space_name="$1" if ! cf spaces | grep --quiet --regexp="${space_name}"; then - cf create-space "${space_name}" + cf create-space "^${space_name}$" fi echo "targeting space ${space_name}" cf target -s "${space_name}" @@ -115,6 +115,6 @@ function cf_target(){ local org_name="$1" local space_name="$2" - find_or_create_org "${org_name}" + find_or_create_org "^${org_name}$" find_or_create_space "${space_name}" }