Commit graph

3094 commits

Author SHA1 Message Date
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
Scott Rigby
599fad1864
Merge pull request #30697 from p-se/fix-take-ownership
Fix --take-ownership for custom resources - closes #30622
2025-04-17 11:54:11 -04:00
Evans Mungai
1f5605a405
fix formatting errors
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-04-17 15:33:21 +01:00
Benoit Tigeot
d33e2896f0
Prevent failures with method signatures on hooks
changes on wait strategy. This PR try to fix linting and tests.

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-17 12:37:37 +02:00
Scott Rigby
e397f44840
Merge pull request #30673 from nvanthao/process-all-hook-deletions-on-failure
fix: Process all hook deletions on failure
2025-04-16 17:21:28 -04:00
Matt Farina
01590a59b2
Merge pull request #30760 from robertsirc/add-debuging-to-jsonschema
adding slog debug to a few points
2025-04-16 21:10:22 +01:00
Robert Sirchia
8733103743
Merge pull request #30718 from klihub/fixes/package/multiple-charts-single-passwd-from-stdin
Allow signing multiple charts with a single passphrase from stdin.
2025-04-16 16:07:44 -04:00
Robert Sirchia
da096e1b7a
Merge pull request #30752 from benoittgt/bump-golangci-lint-action
Bump golangci lint to last major version and fix static-check errors
2025-04-16 15:50:55 -04:00
Robert Sirchia
ef0361de21
fixing as per review
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-04-16 15:26:44 -04:00
Robert Sirchia
9b9ff12c6d
adding slog debug to a few points
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-04-16 11:36:05 -04:00
Krisztian Litkey
3102c28804
fix: allow signing multiple charts with passphrase from stdin.
Cache the signing key passphrase. When signing multiple charts
with the passphrase from stdin, this allows signing all charts
instead of all but the first failing with an error about stdin
already having been closed.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2025-04-16 18:05:36 +03:00
Evans Mungai
e8e79cc4b4
Merge branch 'main' into fix-take-ownership
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-04-15 04:46:17 -06:00
Evans Mungai
7c37a109f2
Add install test for TakeOwnership flag
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-04-15 11:24:12 +01:00
Matt Farina
0dffc580b0
Simpligy the JSON Schema checking
A new library was introduced that provides JSON Schema checking for
newer versions of the schema. In Helm v4, there is no need to have
two packages doing the JSON schema validation. The message output
can have breaking changes.

This change moves everything to the newer library. It also uses a
wrapper error to enable a clean Helm only interface for the
public Go API validation functions. This would enable the replacement
of the Schema validation library, if needed, without breaking the
Go API contract.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-14 19:32:01 -04:00
Matt Farina
55a4fc121b
Merge pull request #13283 from win-t/jsonschema
adding support for JSON Schema 2020
2025-04-14 19:52:03 +01:00
Benoit Tigeot
a1c2f47c08
avoid using reflect.DeepEqual with errors
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 11:11:37 +02:00
Benoit Tigeot
eb65ce280b
could apply De Morgan's law
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 11:11:37 +02:00
Benoit Tigeot
374805deb4
error strings should not be capitalized
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 11:11:37 +02:00
Benoit Tigeot
1654664b78
could use strings.ReplaceAll instead
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:51:26 +02:00
Benoit Tigeot
a6d0335bbb
Use fmt.Fprintf(...) instead of ...
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:49:49 +02:00
Benoit Tigeot
a9b7732367
could remove embedded field X from selector
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:43:48 +02:00
Kurnia D Win
6c54351c01 Merge remote-tracking branch 'upstream/main' into jsonschema 2025-04-13 13:38:25 +07:00
Benoit Tigeot
f5aec508f5
Add detailed debug logging for resource readiness states
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-12 09:58:56 +02:00
Scott Rigby
9a670ae920
Merge pull request #30701 from zanuka/30617-request-for-helm-install-order-doc-update
updates mutate and validate web hook configs
2025-04-11 16:56:39 -04:00
Scott Rigby
0cecd910e5
Merge pull request #30713 from gjenkins8/gjenkins/rm_helmv2_template_lint_rules
cleanup: Remove Helm v2 template lint rules
2025-04-11 16:35:52 -04:00
Matt Farina
a536832714
Merge pull request #30749 from mattfarina/fix-alpine-chart
Removing the alpine test chart
2025-04-11 21:07:41 +01:00
Robert Sirchia
f5decfc28d
Merge pull request #30737 from rpolishchuk/investigation-pr-30610
fix: order dependent test
2025-04-11 16:06:45 -04:00
Matt Farina
91ecb56355
Removing the alpine test chart
A .gitignore was previously setup to ignore this file. When pkg/cmd
was setup the .gitignore was not updated. The change adds the new
location to continue to ignore this file.

