Skip to content

Commit

Permalink
Revert "Replace SUBNET_ID source. (#530)" (#539)
Browse files Browse the repository at this point in the history
This reverts commit f9ed254.
  • Loading branch information
tallaxes authored Oct 23, 2024
1 parent 5f9edc0 commit 2054da0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hack/deploy/configure-values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2054da0

Please sign in to comment.