Skip to content

Commit

Permalink
Replace SUBNET_ID source. (#530)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Leites <[email protected]>
  • Loading branch information
CorrenSoft and tallaxes authored Oct 23, 2024
1 parent c46539c commit f9ed254
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hack/deploy/configure-values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ BOOTSTRAP_TOKEN=$TOKEN_ID.$TOKEN_SECRET
SSH_PUBLIC_KEY="$(cat ~/.ssh/id_rsa.pub) azureuser"

if [[ ! -v VNET_SUBNET_ID ]]; then
# 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")
# Getting the subnet id from the first AgentPoolProfile in the cluster
VNET_SUBNET_ID=$(jq -r ".agentPoolProfiles[0].vnetSubnetId" <<< "$AKS_JSON")
fi

# The // empty ensures that if the files is 'null' or not prsent jq will output nothing
# The // empty ensures that if the files is 'null' or not present 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")
Expand Down

0 comments on commit f9ed254

Please sign in to comment.