Commit graph

76 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Matt Farina
37de51428c
Merge pull request #31376 from benoittgt/accept-yaml-yml
Do not ignore *.yml file on linting while accepting *.yaml
2025-10-21 15:23:40 -04:00
Benoit Tigeot
06188f9dfe
Add test for isYamlFileExtension functions
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-10-11 13:28:36 +02:00
Matt Farina
78cd44bd75
Merge pull request #30712 from gjenkins8/gjenkins/cleanup_lint_template
cleanup: Remove extra lint/rules.Template functions
2025-10-10 16:55:17 -04:00
Benoit Tigeot
4a944230ea
Do not ignore *.yml file on linting while accepting *.yaml
From : https://github.com/helm/helm/pull/30712/files#r2417446037

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-10-09 22:52:52 +02:00
Terry Howe
ee322a9671
fix: flakey lint test on shuffle
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-10-01 10:24:42 -06:00
Terry Howe
bee9c1a108
chore: replace github.com/mitchellh/copystructure
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-09-29 10:30:08 -06:00
George Jenkins
efcb5735e5 cleanup: Remove extra lint/rules.Template functions
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-09-21 11:49:33 -07:00
Matt Farina
8dc7c57f50
Update the action interfaces for chart apiversions
This change is about handling the interfaces to public functions for
different chart apiVersions. The internals are still focused on v2.
This enables v3 to be layered in layer.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-17 15:19:02 -04:00
Benoit Tigeot
072e2a689a
Extend --skip-schema-validation for lint command
When --skip-schema-validation is enabled, the lint command will now skip
JSON schema validation for values.yaml files, allowing charts with schema
validation errors to pass linting when the flag is used.

This addresses the gap where --skip-schema-validation only applied to
templates but not to values files, providing complete schema validation
bypass when needed.

Fixes: #13413

Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-09-10 15:23:05 +02:00
Kamil Swiechowski
a645dfb7f8 fix:semverv2 lint test error message
Signed-off-by: Kamil Swiechowski <kamil.swiechowski@iprally.com>
2025-09-05 13:10:41 +02:00
Kamil Swiechowski
38d1a7376f fix: throw warning when chart version is not semverv2
Signed-off-by: Kamil Swiechowski <kamil.swiechowski@iprally.com>
2025-09-03 07:49:41 +02: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
Robert Sirchia
30404b4173
Merge pull request #31138 from islewis/release-3.18
fix(helm-lint): Add HTTP/HTTPS URL support for json schema references
2025-08-19 15:47:25 -04:00
Isaiah Lewis
62e0c78ef8
fix(helm-lint): fmt
Signed-off-by: Isaiah Lewis <isaiah@roof12.com>
2025-08-19 12:35:12 -07:00
Isaiah Lewis
fb12b44493
fix(helm-lint): Add TLSClientConfig
Signed-off-by: Isaiah Lewis <isaiah@roof12.com>
2025-08-18 11:35:59 -07:00
Isaiah Lewis
fa73b6743b
fix(helm-lint): Add HTTP/HTTPS URL support for json schema references
Signed-off-by: Isaiah Lewis <isaiah@roof12.com>
2025-08-15 07:31:30 -07:00
joemicky
fab70472af refactor: replace []byte(fmt.Sprintf) with fmt.Appendf
Signed-off-by: joemicky <joemickychang@outlook.com>
2025-08-14 19:21:52 +08:00
Joe Julian
6ecf033700
Merge pull request #13111 from rawtaz/style-cosmetics
style(pkg/chartutil): add missing dots and indentation to defaultValues
2025-08-13 13:44:57 -07:00
Joe Julian
3fe1cb6f02
Merge remote-tracking branch 'upstream/main' into style-cosmetics 2025-08-13 13:22:35 -07:00
Matt Farina
0c64ad1c97
fix Chart.yaml handling
Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-07-29 13:18:29 -04:00
Borys Hulii
9f6beaad48
fix: k8s version parsing to match original
Signed-off-by: Borys Hulii <borys.hulii@bitvavo.com>
2025-07-21 09:40:45 +02:00
yumeiyin
8c22fbfe4a refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: yumeiyin <yin.yumei@qq.com>
2025-07-14 16:21:15 +08:00
curlwget
bfc1af68fb chore: fix function in comment
Signed-off-by: curlwget <curlwget@icloud.com>
2025-06-24 15:48:08 +08:00
acceptacross
9623fb80f1 chore: fix some function names in comment
Signed-off-by: acceptacross <csqcqs@gmail.com>
2025-06-04 23:54:30 +08:00
Benoit Tigeot
b2fd91b8d0
Adapt error of invalid json schema with the new expected output
Closes: https://github.com/helm/helm/pull/30907

To be able to upgrade to v6.0.2 for jsonschema lib we need to upgrade
this test.

I am wondering if it's related to this commit:
86cca28795

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-05-26 09:44:02 +02:00
Matt Farina
cf7613ba6b
Reverting fix "renders int as float"
This reverts #13533

This change has caused issues with numerous charts around things
unrelated to toml. This is because of functions like typeIs/typeOf
being used and acted upon.

The change caused a significant regression.

Note: This kind of change can be put into v3 charts, that are in
active development, without causing a regression.

Closes #30880

Signed-off-by: Matt Farina <matt@mattfarina.com>
2025-05-21 15:09:01 -04:00
Matthieu MOREL
157f0ba10a chore: enable thelper
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-16 10:25:08 +02: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
findnature
ac8d2f9aed refactor: use slices.Contains to simplify code
Signed-off-by: findnature <cricis@aliyun.com>
2025-05-02 09:43:25 +08:00
Justen Stall
4905a61026
Merge branch 'main' into stdlib-errors-2
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-23 15:58:33 -04:00
Robert Sirchia
d9bc0a948c
Merge pull request #30777 from ryanhockstad/merge-fix
fix: null merge. closes #30587
2025-04-23 15:07:54 -04:00
Daniel Strobusch
b183eccfc4
copy dependency metadata on aliasing to avoid sharing imported values
imported values are stored in dependency objects, which breaks if a chart dependency is shared among multiple aliases.
By copying the dependency objects in the metadata values can be imported correctly.

Supersedes #10174

Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>
2025-04-23 11:32:45 +02:00
Daniel Strobusch
df7befd208
copy dependencies on aliasing to avoid sharing chart references on multiply aliased dependencies
Dependencies keep a reference on their parent chart, which breaks if a chart reference is shared among multiple aliases.
By copying the dependencies, parent information can be set correctly to render the templates as expected later on.

Note that this change will make ChartFullPath return a different path for sub-subcharts. It will contain the alias names instead of the path to the chart files which makes it consistent with paths to templates on the subchart level.

Closes #9150

Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>
2025-04-23 11:16:05 +02:00
Justen Stall
3877ec9049
fix golangci-lint issues
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-21 12:44:40 -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
Ryan Hockstad
c1175a4106 fix null merge
Signed-off-by: Ryan Hockstad <ryanhockstad@gmail.com>
2025-04-20 15:29:19 -04:00
Edward Miller
14a468f24d Add chartutil.StrictLoadChartfile for strict (WARNING-level) lint
Signed-off-by: Edward Miller <edmiller287@gmail.com>
2025-04-18 19:13:40 +01:00
Edward Miller
00f8561ad4 fix(pkg/lint): unmarshals Chart.yaml strictly
When "helm lint" is run, it now errors on invalid chartfiles,
e.g. those with duplicate keys

Closes #12381

Signed-off-by: Edward Miller <edmiller287@gmail.com>
2025-04-18 19:13:40 +01: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
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