Skip to content

Commit 67c09d9

Browse files
azure-sdkckairenbenbp
authored
Sync eng/common directory with azure-sdk-tools for PR 4944 (Azure#33052)
* Helm template for deploy script * Update eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 Co-authored-by: Ben Broderick Phillips <[email protected]> * fixing helm upgrade command Co-authored-by: Albert Cheng <[email protected]> Co-authored-by: Albert Cheng <[email protected]> Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 5143f19 commit 67c09d9

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

eng/common/scripts/stress-testing/deploy-stress-tests.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ param(
2626
# Override remote stress-test-addons with local on-disk addons for development
2727
[System.IO.FileInfo]$LocalAddonsPath,
2828

29+
# Renders chart templates locally without deployment
30+
[Parameter(Mandatory=$False)][switch]$Template,
31+
2932
# Matrix generation parameters
3033
[Parameter(Mandatory=$False)][string]$MatrixFileName,
3134
[Parameter(Mandatory=$False)][string]$MatrixSelection,

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function DeployStressTests(
9797
return $true
9898
})]
9999
[System.IO.FileInfo]$LocalAddonsPath,
100+
[Parameter(Mandatory=$False)][switch]$Template,
100101
[Parameter(Mandatory=$False)][string]$MatrixFileName,
101102
[Parameter(Mandatory=$False)][string]$MatrixSelection = "sparse",
102103
[Parameter(Mandatory=$False)][string]$MatrixDisplayNameFilter,
@@ -298,11 +299,13 @@ function DeployStressPackage(
298299
}
299300

300301
Write-Host "Installing or upgrading stress test $($pkg.ReleaseName) from $($pkg.Directory)"
301-
$result = (Run helm upgrade $pkg.ReleaseName $pkg.Directory `
302-
-n $pkg.Namespace `
303-
--install `
304-
--set stress-test-addons.env=$environment `
305-
--values (Join-Path $pkg.Directory generatedValues.yaml)) 2>&1
302+
303+
$generatedConfigPath = Join-Path $pkg.Directory generatedValues.yaml
304+
$subCommand = $Template ? "template" : "upgrade"
305+
$installFlag = $Template ? "" : "--install"
306+
$helmCommandArg = "helm", $subCommand, $pkg.ReleaseName, $pkg.Directory, "-n", $pkg.Namespace, $installFlag, "--set", "stress-test-addons.env=$environment", "--values", $generatedConfigPath
307+
308+
$result = (Run @helmCommandArg) 2>&1 | Write-Host
306309

307310
if ($LASTEXITCODE) {
308311
# Error: UPGRADE FAILED: create: failed to create: Secret "sh.helm.release.v1.stress-test.v3" is invalid: data: Too long: must have at most 1048576 bytes
@@ -324,12 +327,13 @@ function DeployStressPackage(
324327
# Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around
325328
# specific releases (thereby enabling filtering on `helm list`) is to label the underlying secret resources.
326329
# There is not currently support for setting these labels via the helm cli.
327-
$helmReleaseConfig = RunOrExitOnFailure kubectl get secrets `
330+
if(!$Template) {
331+
$helmReleaseConfig = RunOrExitOnFailure kubectl get secrets `
328332
-n $pkg.Namespace `
329333
-l "status=deployed,name=$($pkg.ReleaseName)" `
330334
-o jsonpath='{.items[0].metadata.name}'
331-
332-
Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId
335+
Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId
336+
}
333337
}
334338

335339
function CheckDependencies()

0 commit comments

Comments
 (0)