Commit Graph

31 Commits

Author SHA1 Message Date
James Blair 9dab6e9770
Remove warning for template directory not found.
Some charts don't need a templates directory. The warning appears to originate back when helm expected all charts to contain templates. In CI situations where linting is performed with --strict the lint warning causes unneccessary failures for charts that quite legitimately do not contain a templates directory.

As discussed in #8033 there are no longer any scenarios understood where this warning is helpful so this commit removes it.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-07-09 16:30:04 +12:00
wujunwei cd2609d08e add some test case
Signed-off-by: wujunwei <wjw3323@live.com>
2023-03-28 15:04:07 +08:00
Eng Zer Jun 2e3e22a003
test: use `T.TempDir` to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-12 13:54:54 +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
Matt Butcher 2750e4d781
Lint dependencies (#7970)
* feat: add dependency tests

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>

* replaced on-disk fixtures with in-memory fixtures

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-07-09 14:31:51 -06:00
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
Matt Butcher 549193dbcb
test: forward-port regression test from Helm 2 (#7927)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-15 11:48:26 -06:00
Martin Hickey 9a0e7d8a31 Improve error message to check in unit test
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-03-18 12:22:06 +00:00
Scott Morgan 32ce016054 fix(lint): Remove requirement that directory name and chart name match
Signed-off-by: Scott Morgan <morgandev@gmail.com>
2019-11-20 08:26:54 -06:00
Matt Farina 9bc7934f35
Updating the module for v3 as the major version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 14:27:05 -04: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 50e06b1447
Adding apiVersion guidance to the linting
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-14 16:14:52 -04:00
Matt Farina 29842e040f
Adding lint check for apiVersion which is a required field
Fixes #5727

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-05-14 14:31:07 -04:00
Adam Reese 895e9192d4
feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Adam Reese f791421fab
feat(Makefile): add formatting target
Signed-off-by: Adam Reese <adam@reese.io>
2019-02-08 12:24:47 -08:00
Adam Reese 2b81eea1e2
ref(*): replace byte array with map for Release config
Signed-off-by: Adam Reese <adam@reese.io>
2018-12-04 15:57:24 -08:00
Adam Reese 516c53dae6
ref(chart): use map for chart.Values
Signed-off-by: Adam Reese <adam@reese.io>
2018-08-29 09:56:19 -07:00
Adam Reese 4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -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
Maxim Ivanov a6872c124a Avoid panics if test is failing 2017-09-28 13:54:40 +01:00
Ferran Rodenas 088c2bd233 Linter validations for Chart icon property 2017-01-12 15:21:10 +01:00
Adnan Abdulhussein 03ca4e892f feat(lint): support linting multiple charts 2016-06-30 19:20:11 -07:00
Miguel Martinez 3b2ea04348 fix(linter) Typos 2016-06-30 13:33:16 -07:00
Adnan Abdulhussein 77820c7482 fix(lint): Return non-zero exit status when lint errors present 2016-06-29 13:50:47 -07:00
Matt Butcher e757b24aed fix(*): add license header 2016-06-22 12:28:45 -06: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
Matt Butcher 9ca8c27e16 fix(*): change TOML to YAML 2016-06-06 21:12:36 -06:00
vaikas-google 932663bd5f add test for malformed values.toml file 2016-05-11 16:20:09 -07:00
vaikas-google 012b0f7c3e update the lint_test for correct errors 2016-05-11 15:58:41 -07:00
vaikas-google 7edce9b82b Validate Chart.yaml version for semver, validate that values.toml parses if present 2016-05-11 15:32:42 -07:00