Commit graph

368 commits

Author SHA1 Message Date
Orgad Shaneh
df8757a6c8
Merge 3575c04de7 into 5b78ee8dff 2026-02-01 12:06:04 -05:00
Orgad Shaneh
3575c04de7 fix(downloader): prevent concurrent file access errors on Windows
When DownloadTo runs in parallel for the same ref and version, both
processes try to write the same target file, causing "Access Denied"
errors on Windows.

This change refactors the file locking mechanism based on maintainer
feedback:
- Add LockedAtomicWriteFile to internal/fileutil package to encapsulate
  locking logic
- Use the new function for both chart and provenance files
- Lock is cross-process safe and automatically released on process exit
- Files are only written if they don't already exist (avoiding
  duplicate work)

The TestParallelDownloadTo test verifies the fix works correctly.

Fixes #31633

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
2026-01-25 11:42:19 +02:00
Philipp Born
e3829ebbbb
fix(copystructure): handle nil elements in slice copying
When copying slices containing nil interface{} elements, the copyValue
function would panic with 'reflect: call of reflect.Value.Set on zero
Value'. This occurred because reflect.ValueOf(nil) returns a zero Value
that cannot be set.

This issue was introduced in v4.1.0 when replacing mitchellh/copystructure
with an internal implementation. The fix mirrors the existing nil handling
logic used for map values.

Fixes helm template panic when processing charts with YAML like:
  extraArgs:
    -

Added test case to verify slice elements with nil values are properly
handled during deep copy operations.

