From 461f9525242b92f0b213f87d01192eb9a575ceda Mon Sep 17 00:00:00 2001 From: Tullio Sebastiani Date: Wed, 23 Aug 2023 16:52:51 +0200 Subject: [PATCH] fix empty node selector issue the other way round accept every selector --- common_run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common_run.sh b/common_run.sh index 90f0075..f699c48 100755 --- a/common_run.sh +++ b/common_run.sh @@ -66,7 +66,11 @@ setup_arcaflow_env(){ then for selector in "${SELECTORS[@]}" do - [[ ! $selector =~ ^.+\=.+ ]] && echo "$selector is not in the right format, node selectors must be in the format =" && exit 1 + # if the selector is in the format kubernetes.io/os= will become kubernetes.io/os='' + [[ $selector =~ ^.+\=$ ]] && selector="$selector''" + # if the selector is in the format kubernetes.io/os will become kubernetes.io/os='' + [[ ! $selector =~ ^.+\=.+ ]] && selector="$selector=''" + IFS='=' read -r -a SPLITTED_SELECTOR <<< $selector export SELECTOR=${SPLITTED_SELECTOR[0]} export SELECTOR_VALUE=${SPLITTED_SELECTOR[1]}