diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index cf763b5bb1cd..3f8c0f63bb43 100755 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -42,5 +42,30 @@ param( . $PSScriptRoot/stress-test-deployment-lib.ps1 +# If there are local changes to values.yaml it's almost certain that the user +# is an admin and has provisioned a new stress cluster but not published a +# new addons chart with the new infra config values. In these cases we should +# just fail, as deploying without the local addons override causes misleading +# errors in the cluster with pods not able to mount storage accounts using the +# old values.yaml reference from the published stress-test-addons helm chart. +if (!$LocalAddonsPath) { + try { + $repoRoot = git -C $PSScriptRoot rev-parse --show-toplevel 2>$null + } catch { + $repoRoot = $null + } + + if ($repoRoot -and (Split-Path $repoRoot -Leaf) -eq "azure-sdk-tools") { + $valuesFile = Join-Path $repoRoot "tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml" + if (Test-Path $valuesFile) { + $valuesStatus = git -C $repoRoot status --porcelain -- $valuesFile + if ($valuesStatus) { + $localAddonsDir = Split-Path $valuesFile -Parent + throw "Detected changes to '$valuesFile' without -LocalAddonsPath. Re-run with '-LocalAddonsPath $localAddonsDir' to apply local addon values." + } + } + } +} + CheckDependencies DeployStressTests @PSBoundParameters 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 a9f45a0a9a00..64d850bf896f 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -122,21 +122,21 @@ function DeployStressTests( if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'pg' environment." } - $clusterGroup = 'rg-stress-cluster-pg' + $clusterGroup = 'SSS3PT_rg-stress-cluster-pg' $subscription = 'Azure SDK Test Resources - TME' $tenant = '70a036f6-8e4d-4615-bad6-149c02e7720d' } elseif ($environment -eq 'prod') { if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'prod' environment." } - $clusterGroup = 'rg-stress-cluster-prod' + $clusterGroup = 'SSS3PT_rg-stress-cluster-prod' $subscription = 'Azure SDK Test Resources - TME' $tenant = '70a036f6-8e4d-4615-bad6-149c02e7720d' } elseif ($environment -eq 'storage') { if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'storage' environment." } - $clusterGroup = 'rg-stress-cluster-storage' + $clusterGroup = 'SSS3PT_rg-stress-cluster-storage' $subscription = 'Azure SDK Test Resources - TME' $tenant = '72f988bf-86f1-41af-91ab-2d7cd011db47' } elseif (!$clusterGroup -or !$subscription -or $tenant) {