243 Commits
Author SHA1 Message Date
Johannes Lohmer 6eb4ebf0e1 test(values): add test for subchart nil producing %!s(<nil>)
Regression test for the Bitnami common.secrets.key issue.

Signed-off-by: Johannes Lohmer <jojo.dev@lohmer.com>
2026-04-13 20:09:47 +02:00
Terry Howe 8e44f8e3fe Merge pull request #31957 from Mentigen/add-mustToToml
feat(engine): add mustToToml template function
2026-03-24 06:16:46 +01:00
Ilya Kiselev c1a5a6e260 docs(engine): fix misleading toTOML doc comment
The toTOML doc comment said "returns empty string on marshal error"
but the implementation actually returns err.Error(). Fix the comment
to match the real behavior. Also mention mustToToml as the strict
alternative.

Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
2026-03-23 18:38:57 +03:00
Ilya Kiselev b075f7a35d feat(engine): add mustToToml template function
Add `mustToToml` that panics on marshal error, consistent with
`mustToYaml` and `mustToJson`. This makes it possible for chart authors
to get a hard failure when TOML serialization fails, rather than having
to inspect the output manually.

`toToml` behavior is unchanged in this commit.

Closes #31430

Signed-off-by: Ilya Kiselev <kis-ilya-a@yandex.ru>
2026-03-23 18:20:54 +03:00
Matthieu MOREL 7edfff33eb chore: fix unnecessary-format issues from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-03-23 07:07:27 +01:00
Matthieu MOREL 0fecfd04c2 chore(pkg): enable perfsprint linter
#### Description

enable perfsprint linter in pkg/cmd

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-26 18:55:55 +01:00
George Jenkins be7cdb69e5 Merge pull request #31806 from mmorel-35/errorlint-pkg-4-15f432a
fix(pkg): errorlint linter
2026-02-24 16:00:34 -08:00
George Jenkins b667317422 fixup strings.Cut variables
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2026-02-23 19:17:02 -08:00
George Jenkins 92b64e87ad chore: fixes
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2026-02-23 16:46:35 -08:00
Matthieu MOREL 4d0ae7f33a fix(pkg): errorlint linter
#### Description

errorlint linter in pkg

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-09 07:45:34 +01:00
Matthieu MOREL 111d4e6e0e chore(pkg): fix modernize linter
#### Description

fix modernize linter in pkg/chart/common/util

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-06 16:10:41 +01:00
Mads Jensen a18e59e465 Enable the sloglint linter
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-09 08:24:36 +01:00
Mads Jensen 6cceead399 Use modernize to use newer Golang features.
The rangeint suggestion is faster.
The maps.Copy and slices.Contains are just syntatic sugar.

Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-11-22 18:52:40 +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
wyrapeseed b9eadd3186 chore: fix some comment format
Signed-off-by: wyrapeseed <wyrapeseed@outlook.com>
2025-10-15 11:19:41 +08:00
Matt Farina 90a91e097f Merge pull request #31198 from TerryHowe/fix-pkg-engine-error-parsing
fix: replace pkg/engine regular expressions with parser
2025-09-16 13:57:40 -06:00
reddaisyy 1c67fbf108 refactor: use strings.builder
Signed-off-by: reddaisyy <reddaisy@outlook.jp>
2025-09-15 17:13:58 +08:00
Terry HoweandGeorge Jenkins b2870379c8 Update pkg/engine/engine.go
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-12 14:27:00 -06:00
Terry HoweandGeorge Jenkins 91a65234ac Update pkg/engine/engine.go
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-12 14:26:53 -06:00
Terry HoweandGeorge Jenkins 9112687a7e Update pkg/engine/engine.go
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-12 14:12:23 -06:00
bennsimon db50c37eda remove metadata output on helm template
Signed-off-by: bennsimon <bennsimonotieno@gmail.com>
2025-09-12 13:21:07 +03:00
Jesse Simpson 712cde4624 test: passes now
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-09-07 10:42:24 -04:00
Jesse Simpson b060911075 refactor: break out into functions and draft tests
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-09-06 11:36:39 -04: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
Terry Howe 284bd980b6 fix: replace pkg/engine regular expressions with parser
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-08-27 10:44:56 -06:00
Scott Rigby 069b525332 Merge pull request #13586 from jessesimpson36/cleaner-stacktraces
fix: add formatting for errors to make multiline stacktraces in helm templates
2025-06-03 21:37:54 -04:00
yetyear 03448d1d79 refactor: use maps.Copy for cleaner map handling
Signed-off-by: yetyear <flite@outlook.com>
2025-05-09 14:33:25 +08:00
George Jenkins a1f8802de9 Merge pull request #30553 from Zhanweelee/add_mustToYaml_support
feat: Add mustToYaml and mustToJson template functions
2025-05-06 20:56:40 -07:00
Jesse Simpson e0a67b1028 test: use more realistic unit-test scenario by not relying on Release.Name
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:27 -04:00
Jesse Simpson d10c5f6429 style: trim space from formatted error messages
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:27 -04:00
Jesse Simpson 0e0a8cc765 fix: address no-template-associated type of error
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:20:26 -04:00
Jesse Simpson 013f27c294 fix: use errors.New instead of fmt.Errorf
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 868cdc261f refactor: reduce flow-control operations
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 48922e21d1 refactor: use struct equality instead of comparing each composition
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson ac98e977c3 refactor: switch to while loop instead of for to reduce unnecessary variables
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 65084371c9 refactor: replace if MatchString with FindStringSubMatch
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 782f6c6409 refactor: shorten regex subexp syntax
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 4b9a9ecaf6 refactor: rename function and add doc-string
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 4f63c73353 refactor: remove impractical safety check
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 5202820f2f refactor: define regexs at package scope
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson cbdc22128e refactor: use strings.Builder instead of string concatenation
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson cdcf1bc601 style: remove unnecessary break
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 3cc4cb60ba refactor: prevent duplicates being inserted rather than post-filtering
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson deea4a0d0e refactor: remove more unnecessary format calls
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 13b232e061 refactor: make use of regexs for err parsing
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson daf4c34879 fix: use originalErr instead of formatting original error
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 98da3e28b6 fix: add some index checking and fixed a test that relied on type-checking
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 80d7a1b33f style: make format
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 487f72b822 fix: added protection against while-true condition in unbounded for loop
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00
Jesse Simpson 6bb836374b test: adjusted to make it more meaningful and to pass
Signed-off-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-04-24 19:17:28 -04:00