mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
ci: add error handling to e2e windows liveness probe (#3018)
* workflows: add error handling to e2e windows liveness probe * update retry condition in last iteration * Update liveness probe to check for correct number of nodes * ci: fix Windows e2e test not pushing required container images (#3021) * More output when waiting for nodes to get ready * Create unique resource group name for Windows e2e test * Push container images on windows CLI build to fix e2e test --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems> * Fix resource group naming Signed-off-by: Daniel Weiße <dw@edgeless.systems> --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems> Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com> Co-authored-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
f6dfea2a79
commit
e89d8e4d72
48
.github/workflows/e2e-windows.yml
vendored
48
.github/workflows/e2e-windows.yml
vendored
@ -14,6 +14,11 @@ jobs:
|
||||
build-cli:
|
||||
name: Build Windows CLI
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
id-token: write
|
||||
checks: write
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -26,17 +31,26 @@ jobs:
|
||||
useCache: "true"
|
||||
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: ./.github/actions/container_registry_login
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build CLI
|
||||
uses: ./.github/actions/build_cli
|
||||
with:
|
||||
targetOS: "windows"
|
||||
targetArch: "amd64"
|
||||
enterpriseCLI: true
|
||||
outputPath: "build/constellation"
|
||||
push: true
|
||||
|
||||
- name: Upload CLI artifact
|
||||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
||||
with:
|
||||
path: "bazel-bin/cli/cli_enterprise_windows_amd64"
|
||||
path: build/constellation.exe
|
||||
name: "constell-exe"
|
||||
|
||||
e2e-test:
|
||||
@ -57,7 +71,6 @@ jobs:
|
||||
- name: Check CLI version
|
||||
shell: pwsh
|
||||
run: |
|
||||
Move-Item -Path .\cli_enterprise_windows_amd64 -Destination .\constellation.exe
|
||||
.\constellation.exe version
|
||||
Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value "`n127.0.0.1`tlicense.confidential.cloud" -Force
|
||||
|
||||
@ -69,8 +82,10 @@ jobs:
|
||||
- name: Create IAM configuration
|
||||
shell: pwsh
|
||||
run: |
|
||||
$uid = Get-Random -Minimum 1000 -Maximum 9999
|
||||
$rgName = "e2e-win-${{ github.run_id }}-${{ github.run_attempt }}-$uid"
|
||||
.\constellation.exe config generate azure
|
||||
.\constellation.exe iam create azure --region=westus --resourceGroup=e2eWindoewsRG --servicePrincipal=e2eWindoewsSP --update-config --debug -y
|
||||
.\constellation.exe iam create azure --region=westus --resourceGroup=$rgName-rg --servicePrincipal=$rgName-sp --update-config --debug -y
|
||||
|
||||
- name: Login to Azure (Cluster service principal)
|
||||
uses: ./.github/actions/login_azure
|
||||
@ -96,24 +111,31 @@ jobs:
|
||||
Write-Host "Retry ${retryCount}: Checking node status..."
|
||||
|
||||
$nodesOutput = & kubectl get nodes --kubeconfig "$PWD\constellation-admin.conf"
|
||||
$status = $?
|
||||
|
||||
$lines = $nodesOutput -split "`r?`n" | Select-Object -Skip 1
|
||||
$nodesOutput
|
||||
|
||||
$allNodesReady = $true
|
||||
if ($status) {
|
||||
$lines = $nodesOutput -split "`r?`n" | Select-Object -Skip 1
|
||||
|
||||
foreach ($line in $lines) {
|
||||
$columns = $line -split '\s+' | Where-Object { $_ -ne '' }
|
||||
if ($lines.count -eq 4) {
|
||||
$allNodesReady = $true
|
||||
|
||||
$nodeName = $columns[0]
|
||||
$status = $columns[1]
|
||||
foreach ($line in $lines) {
|
||||
$columns = $line -split '\s+' | Where-Object { $_ -ne '' }
|
||||
|
||||
if ($status -ne "Ready") {
|
||||
Write-Host "Node $nodeName is not ready!"
|
||||
$allNodesReady = $false
|
||||
$nodeName = $columns[0]
|
||||
$status = $columns[1]
|
||||
|
||||
if ($status -ne "Ready") {
|
||||
Write-Host "Node $nodeName is not ready!"
|
||||
$allNodesReady = $false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $allNodesReady) {
|
||||
if (-not $allNodesReady -and $retryCount -lt $maxRetries) {
|
||||
Write-Host "Retrying in $retryIntervalSeconds seconds..."
|
||||
Start-Sleep -Seconds $retryIntervalSeconds
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user