Commit graph

122 commits

Author SHA1 Message Date
Terry Howe
d28853e206
Merge pull request #31624 from atombrella/feature/sloglint
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
govulncheck / govulncheck (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Enable the `sloglint` linter
2025-12-12 08:04:45 -07: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
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
Evans Mungai
2ddeb50fa6
Set default logger in Configuration constructor
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-23 18:09:58 +01:00
Evans Mungai
a112bf5aa6
Remove non-reachable code
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-23 09:53:25 +01:00
Evans Mungai
aed687eaa1
Add config options to NewConfiguration()
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 19:18:32 +01:00
Evans Mungai
b6eca1c0f1
Refactor logging functionality to use slog.Handler
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 15:26:48 +01:00
Evans Mungai
5ab4ca5490
Embed logging functionality to DRY code
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 13:55:12 +01:00
Evans Mungai
9c32e34d60
Add logger to sql driver and ensure storage has logger
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 13:29:37 +01:00
Evans Mungai
50e43f4017
nil logger should be handled by discard handler
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 00:40:03 +01:00
Evans Mungai
7a5816b106
Self review changes
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-21 23:53:09 +01:00
Evans Mungai
b1d4dc680d
feat: reinstate logger parameter to actions package
Fixes: #31399

Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-21 22:48:51 +01:00
Matt Farina
f80cbe43d0 Moved release objects to enable versioning
Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-10-10 11:49:08 -04:00
George Jenkins
f21b143bef refactor: Replace action 'DryRun' string with DryRunStrategy type + deprecations
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-09-21 08:03:02 -07:00
Terry Howe
3e1dd9a5dc
chore: remove pkg/time which is no longer needed
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-15 12:29:35 -06: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
Matt Farina
6f957f4922 Move the release util to the versioned directory
The release util package is directly related to the v1 of
releases and uses the v1 of releases.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-02 10:13:55 -04:00
Scott Rigby
591d863df5
Move Postrenderer to a plugin type
Fix/add back postrenderer args unit tests

Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-31 19:03:34 -05:00
George Jenkins
934f761e08
Merge pull request #30812 from gjenkins8/gjenkins/chartrelease_server_side_apply
HIP-0023: Helm support server-side apply
2025-08-26 18:52:15 -07:00
Scott Rigby
be74ab72a0
[HIP-0026] Plugin runtime interface (#31145)
* Runtime abstraction to encapsulate subprocess code and enable future runtimes

Also fix race condition in TestPrepareCommandExtraArgs by replacing the shared variable modification with a local copy

Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

* Remove commented out code

Co-authored-by: Joe Julian <me@joejulian.name>
Signed-off-by: Scott Rigby <scott@r6by.com>

* Check test failure string

Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

---------

Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Co-authored-by: Joe Julian <me@joejulian.name>
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-08-22 16:12:49 -04:00
George Jenkins
e2dcbe28bf Helm client/SDK support server-side apply
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-08-18 10:05:07 -07:00
Carlos Lima
6991a0a531 Make annotateAndMerge deterministic
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
c01e76b5c3 review: change annotation name to postrenderer.helm.sh/postrender-filename
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
a1416cf225 review: style changes
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
859721bd77 review: rewrite error messages from the end-user perspective
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
b26b473bf6 review: make splitAndDeannotate private
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
855b5a44b7 review: make annotateAndMerge private
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
1d993f9e2d review: make filenameAnnotation private
Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Carlos Lima
e6362d74c8 Allow post-renderer to process hooks
This annotates and merges all manifests before sending to the
postrender, reversing the process and recovering the filenames
afterwards.

closes #7891

Signed-off-by: Carlos Lima <carlos@cpan.org>
2025-07-02 23:34:39 +08:00
Terry Howe
a8cbf3aa51 fix: action hooks delete policy mutex
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-05-30 08:12:20 -04:00
Justen Stall
280a9ddbdb
Merge branch 'main' into stdlib-errors-2
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-21 12:13:10 -04:00
Stepan Paksashvili
5c2f89307d feat(pkg/engine): and custom funcs to action config
Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
2025-04-18 10:29:56 +03:00
Stepan Paksashvili
9073bcf53e feat(pkg/engine): add support for custom template funcs
Enhances the template engine and action config to allow users to inject custom template functions via an action config when using Helm as a library.

Closes #30733

Signed-off-by: Stepan Paksashvili <stepan.paksashvili@flant.com>
2025-04-18 10:29:56 +03:00
Matt Farina
7a1eb77e77
Merge pull request #30708 from benoittgt/migrate-kube-pkg-to-slog
Migrate pkg to slog
2025-04-11 20:50:34 +01:00
Matt Farina
7938662f95
Remove ValidName regex
This regex was already deprecated.

Validation happens inside the Metadata Validate function for the
name instead of using this regex.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-10 13:30:48 -04:00
Benoit Tigeot
68440d7b29
Prefer using slog.Any when displaying errors
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 17:40:28 +02:00
Benoit Tigeot
e7eedae97c
Use the logger with proper handling of dynamic debug on 2 locations
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 16:02:05 +02:00
Benoit Tigeot
cbaac7652d
Call slog directly instead of using a wrapper
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 15:35:36 +02:00
Benoit Tigeot
0c85456788
Leverage slog.Any for errors
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 18:26:48 +02:00
Benoit Tigeot
b6adbbb227
Enforce error style with others
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 16:50:10 +02:00
Benoit Tigeot
b2380720eb
Migrate to pure slog without a custom wrapper
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 16:46:08 +02:00
Benoit Tigeot
83cdffe4ae
Migrate to a dedicated internal package for slog adapter + migrate more
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:36 +02:00
Benoit Tigeot
fae2345edf
Demonstrate the impact of having Logger defined in kube package
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:15 +02:00
Benoit Tigeot
ede73860c1
Fix call to kube log
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:15 +02:00
Benoit Tigeot
f4631bf3d8
Migrate kube package to slog
As for helm v4. We want to migrate logs to slog.

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:35:20 +02:00
Matt Farina
e711488970
Move pkg/release to pkg/release/v1 to support v3 charts
This is part of HIP 20 which provides a means to have v3 charts
that live alongside v2 charts while having breaking changes.

The plan is to have a different release object for v3 chart
instances for at least a couple reasons:
1. So that the chart object on the release can be fundamentally
   different.
2. So that Helm v3 does not detect or try to work with instances
   of charts whose apiVersion it does not know about.

Note: it is expected that Helm v3 usage will be used long after
the Helm project no longer supports it. 5 years after Helm v2
had reached end-of-life there was still usage of it.

Note: The release util package is separate from the versioned
elements as it is planned to use generics to handle multiple
release object versions.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-26 10:14:15 -05:00
Matt Farina
61d3eca55c
Move pkg/chart to pkg/chart/v2 to prepare for v3 charts
This change moves the code, updates the import locations, and
adds a doc.go file to document what the v2 package is for.

This is part of HIP 20 for v3 charts

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-25 15:20:44 -05:00
Matt Farina
18ca7c1002
Move pkg/releaseutil to pkg/release/util
The releaseutil package was originally designed to work against a
generated codebase from a protobuf in Helm v2. This is when Helm
used gRPC to communicate to a server side component named Tiller.
When Helm moved everything client side, this package remained and
it supported the release package.

This change moves releaseutil to be a sub-packge of release. This
is part of the change to support apiVersion v3 charts which is
documented in HIP 20

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-24 14:58:51 -05:00
Scott Rigby
2cda65d444
Merge pull request #10309 from Bez625/main
Add hook annotation to output hook logs to client on error
2025-02-21 18:12:16 -05:00
Matt Farina
5c0deec327
Moving chartutil to chart/util
chartutil was originally created to operate on protobufs which are
no longer part of Helm. The util package makes more sense to be
part of the chart package.

This change is part of the HIP 20 to create v3 charts and
explicitly call out v2 charts. The changes for this are in smaller
bite size changes.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-21 15:25:55 -05:00