Skip to content

Commit 2b760bf

Browse files
azure-sdkbenbp
andauthored
Warn user when helm fails due to large files not being ignored (Azure#32425)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent 52f7a74 commit 2b760bf

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ function DeployStressTests(
162162
-login:$login
163163
}
164164

165-
Write-Host "Releases deployed by $deployer"
166-
Run helm list --all-namespaces -l deployId=$deployer
165+
if ($FailedCommands.Count -lt $pkgs.Count) {
166+
Write-Host "Releases deployed by $deployer"
167+
Run helm list --all-namespaces -l deployId=$deployer
168+
}
167169

168170
if ($FailedCommands) {
169171
Write-Warning "The following commands failed:"
@@ -287,17 +289,27 @@ function DeployStressPackage(
287289
}
288290

289291
Write-Host "Installing or upgrading stress test $($pkg.ReleaseName) from $($pkg.Directory)"
290-
Run helm upgrade $pkg.ReleaseName $pkg.Directory `
291-
-n $pkg.Namespace `
292-
--install `
293-
--set stress-test-addons.env=$environment `
294-
--values (Join-Path $pkg.Directory generatedValues.yaml)
292+
$result = (Run helm upgrade $pkg.ReleaseName $pkg.Directory `
293+
-n $pkg.Namespace `
294+
--install `
295+
--set stress-test-addons.env=$environment `
296+
--values (Join-Path $pkg.Directory generatedValues.yaml)) 2>&1
297+
295298
if ($LASTEXITCODE) {
296-
# Issues like 'UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress'
297-
# can be the result of cancelled `upgrade` operations (e.g. ctrl-c).
298-
# See https://github.com/helm/helm/issues/4558
299-
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'"
300-
return
299+
# 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
300+
# Error: UPGRADE FAILED: create: failed to create: Request entity too large: limit is 3145728
301+
if ($result -like "*Too long*" -or $result -like "*Too large*") {
302+
$result
303+
Write-Warning "*** Ensure any files or directories not part of the stress config are added to .helmignore ***"
304+
Write-Warning "*** See https://helm.sh/docs/chart_template_guide/helm_ignore_file/ ***"
305+
return
306+
} else {
307+
# Issues like 'UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress'
308+
# can be the result of cancelled `upgrade` operations (e.g. ctrl-c).
309+
# See https://github.com/helm/helm/issues/4558
310+
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'"
311+
return
312+
}
301313
}
302314

303315
# Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around

0 commit comments

Comments
 (0)