Signed-off-by: shenpeng.sp0916 <shenpeng.sp0916@bytedance.com>
Backport the fix from #31578 to dev-v3 branch.
The installCRDs function previously could panic in several scenarios:
- When a CRD object has a nil File field (accessing obj.File.Data)
- When a CRD object has nil File.Data (passing nil to KubeClient.Build)
- When KubeClient.Build returns an empty resource list (accessing res[0])
- When RESTClientGetter is nil (calling ToDiscoveryClient/ToRESTMapper)
Added nil and empty checks to return descriptive errors instead of
panicking in all these cases.
Closes#31552
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: shenpeng.sp0916 <shenpeng.sp0916@bytedance.com>
Only delete nil user values when overriding a non-nil chart default.
When chart has empty map or no default for a key, preserve user's nil.
| Scenario | Result |
|----------|--------|
| User sets `baz: ~`, chart has `baz: "value"` | Key deleted |
| User sets `baz: ~`, chart has empty map `{}` | Nil preserved |
| User sets `baz: ~`, chart has `baz: ~` | Nil preserved |
Fixes#31643
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
This ensures that when `helm uninstall` is run with `--keep-history`
any release in a `deployed` state other than the last release (e.g.
due to a failed upgrade) is being marked as `superseded`.
As a by-effect, running `helm upgrade` on a release which has been
uninstalled after an upgrade failure now no longer works. But instead
fails with a `"<name>" has no deployed releases` error. Which is the
(likely) intended behavior, and prevents other side-effects like
rolling back to a release version which happened before the uninstall
if `--atomic` (or `--rollback-on-failure`) was provided.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
(cherry picked from commit 2f1ecc7100)
- v3.18.5 switched jsonschema and began resolving external $ref
at compile-time, exposing missing urn handling
(“no URLLoader registered for urn:…”).
- Add urn scheme loader and pluggable URNResolver. If unresolved, log
a warning and return a permissive true schema (back-compat).
- Avoid having a duplicated warn logs when we Load the schema twice.
Note: external URNs need AddResource/Resolver (the CLI uses --map for
this).
Close: #31170
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
The existing check worked for `helm pull downloaded-repo/chart-name`,
but often does not work when using `--repo-url`, depending on the urls
used by the charts.
Signed-off-by: Luna Stadler <luc@spreadshirt.net>