Sync eng/common directory with azure-sdk-tools for PR 8278 (#5659)

* Migrate stress cluster to use workload identity

* Only sleep to sync fed creds when namespace is new

---------

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-05-23 10:42:33 -07:00 committed by GitHub
parent a9526d9375
commit af92a6980a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}