Skip to content

Commit d93c680

Browse files
seenu433ganga1980
andauthored
Update enable-monitoring.sh (#514)
Line 314 and 343 seems to have trailing spaces for some subscriptions which is exiting the script even for valid scenarios Co-authored-by: Ganga Mahesh Siddem <gangams@microsoft.com>
1 parent 6b48b6a commit d93c680

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/onboarding/managed/enable-monitoring.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ parse_args() {
311311

312312
validate_and_configure_supported_cloud() {
313313
echo "get active azure cloud name configured to azure cli"
314-
azureCloudName=$(az cloud show --query name -o tsv | tr "[:upper:]" "[:lower:]")
314+
azureCloudName=$(az cloud show --query name -o tsv | tr "[:upper:]" "[:lower:]" | tr -d "[:space:]")
315315
echo "active azure cloud name configured to azure cli: ${azureCloudName}"
316316
if [ "$isArcK8sCluster" = true ]; then
317317
if [ "$azureCloudName" != "azurecloud" -a "$azureCloudName" != "azureusgovernment" ]; then
@@ -340,7 +340,7 @@ validate_cluster_identity() {
340340
local clusterName="$(echo ${2})"
341341

342342
local identitytype=$(az resource show -g ${rgName} -n ${clusterName} --resource-type $resourceProvider --query identity.type -o json)
343-
identitytype=$(echo $identitytype | tr "[:upper:]" "[:lower:]" | tr -d '"')
343+
identitytype=$(echo $identitytype | tr "[:upper:]" "[:lower:]" | tr -d '"' | tr -d "[:space:]")
344344
echo "cluster identity type:" $identitytype
345345

346346
if [[ "$identitytype" != "systemassigned" ]]; then

0 commit comments

Comments
 (0)