@@ -327,7 +327,7 @@ function createFileShare {
327327 nameAvailable=$( echo " $ret " | grep " nameAvailable" | grep " false" )
328328 if [ -n " $nameAvailable " ]; then
329329 echo $ret
330- fail " Storage account ${aksClusterName} is unavaliable ."
330+ fail " Storage account ${aksClusterName} is unavailable ."
331331 fi
332332
333333 echo Creating Azure Storage Account ${storageAccountName} .
@@ -367,18 +367,18 @@ function createFileShare {
367367
368368function configureStorageAccountNetwork {
369369 # get the resource group name of the AKS managed resources
370- aksMCRGName=$( az aks show --name $aksClusterName --resource-group $azureResourceGroupName -o tsv --query " nodeResourceGroup" )
370+ local aksMCRGName=$( az aks show --name $aksClusterName --resource-group $azureResourceGroupName -o tsv --query " nodeResourceGroup" )
371371 echo ${aksMCRGName}
372372
373373 # get network name of AKS cluster
374- aksNetworkName=$( az resource list --resource-group ${aksMCRGName} --resource-type Microsoft.Network/virtualNetworks -o tsv --query ' [*].name' )
374+ local aksNetworkName=$( az resource list --resource-group ${aksMCRGName} --resource-type Microsoft.Network/virtualNetworks -o tsv --query ' [*].name' )
375375 echo ${aksNetworkName}
376376
377377 # get subnet name of AKS agent pool
378- aksSubnetName=$( az network vnet subnet list --resource-group ${aksMCRGName} --vnet-name ${aksNetworkName} -o tsv --query " [*].name" )
378+ local aksSubnetName=$( az network vnet subnet list --resource-group ${aksMCRGName} --vnet-name ${aksNetworkName} -o tsv --query " [*].name" )
379379 echo ${aksSubnetName}
380380
381- aksSubnetId=$( az network vnet subnet list --resource-group ${aksMCRGName} --vnet-name ${aksNetworkName} -o tsv --query " [*].id" )
381+ local aksSubnetId=$( az network vnet subnet list --resource-group ${aksMCRGName} --vnet-name ${aksNetworkName} -o tsv --query " [*].id" )
382382 echo ${aksSubnetId}
383383
384384 az network vnet subnet update \
@@ -427,8 +427,8 @@ function createWebLogicDomain {
427427}
428428
429429function waitForJobComplete {
430- attempts=0
431- svcState=" running"
430+ local attempts=0
431+ local svcState=" running"
432432 while [ ! " $svcState " == " completed" ] && [ ! $attempts -eq 30 ]; do
433433 svcState=" completed"
434434 attempts=$(( attempts + 1 ))
@@ -439,25 +439,25 @@ function waitForJobComplete {
439439 # ${domainUID}-${adminServerName}, e.g. domain1-admin-server
440440 # ${domainUID}-${adminServerName}-ext, e.g. domain1-admin-server-ext
441441 # ${domainUID}-${adminServerName}-external-lb, e.g domain1-admin-server-external-lb
442- adminServiceCount=$( kubectl get svc | grep -c " ${domainUID} -${adminServerName} " )
442+ local adminServiceCount=$( kubectl get svc | grep -c " ${domainUID} -${adminServerName} " )
443443 if [ ${adminServiceCount} -lt 3 ]; then svcState=" running" ; fi
444444
445445 # If the job is completed, there should have the following services created, .assuming initialManagedServerReplicas=2
446446 # ${domainUID}-${managedServerNameBase}1, e.g. domain1-managed-server1
447447 # ${domainUID}-${managedServerNameBase}2, e.g. domain1-managed-server2
448- managedServiceCount=$( kubectl get svc | grep -c " ${domainUID} -${managedServerNameBase} " )
448+ local managedServiceCount=$( kubectl get svc | grep -c " ${domainUID} -${managedServerNameBase} " )
449449 if [ ${managedServiceCount} -lt ${initialManagedServerReplicas} ]; then svcState=" running" ; fi
450450
451451 # If the job is completed, there should have no service in pending status.
452- pendingCount=$( kubectl get svc | grep -c " pending" )
452+ local pendingCount=$( kubectl get svc | grep -c " pending" )
453453 if [ ${pendingCount} -ne 0 ]; then svcState=" running" ; fi
454454
455455 # If the job is completed, there should have the following pods running
456456 # ${domainUID}-${adminServerName}, e.g. domain1-admin-server
457457 # ${domainUID}-${managedServerNameBase}1, e.g. domain1-managed-server1
458458 # to
459459 # ${domainUID}-${managedServerNameBase}n, e.g. domain1-managed-servern, n = initialManagedServerReplicas
460- runningPodCount=$( kubectl get pods | grep " ${domainUID} " | grep -c " Running" )
460+ local runningPodCount=$( kubectl get pods | grep " ${domainUID} " | grep -c " Running" )
461461 if [[ $runningPodCount -le ${initialManagedServerReplicas} ]]; then svcState=" running" ; fi
462462
463463 echo ==============================Current Status==========================================
0 commit comments