From e0e4c4213500311c84b0241172f1297e963ebde0 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 4 Nov 2024 13:05:45 -0500 Subject: [PATCH 1/2] stop requiring GNU grep to run the kubernetes quickstart --- quickstart/kubernetes/miniziti.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstart/kubernetes/miniziti.bash b/quickstart/kubernetes/miniziti.bash index 5aa6dbd5d..04c5886d4 100755 --- a/quickstart/kubernetes/miniziti.bash +++ b/quickstart/kubernetes/miniziti.bash @@ -193,11 +193,11 @@ validateDnsName(){ logError "validateDnsName() takes one string param" return 1 fi - if grep -qP '(?=^.{4,253}$)(^(?:[a-zA-Z0-9](?:(?:[a-zA-Z0-9\-]){0,61}[a-zA-Z0-9])?)+[a-zA-Z0-9]$)' <<< "$1"; then + if grep -qE '^[a-zA-Z0-9]([-a-zA-Z0-9]{2,251})[a-zA-Z0-9]$' <<<"$1"; then logDebug "'$1' is a valid DNS name" return 0 else - logError "'$1' could not be validated as an unqualified DNS name which is limited to at least four alphanumeric and hyphen characters, starts with a letter, and does not end with a hyphen." + logError "'$1' could not be validated as an unqualified DNS name which is limited to at least four alphanumeric and hyphen characters and does not start nor end with a hyphen." return 1 fi } From c31173a47a423de5b70c53d1ca6bd650c93f572d Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Mon, 4 Nov 2024 15:40:18 -0500 Subject: [PATCH 2/2] normalize whitespace --- quickstart/kubernetes/miniziti.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstart/kubernetes/miniziti.bash b/quickstart/kubernetes/miniziti.bash index 04c5886d4..9262f6061 100755 --- a/quickstart/kubernetes/miniziti.bash +++ b/quickstart/kubernetes/miniziti.bash @@ -193,7 +193,7 @@ validateDnsName(){ logError "validateDnsName() takes one string param" return 1 fi - if grep -qE '^[a-zA-Z0-9]([-a-zA-Z0-9]{2,251})[a-zA-Z0-9]$' <<<"$1"; then + if grep -qE '^[a-zA-Z0-9]([-a-zA-Z0-9]{2,251})[a-zA-Z0-9]$' <<<"$1"; then logDebug "'$1' is a valid DNS name" return 0 else