Note, the previous location is still included in the .gitignore
because developers will have a file there and we do not want that
accidently included in a commit.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-11 16:01:49 -04: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
ed005f5c32
Removing deprecation notice for this function.
While the constructor is not used by Helm itself, it is used by SDK
users and there is currently no alternative way to expose this.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-10 13:45:02 -04: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
c05bcbd498
Fix nil pointer dereference in ready test
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 16:40:05 +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
6b5fa33633
debug log level is dynamic and set after Logger creation
So we should use dynamic handler to set the log level after. With this
patch we can clearly see the output. Before we were always stuck in log
level "info" and not seeing debug log level

```
bin/helm upgrade --install --debug --wait frontend \
--namespace test \
--set replicaCount=2 \
--set backend=http://backend-podinfo:9898/echo \
podinfo/podinfo
level=DEBUG msg="getting history for release" release=frontend
level=DEBUG msg="preparing upgrade" name=frontend
level=DEBUG msg="performing update" name=frontend
level=DEBUG msg="creating upgraded release" name=frontend
level=DEBUG msg="checking resources for changes" resources=2
level=DEBUG msg="no changes detected" kind=Service name=frontend-podinfo
level=DEBUG msg="patching resource" kind=Deployment name=frontend-podinfo namespace=test
level=DEBUG msg="waiting for resources" count=2 timeout=5m0s
level=DEBUG msg="waiting for resource" name=frontend-podinfo kind=Deployment expectedStatus=Current actualStatus=Unknown
level=DEBUG msg="updating status for upgraded release" name=frontend
Release "frontend" has been upgraded. Happy Helming!
NAME: frontend
LAST DEPLOYED: Thu Apr 10 09:56:25 2025
NAMESPACE: test
STATUS: deployed
REVISION: 6
DESCRIPTION: Upgrade complete
```

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 10:03:13 +02:00
Rostyslav Polishchuk
55eb53e3a0 fix: order dependent test
TestInstallRelease_Atomic_Interrupted needs the same wait
as TestInstallRelease_Wait_Interrupted (see helm/helm#12088).

The installation goroutine started by
TestInstallRelease_Atomic_Interrupted proceeds in the background and
may interfere with other tests (see helm/helm#30610)

Also see helm/helm#12086 and helm/helm#12109 which are describe and address the root
cause.

Signed-off-by: Rostyslav Polishchuk <rostyslavp@google.com>
2025-04-10 01:32:58 +00:00
Matt Farina
d8ca55fc66
Merge commit from fork
Fix for DOS when unarchiving charts
2025-04-09 18:05:03 +01:00
Mike Delucchi
e1425f1aa5 fix: correct webhook order to match Kubernetes admission flow
Place APIService before webhooks, with MutatingWebhookConfiguration
before ValidatingWebhookConfiguration to match standard admission control.

Signed-off-by: Mike Delucchi <git@zanuka.com>
2025-04-08 19:05:55 -07:00
Mike Delucchi
1003a3c93f fixes kind_sorter_test to match new order
Signed-off-by: Mike Delucchi <git@zanuka.com>
2025-04-08 19:05:55 -07:00
Mike Delucchi
c121b6b83e changes order of operations
Signed-off-by: Mike Delucchi <git@zanuka.com>
2025-04-08 19:05:55 -07:00
zanuka
9b636902c6 updates mutate and validate web hook configs
Signed-off-by: Mike Delucchi <git@zanuka.com>
2025-04-08 19:05:55 -07:00
Matt Farina
0740dfc7a9
Unarchiving fix
Signed-off-by: Matt Farina <matt@mattfarina.com>
2025-04-08 17:15:01 -04:00
Scott Rigby
5442c6b9cb
Merge pull request #9318 from wahabmk/fix-httpgetter
Fix issue with helm pull failing if pulling from a repository that redirects to another domain
2025-04-07 18:58:33 -04: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
5c746037b3
Prevent redefining verbose flags
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 18:01:42 +02:00
Benoit Tigeot
710770eed4
Linting
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 17:49:03 +02:00
Benoit Tigeot
5580f61157
Properly reproduce the nopLogger as before
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 17:48:57 +02:00
Benoit Tigeot
baa597c567
Do not remove the functionality to print log in test
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 17:02:18 +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