Commit Graph
34 Commits
Author SHA1 Message Date
Joe Julian 7f4eb407c6 add missing template directory to badcrdfile testdata
Signed-off-by: Joe Julian <me@joejulian.name>
2025-07-17 13:14:24 -07:00
Zach Burgess 357957b0d3 Use testify and add a CRD to the goodone test case.
Signed-off-by: Zach Burgess <zachburg@google.com>
2025-07-07 11:04:31 -07:00
Zach Burgess bc35ea5ad7 Fix comment in pkg/lint/rules/testdata/invalidcrdsdir/values.yaml
Signed-off-by: Zach Burgess <zachburg@google.com>
2025-07-01 14:07:50 -07:00
Zach Burgess 21b9aa3d94 Lint the crds/ directory.
This checks that the `crds/` dir only contains YAML files that define
K8s resources with `kind: CustomResourceDefinition`.

Checking that the YAML files are not templates will be done in a
separate commit.

Signed-off-by: Zach Burgess <zachburg@google.com>
2025-07-01 14:07:50 -07: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 8e6a5149d2 validation fix
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-02-07 10:54:15 -05:00
wujunwei cd2609d08e add some test case
Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-28 15:04:07 +08:00
Stuart Drennan 1931b0702d fix(helm): process dependencies import-values
When running helm lint, import-values for dependencies are ignored,
also added test for linting chart with import-values

Closes #9658

Signed-off-by: Stuart Drennan <stuart.drennan@gmail.com>
2021-10-24 11:38:02 +01:00
Mark Sagi-Kazar d5b4e1c5b8 chore: update testdata to use the new ingress template
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2021-04-25 12:23:03 +02:00
rimas f30badd570 Fix test
Signed-off-by: rimas <rmocius@gmail.com>
2020-12-01 18:52:57 +02:00
rimas ce1a46899f Fixes #9083
Signed-off-by: rimas <rmocius@gmail.com>
2020-12-01 18:50:14 +02:00
Nandor Kracser dfb5a5e8cc lint: lint all documents in a multi-doc yaml file
Signed-off-by: Nandor Kracser <bonifaido@gmail.com>
2020-11-06 14:14:19 +01:00
Matt Butcher fe2d7f7792 this rewrites a whole bunch of old repo URLs to the new repo URL (#8902)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-10-19 14:38:32 -06:00
Karuppiah Natarajan 47c38ec23d Show errors when linting for Chart.yaml version and appVersion fields of type non-string
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2020-05-25 13:24:15 +05:30
Matt Butcher 6fc9353056 feat: lint the names of templated resources (#8011)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-28 17:12:14 -06:00
Taylor Thomas caf629a3e9 feat(lint): Adds v3 chart checks to linter
Fixes #5733

This adds two specific checks. A warning if a chart has a `crd-install` hook
and an error if the chart contains `.Release.Time`. Further checks can be added
down the road as needed using the same pattern I use here

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-10-17 12:20:47 -05:00
Matt Farina 967f4fed42 Update dependencies
* Kubernetes updated to 1.16.1
* SemVer and Sprig updated to latest releases that leverage go
  modules
* Tests and checks updated. These already landed in v2 via PR 6457

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 13:49:07 -04:00
Martin Hickey 4d47052395 Update linting and checking for apiVersion v1/v2
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-08-02 15:52:14 +01:00
Matt Farina 069eec9e42 Updatin gthe apiVersion linting for Helm v3
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-14 14:46:40 -04:00
Matt Farina 250b63eced Updating the labels for consistency
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-07 14:13:29 -04:00
Luis Davim 82ffe56ca6 Reduce template code duplication. Fixes #5372
Signed-off-by: Luis Davim <luis.davim@jet.com>
2019-05-07 12:03:54 -04:00
Luis Davim 4425f86865 Add app.kubernetes.io/version label
Signed-off-by: Luis Davim <luis.davim@jet.com>
2019-05-07 11:59:49 -04:00
Matt Farina af7eab0325 Updating to the k8s label convention
Closes #4335

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-07 11:26:31 -04:00
Adam Reese e458a67f0c ref(pkg/chart): add validation method to chart
Consolidate validation of Chart.yaml.

Signed-off-by: Adam Reese <adam@reese.io>
2019-04-05 13:40:06 -07:00
Adam Reese d94707db86 ref(*): remove helmVersion chart constraint
* Remove helmVersion constraint from charts
* Guard compile time set variables behind `internal/`
* Allow configuration of UserAgent for HTTPGetter

Signed-off-by: Adam Reese <adam@reese.io>
2019-01-08 13:37:55 -08:00
Adam Reese 29e772f631 ref(*): replace TillerVersion with HelmVersion 2018-04-20 00:37:34 -07:00
Julian ca415ab8db feat(helm): support namespace and additional values in lint (#2972)
* Add "--namespace" to helm lint

Keep lint syntax as close as possible to "helm install" resp. "helm
upgrade", so that one only needs to change the command.

See #2036

* Align lintCmd struct

* Add "--set" and "--values" to helm lint

Keep lint syntax as close as possible to "helm install" resp. "helm
upgrade", so that one only needs to change the command.

Closes #2495,#2036

* Reuse strict parameter, when rendering during lint

We want to see the rendering fail, if we missed a value, so we reuse
"--strict".

See #2495,#2036

* Fix lint unit test

See #2495,#2036

* Update docs
2017-12-13 14:43:12 -08:00
Matt Butcher d863d9a886 fix(lint): add KubeVersion and TillerVersion to linter
Closes #2393
2017-05-16 16:33:43 -06:00
z00358552 b0d4cacd54 fix(helm) change name length limit to 63 for helm create
since kubernetes 1.4, the upper limit for resource name is 63 characters,
so it is better to change the template when running `helm create` accordingly.
2017-01-17 15:51:31 +08:00
Ferran Rodenas 088c2bd233 Linter validations for Chart icon property 2017-01-12 15:21:10 +01:00
John Hofman c38fb120bf fix(helm): add trimSuffix to helper functions 2016-12-05 10:01:25 +01:00
Miguel Martinez 7bb4893cad Support Linter for Values 2016-06-27 17:47:18 -07:00
Miguel Martinez c2459c06bf New Chart linter structure
Fixed tests

Adding chart name linter

Add lint error

Moving to blocks

Moving to method

Moved lint rules to functions

Semantic version validation

Linting engine

Adding sources and home validations

Sharing file loading

Sharing file loading

Rolling back readme

Rewriting other linters

Fixing tests

Typo

Using chart.Metadata

Fixing format

Adding UNKNOWN in Engine

Adding tabs

Fixing tabs
2016-06-20 14:28:58 -07:00