Commit graph

21 commits

Author SHA1 Message Date
Evans Mungai
5b78ee8dff
Merge pull request #31644 from banjoh/em/fix-nil-values
Some checks failed
build-test / build (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
golangci-lint / golangci-lint (push) Has been cancelled
release / release (push) Has been cancelled
release / canary-release (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
fix(values): preserve nil values when chart default is empty map
2026-01-31 13:03:55 +00:00
Evans Mungai
0298b2ffd0
Remove refactorring changes from coalesce_test.go
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2026-01-07 13:16:11 +00:00
Evans Mungai
b8937ad192
Fix import
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2026-01-07 12:58:21 +00:00
Evans Mungai
a333bbaf27
Update pkg/chart/common/util/coalesce_test.go
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2026-01-07 12:51:47 +00:00
Branch Vincent
c6d9a5bdc2 build: set kube version via debug.BuildInfo
Signed-off-by: Branch Vincent <branchevincent@gmail.com>
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-12-19 21:13:47 -08:00
Evans Mungai
3416dd5f21
Fix lint warning
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-12-12 17:09:18 +00:00
Evans Mungai
679f051980
Preserve nil values in chart already
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-12-12 17:00:18 +00:00
Evans Mungai
292fe70219
fix(values): preserve nil values when chart default is empty map
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>
2025-12-12 16:32:32 +00:00
George Jenkins
3165e5463a
Merge pull request #31528 from benoittgt/31423-git-version
fix: preserve vendor suffixes in KubeVersion.GitVersion
2025-12-08 08:35:56 -08:00
Matt Farina
63858b383f
Merge pull request #31535 from mattfarina/bump-4.1
bump version to 4.1
2025-11-20 11:13:03 -05:00
Matt Farina
63e060fb05
bump version to 4.1
Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-11-19 12:49:49 -05:00
shuv0id
2dc5864f44 fix: add missing context to debug logs
Adds chart name to dependency logs, namespace to resource waiting logs,
and confirmation message when all resources are ready.

Addresses #31520

Signed-off-by: shuv0id <110290476+shuv0id@users.noreply.github.com>
2025-11-18 22:25:34 +05:30
Benoit Tigeot
ce273eea48
fix: preserve vendor suffixes in KubeVersion.GitVersion
Helm 3.19.0 introduced a regression where vendor-specific suffixes
(e.g., -gke.1245000, -eks-4096722, +) are stripped from
.Capabilities.KubeVersion.GitVersion, breaking charts that detect
managed Kubernetes platforms.

The root cause was using k8sversion.ParseGeneric().String() which
intentionally discards vendor suffixes. The fix stores both the full
version (with vendor suffix) and a normalized version. String() returns
the normalized version for constraint checking (e.g., ">= 1.21.0"),
while Version/GitVersion preserve the full string for template access.

Fixes #31423
Related to #31063, #31078

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-18 15:28:16 +01:00
Scott Rigby
b740071279
Merge pull request #31342 from TerryHowe/chore-remove-mitchellh-dependency-3
chore: replace github.com/mitchellh/copystructure
2025-11-14 15:26:10 -05:00
Benoit Tigeot
97b7a1c9ae
Merge branch 'main' into fix-31170-URN
Signed-off-by: Benoit Tigeot <benoittgt@users.noreply.github.com>
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-10-30 16:07:34 +01:00
Matt Farina
ca8eae9361
Reproducible chart archive builds
Building the same chart into an archive multiple times will have
the same sha256 hash.

Perviously, the time in the headers for a file was time.Now() which
changed each time. The time is now collected from the operating
system when the file is loaded and this time is used.

Fixes: #3612

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-10-29 11:49:22 -04:00
Terry Howe
bee9c1a108
chore: replace github.com/mitchellh/copystructure
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-29 10:30:08 -06:00
Benoit Tigeot
939fff9cb9
Avoid "panic: interface conversion: interface {} is nil"
Closes: #31202
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-09-07 16:45:32 +02:00
Benoit Tigeot
8025a397e6
Ignore duplicated URN in logs
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-09-04 15:53:07 +02:00
Benoit Tigeot
03bb62f63d
jsonschema: warn and ignore unresolved URN $ref to match v3.18.4
- 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).
- Apply to pkg/chart/v2 and internal/chart/v3 validators. Not sure about
  that

Note: external URNs need AddResource/Resolver (the CLI uses --map for
this). Warning may appear twice since both validators run.

Another strategy could be to add the option to import more "external
schema" explicitly but it is another PR. Something similar to `--map`
from jsonschema package
(santhosh-tekuri/jsonschema@ed65924).

Close: #31170

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-09-04 15:45:17 +02:00
Matt Farina
9dcc49cbd5 Move lint pkg to be part of each chart version
Linting is specific to the chart versions. A v2 and v3 chart will
lint differently.

To accomplish this, packages like engine need to be able to handle
different chart versions. This was accomplished by some changes:

1. The introduction of a Charter interface for charts
2. The ChartAccessor which is able to accept a chart and then
   provide access to its data via an interface. There is an
   interface, factory, and implementation for each version of
   chart.
3. Common packages were moved to a common and util packages.
   Due to some package loops, there are 2 packages which may
   get some consolidation in the future.

The new interfaces provide the foundation to move the actions
and cmd packages to be able to handle multiple apiVersions of
charts.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-02 12:14:37 -04:00