From 38f39a8dcf7ce79089e4e8d3ecea962044028f03 Mon Sep 17 00:00:00 2001 From: seenu433 Date: Tue, 16 Mar 2021 11:39:00 -0400 Subject: [PATCH] Update enable-monitoring.sh Line 314 and 343 seems to have trailing spaces for some subscriptions which is exiting the script even for valid scenarios --- scripts/onboarding/managed/enable-monitoring.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/onboarding/managed/enable-monitoring.sh b/scripts/onboarding/managed/enable-monitoring.sh index 9d0c0aca5..ae371f6e7 100644 --- a/scripts/onboarding/managed/enable-monitoring.sh +++ b/scripts/onboarding/managed/enable-monitoring.sh @@ -311,7 +311,7 @@ parse_args() { validate_and_configure_supported_cloud() { echo "get active azure cloud name configured to azure cli" - azureCloudName=$(az cloud show --query name -o tsv | tr "[:upper:]" "[:lower:]") + azureCloudName=$(az cloud show --query name -o tsv | tr "[:upper:]" "[:lower:]" | tr -d "[:space:]") echo "active azure cloud name configured to azure cli: ${azureCloudName}" if [ "$isArcK8sCluster" = true ]; then if [ "$azureCloudName" != "azurecloud" -a "$azureCloudName" != "azureusgovernment" ]; then @@ -340,7 +340,7 @@ validate_cluster_identity() { local clusterName="$(echo ${2})" local identitytype=$(az resource show -g ${rgName} -n ${clusterName} --resource-type $resourceProvider --query identity.type) - identitytype=$(echo $identitytype | tr "[:upper:]" "[:lower:]" | tr -d '"') + identitytype=$(echo $identitytype | tr "[:upper:]" "[:lower:]" | tr -d '"' | tr -d "[:space:]") echo "cluster identity type:" $identitytype if [[ "$identitytype" != "systemassigned" ]]; then