Signed-off-by: Philipp Born <git@pborn.eu>
2026-01-22 18:28:05 +01:00
Terry Howe
429ce93848
Merge pull request #31613 from aslafy-z/feat/getter-env
Some checks failed
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (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
govulncheck / govulncheck (push) Has been cancelled
fix(getter): pass settings environment variables
2026-01-07 07:41:31 -07:00
Gergely Brautigam
138f730aac
fix: typo in the function names
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
2025-12-31 07:46:52 +01:00
George Jenkins
f05c21b6b6
Merge pull request #31296 from gjenkins8/gjenkins/runtime_kube_version
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
build: set kube version via `debug.BuildInfo`
2025-12-22 19:15:22 -08:00
Brenden Ehlers
1c119bcaa6 fix: add default casess to switch statements
Signed-off-by: Brenden Ehlers <brenden@theehlers.org>
2025-12-21 09:13:24 -07: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
Matt Farina
4d1150d2af
Merge pull request #31415 from banjoh/em/increase-logging-test-coverage
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
chore: increase logging test coverage
2025-12-17 15:56:17 -05:00
Mads Jensen
a490bb3c20 Use errors.Is to check for io.EOF and gzip.ErrHeader
In GoLang, using the == operator to check for a certain error will not
unwrap the error chain, and therefore may hide the problem.

Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-14 08:54:11 +01:00
Terry Howe
b52b6615f0
Merge pull request #31207 from zyfy29/delete-unused-var
chore: delete unused var in installer.go
2025-12-13 08:27:37 -07:00
Robert Sirchia
4cf7d8d025
Merge pull request #31641 from wangjingcun/main
chore: fix some comments to improve readability
2025-12-12 19:34:20 +01:00
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
Terry Howe
642462e9fe
Merge pull request #11991 from twz123/no-bash-in-testscripts
Make test scripts run without /bin/bash
2025-12-12 07:57:37 -07:00
wangjingcun
858cf31583 chore: fix some comments to improve readability
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
2025-12-12 12:01:35 +08: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
Zadkiel AHARONIAN
119341dca7
fix(getter): pass settings environment variables
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
2025-12-07 17:08:29 +01:00
Matt Farina
ff35414bed
Merge pull request #31546 from benoittgt/31544-nil-pointer
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(lint): prevent segmentation violation on only comment yaml in multidoc
2025-12-01 09:15:14 -05:00
Scott Rigby
4d54bea5ff
Merge pull request #31491 from benoittgt/31490-plugin-name-helper
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
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
feat: improve plugin name validation error messages and field name detection (v1)
2025-11-25 11:49:58 -05:00
Benoit Tigeot
81d244ca21
fix: prevent segmentation violation on empty yaml in multidoc
Fixes: https://github.com/helm/helm/issues/31544

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-20 20:59:53 +01: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
Benoit Tigeot
71591ee63e
style: linting
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-16 12:21:45 +01:00
Benoit Tigeot
b296cbef6c
test: split tests between valid and invalid
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-16 11:49:08 +01:00
Benoit Tigeot
9b242dd9ed
test: convert tests to table drive tests
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-16 11:44:49 +01:00
Benoit Tigeot
c81a09b89a
test: refactor TestMetadataLegacyValidate to be more generic
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-16 11:37:18 +01:00
yxxhero
8c87024860 update tests
Signed-off-by: yxxhero <aiopsclub@163.com>
2025-11-16 10:05:27 +08:00
yxxhero
2d49f0cb4a Refactor environment variable expansion in PrepareCommands and update tests
Signed-off-by: yxxhero <aiopsclub@163.com>
2025-11-15 11:16:08 +08: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
acf331a005
fix: improve plugin name validation err messages early via unmarshalling
- Add strict YAML unmarshalling for v1 plugins (d.KnownFields)
- Add comprehensive test coverage for validPluginName regex
- Maintain backwards compatibility for legacy plugins

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 16:21:37 +01:00
Benoit Tigeot
9e1e3d21c5
fix: Make invalid name error message more similar and move tests
Follow Scott comment\
https://github.com/helm/helm/pull/31491/files#r2524933784

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 16:13:23 +01:00
Benoit Tigeot
cf077ceb27
fix: focus only on plugin name but give more info about what we get
And improve test

Follow Scott comment:
> here I would have a list of valid and invalid names based on pattern, with a check and intended outcome for each one so that we comprehensively cover the rules.

https://github.com/helm/helm/pull/31491/files#r2524820312

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 16:13:23 +01:00
Benoit Tigeot
f4b139a82c
Make validation error similar and explicit for both metadatas
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 16:13:23 +01:00
Benoit Tigeot
c04e18e452
fix: improve plugin name validation error messages
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 16:13:23 +01:00
Scott Rigby
0ee89d2d4e
Merge pull request #31418 from tisonkun/typo
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
chore: fix typo of public field
2025-11-10 13:56:39 -05:00
tison
90d01915f9
for all other similar cases
Signed-off-by: tison <wander4096@gmail.com>
2025-11-04 11:33:42 +08:00
Evans Mungai
558cea7458
chore: increase logging package test coverage
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-30 21:08:08 +00:00
Matt Farina
15300549f0
When time not available, using time.Now
Note, when time is not available, the builds are not reproducible.
This problem would only happen when an SDK user is using parts of
the API to build their own tooling. Helm will consistently inject
the dates through the higher level APIs.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-10-29 15:11:20 -04: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
Evans Mungai
a94878fb89
Fix failing test
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-23 15:42:34 +01:00
Evans Mungai
28bc76c364
Add tests for logging LogHolder
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-23 10:44:17 +01:00
Evans Mungai
e63b4d92cb
Update internal/logging/logging.go
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 19:08:41 +01:00
Evans Mungai
99fe9b3b9b
Update logging to use a param for the logger
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 16:20:16 +01:00
Evans Mungai
d67b17b6ec
Minor name change
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-10-22 15:30:02 +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
Matt Farina
a3db5f5667
Merge pull request #31408 from AndiDog/plugin-err-msg
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
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Improve error message when plugin source cannot be determined or a non-directory is passed
2025-10-21 15:52:54 -04:00
Matt Farina
97ee09d935
Merge pull request #31365 from reddaisyy/main
refactor: use reflect.TypeFor
2025-10-21 15:43:07 -04:00
Matt Farina
2cfd41ec28
Merge pull request #31351 from gjenkins8/gjenkins/helm_version_kubeversion
feat: `helm version` print Kubernetes (client-go) version
2025-10-21 15:32:40 -04:00