Commit graph

8251 commits

Author SHA1 Message Date
Benoit Tigeot
7fe554e7a8
Fix naked return errors
> xinternal/third_party/dep/fs/fs.go:175:3: naked return in func `copyFile` with 59 lines of code (nakedret)

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:36:16 +02:00
Benoit Tigeot
d878548168
Migrate golint to v2
```
WARN The configuration comments are not migrated.
WARN Details about the migration: https://golangci-lint.run/product/migration-guide/
WARN The configuration `run.timeout` is ignored. By default, in v2, the timeout is disabled.
```

I've backported comment and timeout

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:28:19 +02:00
Benoit Tigeot
18ed1cf720
Migrate to last golangci-lint and golangci-lint-action
Close dependabot https://github.com/helm/helm/pull/30706

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-14 10:28:18 +02:00
Robert Sirchia
5f1bb7fee8
Merge pull request #30751 from benoittgt/add-missing-ready-logs
Add detailed debug logging for resource readiness states
2025-04-13 18:33:40 -04: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
Robert Sirchia
90608174c5
Merge pull request #30741 from benoittgt/bump-distribution-v4
Bumps github.com/distribution/distribution/v3 from 3.0.0-rc.3 to 3.0.0
2025-04-11 15:53:39 -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
8c6c0d8a37
Merge pull request #30686 from mattfarina/remove-deprecated-code
Remove deprecated code
2025-04-11 19:34:47 +01:00
Benoit Tigeot
365340b092
Follow distribution package requirement
go: github.com/distribution/distribution/v3@v3.0.0 requires go >= 1.23.7; switching to go1.23.8
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-11 16:05:08 +02:00
Benoit Tigeot
0d43534ab7
Testing without bump go version
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-11 15:59:42 +02:00
Benoit Tigeot
00db8d6d96
Go mod tidy
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-11 11:02:05 +02:00
Benoit Tigeot
483789ac86
Bumps github.com/distribution/distribution/v3 from 3.0.0-rc.3 to 3.0.0
```
» go mod download
go: module github.com/distribution/distribution/v3@v3.0.0 requires go >= 1.23.7; switching to go1.23.8
```

We need to update Go, because of https://github.com/distribution/distribution/pull/4601

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-11 11:00:49 +02: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
7f02e89a7a
No longer log call location using flag, it will need to be done in slog
Some ideas here: https://www.reddit.com/r/golang/comments/15nwnkl/achieve_lshortfile_with_slog/

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-10 16:13:32 +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
Matt Farina
bbf6a91454
Merge pull request #30730 from helm/dependabot/go_modules/main/golang.org/x/crypto-0.37.0
build(deps): bump golang.org/x/crypto from 0.36.0 to 0.37.0
2025-04-09 16:35:42 +01:00
dependabot[bot]
db76da32ac
build(deps): bump golang.org/x/crypto from 0.36.0 to 0.37.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.37.0.
- [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-09 15:18:18 +00:00
Robert Sirchia
748b78ee84
Merge pull request #30736 from robertsirc/updating-go-mod
manually updating go.mod file
2025-04-09 11:11:05 -04:00
Robert Sirchia
b29bc3a44d
manually updating go.mod file
Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2025-04-09 09:43:19 -04: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
3e4e78378e
Go the slog way
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 17:49:03 +02:00
Benoit Tigeot
6ce967391d
Trick slog to return the full error
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
Benoit Tigeot
83a5a14826
Properly discard by default logs
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 16:47:26 +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
947658a96e
Explain why we ignore the timestamp
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:54 +02:00
Benoit Tigeot
3db7ebc591
Fix missing logger to SQL in test
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:54 +02:00
Benoit Tigeot
15de13f9d2
Fix linting issue and temporary removing logging in test acion
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-04-07 15:36:54 +02:00