From 2054da04d70a12cfeb969086e56534d39f432800 Mon Sep 17 00:00:00 2001 From: Alex Leites <18728999+tallaxes@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:57:15 -0700 Subject: [PATCH] Revert "Replace SUBNET_ID source. (#530)" (#539) This reverts commit f9ed254a2c543f46748b439bfd0642d5bfe5d16f. --- hack/deploy/configure-values.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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")