Skip to content

Commit e57f1aa

Browse files
authored
Fix HELM_DIFF_USE_UPGRADE_DRY_RUN to work for new installs (#370)
Fixes #369
1 parent 060d100 commit e57f1aa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/helm3.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
168168
return nil, fmt.Errorf("`diff upgrade --dry-run` conflicts with HELM_DIFF_USE_UPGRADE_DRY_RUN_AS_TEMPLATE. Either remove --dry-run to enable cluster access, or unset HELM_DIFF_USE_UPGRADE_DRY_RUN_AS_TEMPLATE to make cluster access unnecessary")
169169
}
170170

171+
if d.isAllowUnreleased() {
172+
// Otherwise you get the following error when this is a diff for a new install
173+
// Error: UPGRADE FAILED: "$RELEASE_NAME" has no deployed releases
174+
flags = append(flags, "--install")
175+
}
176+
171177
flags = append(flags, "--dry-run")
172178
subcmd = "upgrade"
173179
filter = func(s []byte) []byte {

0 commit comments

Comments
 (0)