Since Helm 4.2.0, null-valued keys defined directly in the top-level chart's
own values.yaml were being removed from `.Values` during coalescing. For
example:
```yaml
stuff:
foo: bar
baz: null
foobar: null
```
would render `{"stuff":{"foo":"bar"}}` instead of
`{"foobar":null,"stuff":{"baz":null,"foo":"bar"}}`.
The root cause is in `coalesceValues`: the nil-skipping and `cleanNilValues`
cleanup applied to `val == nil` keys was being applied unconditionally to the
top-level chart's own defaults, not just to subchart defaults.
This change restricts the nil cleanup to subchart coalescing (`prefix != ""`),
so null values defined directly in the top-level chart's values.yaml are now
preserved. Subchart default nils are still cleaned as before, retaining the
in-place delete behavior from the `cleanNilValues` path.
Adds a regression test covering both a top-level null key and a nested null
key. Restores the pre-4.2.0 behavior described in the issue.
Signed-off-by: waterWang
TestInstallRelease_Wait_Interrupted and
TestInstallRelease_RollbackOnFailure_Interrupted assert that the detached
installation goroutine has exited by sleeping a fixed 10s -- exactly the
FailingKubeClient WaitDuration the goroutine blocks on. Sleeping the same
duration the goroutine takes is a zero-margin race: if the goroutine
finishes a hair after the fixed sleep elapses (scheduler jitter under load),
getGoroutineCount() has not decremented yet and the assertion flakes.
Replace the fixed sleep + point-in-time assert with is.Eventually polling
getGoroutineCount() (30s ceiling, 10ms tick). It returns as soon as the
goroutine has actually finished and no longer races the exact wait
duration. Test-only; no change to install behavior.
Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
If the CLI-side description validation is removed, the unicode/utf8 import becomes unused and should also be dropped.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
Move description length validation to the beginning of Run(), before
IsReachable(), so programmatic callers get an immediate validation
error instead of a potentially misleading cluster reachability failure.
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
Remove duplicate rollback-with-description.txt fixture that had
identical content to rollback.txt.
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
Add a new --description flag to the helm rollback command that allows
users to specify a custom description explaining why the rollback was
performed. This description is stored in the release metadata.
Changes:
- Add Description field to the Rollback action struct
- Add --description flag to the rollback CLI command
- Add 512 character limit validation for the description
- Default to 'Rollback to <version>' when no description is provided
The description flag is optional and follows the same pattern used by
the install and upgrade commands.
Closes #XXXX
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>