From 6c387aac2381898b928d9a74b6aa9292a54adee9 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 23 May 2024 10:42:29 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 8278 (#1589) * Migrate stress cluster to use workload identity * Only sleep to sync fed creds when namespace is new --------- Co-authored-by: Ben Broderick Phillips --- .../stress-testing/stress-test-deployment-lib.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index f05f7388f7..c3468a111b 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -213,9 +213,17 @@ function DeployStressPackage( $imageTagBase += "/$($pkg.Namespace)/$($pkg.ReleaseName)" if (!$Template) { - Write-Host "Creating namespace $($pkg.Namespace) if it does not exist..." - kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f - - if ($LASTEXITCODE) {exit $LASTEXITCODE} + Write-Host "Checking for namespace $($pkg.Namespace)" + kubectl get namespace $pkg.Namespace + if ($LASTEXITCODE) { + Write-Host "Creating namespace $($pkg.Namespace) ..." + kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f - + if ($LASTEXITCODE) {exit $LASTEXITCODE} + # Give a few seconds for stress watcher to initialize the federated identity credential + # and create the service account before we reference it + Write-Host "Waiting 15 seconds for namespace federated credentials to be created and synced" + Start-Sleep 15 + } Write-Host "Adding default resource requests to namespace/$($pkg.Namespace)" $limitRangeSpec | kubectl apply -n $pkg.Namespace -f - if ($LASTEXITCODE) {exit $LASTEXITCODE}