diff --git a/hack/deploy/configure-values.sh b/hack/deploy/configure-values.sh index faa99bd0c..37d50fab9 100755 --- a/hack/deploy/configure-values.sh +++ b/hack/deploy/configure-values.sh @@ -31,11 +31,12 @@ BOOTSTRAP_TOKEN=$TOKEN_ID.$TOKEN_SECRET SSH_PUBLIC_KEY="$(cat ~/.ssh/id_rsa.pub) azureuser" if [[ ! -v VNET_SUBNET_ID ]]; then - # Getting the subnet id from the first AgentPoolProfile in the cluster - VNET_SUBNET_ID=$(jq -r ".agentPoolProfiles[0].vnetSubnetId" <<< "$AKS_JSON") + # first subnet of first VNet found + VNET_JSON=$(az network vnet list --resource-group "$AZURE_RESOURCE_GROUP_MC" | jq -r ".[0]") + VNET_SUBNET_ID=$(jq -r ".subnets[0].id" <<< "$VNET_JSON") fi -# The // empty ensures that if the files is 'null' or not present jq will output nothing +# The // empty ensures that if the files is 'null' or not prsent jq will output nothing # If the value returned is none, its from jq and not the aks api in this case we return "" NETWORK_PLUGIN=$(jq -r ".networkProfile.networkPlugin // empty | if . == \"none\" then \"\" else . end" <<< "$AKS_JSON") NETWORK_PLUGIN_MODE=$(jq -r ".networkProfile.networkPluginMode // empty | if . == \"none\" then \"\" else . end" <<< "$AKS_JSON")