pick random azure region (#2483)

This commit is contained in:
Adrian Stobbe 2023-10-20 13:38:08 +02:00 committed by GitHub
parent 37e5cbeaf6
commit 9c1c876830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View File

@ -204,6 +204,10 @@ runs:
echo "uuid=${uuid}" | tee -a $GITHUB_OUTPUT
echo "prefix=e2e-${{ github.run_id }}-${{ github.run_attempt }}-${uuid}" | tee -a $GITHUB_OUTPUT
- name: Pick a random Azure region
id: pick-az-region
uses: ./.github/actions/pick_azure_region
- name: Create IAM configuration
id: constellation-iam-create
uses: ./.github/actions/constellation_iam_create
@ -211,7 +215,7 @@ runs:
cloudProvider: ${{ inputs.cloudProvider }}
namePrefix: ${{ steps.create-prefix.outputs.prefix }}
awsZone: ${{ inputs.regionZone || 'us-east-2c' }}
azureRegion: ${{ inputs.regionZone || 'northeurope' }}
azureRegion: ${{ inputs.regionZone || steps.pick-az-region.outputs.region }}
gcpProjectID: ${{ inputs.gcpProject }}
gcpZone: ${{ inputs.regionZone || 'europe-west3-b' }}
kubernetesVersion: ${{ inputs.kubernetesVersion }}

View File

@ -1,4 +1,4 @@
name: Pick and assignee
name: Pick an assignee
description: "Pick an assignee"
outputs:

View File

@ -0,0 +1,24 @@
name: Pick an Azure region
description: "Pick an Azure region"
outputs:
region:
description: "One of the supported Azure regions"
value: ${{ steps.pick-region.outputs.region }}
runs:
using: "composite"
steps:
- name: Pick a region
id: pick-region
shell: bash
run: |
possibleRegions=(
"westus"
"eastus"
"northeurope"
"westeurope"
"southeastasia"
)
region=${possibleRegions[$RANDOM % ${#possibleRegions[@]}]}
echo "region=$region" | tee -a "$GITHUB_OUTPUT"