Skip to content

Commit ed4a20a

Browse files
azure-sdkbenbp
andauthored
Sync eng/common directory with azure-sdk-tools for PR 8278 (Azure#44219)
* Migrate stress cluster to use workload identity * Only sleep to sync fed creds when namespace is new --------- Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 7d4e4bd commit ed4a20a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,17 @@ function DeployStressPackage(
213213
$imageTagBase += "/$($pkg.Namespace)/$($pkg.ReleaseName)"
214214

215215
if (!$Template) {
216-
Write-Host "Creating namespace $($pkg.Namespace) if it does not exist..."
217-
kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f -
218-
if ($LASTEXITCODE) {exit $LASTEXITCODE}
216+
Write-Host "Checking for namespace $($pkg.Namespace)"
217+
kubectl get namespace $pkg.Namespace
218+
if ($LASTEXITCODE) {
219+
Write-Host "Creating namespace $($pkg.Namespace) ..."
220+
kubectl create namespace $pkg.Namespace --dry-run=client -o yaml | kubectl apply -f -
221+
if ($LASTEXITCODE) {exit $LASTEXITCODE}
222+
# Give a few seconds for stress watcher to initialize the federated identity credential
223+
# and create the service account before we reference it
224+
Write-Host "Waiting 15 seconds for namespace federated credentials to be created and synced"
225+
Start-Sleep 15
226+
}
219227
Write-Host "Adding default resource requests to namespace/$($pkg.Namespace)"
220228
$limitRangeSpec | kubectl apply -n $pkg.Namespace -f -
221229
if ($LASTEXITCODE) {exit $LASTEXITCODE}

0 commit comments

Comments
 (0)