Commit graph

71 commits

Author SHA1 Message Date
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
Vibhav Bobade
68a8f36a92 Fix Adding Errors from Linter.Messages to result.Errors
This also fixes <nil> beig added to result.Errors

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
2019-08-20 04:22:17 +05:30
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
Oleg Sidorov
ec440d446d Replaced ghodss/yaml with sigs.k8s.io/yaml
This commit replaces usage of github.com/ghodss/yaml with it's forked
version maintained by SIG community. The replaced library has
low-to-none support activity unlike the latter. We believe the new
Helm branch could benefit from using the community-supported version on
a long-term run as yaml parser is a key component of Helm chart rendering
engine.

This commit locks sigs.k8s.io/yaml dependency version on 1.1.0 which
is backwards compatible with ghodss/yaml 1.0.0.

This change also resolves the outdated dependency version lock for
ghodss/yaml (currently 1.0.0) and makes it possible to port changes from
https://github.com/helm/helm/pull/6010 to dev-v3.

Signed-off-by: Oleg Sidorov <oleg.sidorov@booking.com>
2019-07-12 16:52:15 +02:00
Thomas O'Donnell
213f714604 Stop Lint from breaking when using required
Have updated the required filter so that it doesn't break when linting a
chart. This work is based off #4221 and #4748 which didn't make it into
the v3 branch.

Signed-off-by: Thomas O'Donnell <andy.tom@gmail.com>
2019-06-13 20:32:37 +02:00
Adam Reese
590bf10ab5
fix(pkg/action): add namespace to release options
ref: https://github.com/helm/helm/issues/5732

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-15 14:08:51 -07: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
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
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
b7a14de590
Merge pull request #5601 from adamreese/v3/capabilities
ref(pkg/chartutil): remove k8s version object dependency
2019-05-09 14:29:34 -07:00
Adam Reese
097834de0a
ref(pkg/chartutil): remove k8s version object dependency
Flattens the `.Capabilities` built-in and removes useless kubernetes
runtime metadata.

Signed-off-by: Adam Reese <adam@reese.io>
2019-05-07 13:49:05 -07: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
Ian Howell
ffff0e8c33 Feat/schema validation (#5350)
* Add the Schema type and a function to read it

* Added a function to read a schema from a file

* Check that values.yaml matches schema

This commit uses the gojsonschema package to validate a values.yaml file
against a corresponding values.schema.yaml file.

* Add functionality to generate a schema from a values.yaml

* Add Schema to Chart and loader

* Clean up implementation in chartutil

* Add tests for helm install with schema

* Add schema validation to helm lint

* Clean up "matchSchema"

* Modify error output

* Add documentation

* Fix a linter issue

* Fix a test that broke during a rebase

* Clean up documentation

* Specify JSONSchema spec

Since JSONSchema is still in a draft state as of this commit, we need to
specify a particular version of the JSONSchema spec

* Switch to using builtin functionality for file extensions

* Switch to using a third-party library for JSON conversion

* Use the constants from the gojsonschema package

* Updates to unit tests

* Minor change to avoid string cast

* Remove JSON Schema generation

* Change Schema type from map[string]interface{} to []byte

* Convert all Schema YAML to JSON

* Fix some tests that were broken by a rebase

* Fix up YAML/JSON conversions

* This checks subcharts for schema validation

The final coalesced values for a given chart will be validated against
that chart's schema, as well as any dependent subchart's schema

* Add unit tests for ValidateAgainstSchema

* Remove nonessential test files

* Remove a misleading unit test

The TestReadSchema unit test was simply testing the ReadValues function,
which is already being validated in the TestReadValues unit test

* Update documentation to reflect changes to subchart schemas
2019-04-26 08:45:03 -07: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
14d8e97d2a
fix(*): resolve new govet issues
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-18 12:45:20 -07: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
849f27d11f
ref(pkg/engine): make template specific functions private
Make template specific functions private to ensure they not misused and
make unit tests simpler.  We may export the template helpers later if
needed.

This lays the foundation for the new chart pipeline.

Signed-off-by: Adam Reese <adam@reese.io>
2019-03-06 15:45:52 -08: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
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
roc
79f88dfc5e ref(url) update helm's github url (#4962)
https://github.com/kubernetes/helm -> https://github.com/helm/helm
https://github.com/kubernetes/charts -> https://github.com/helm/charts

Signed-off-by: Roc Chan <roc@imroc.io>
2018-11-28 10:08:38 -08:00
Adam Reese
4f26b658d8
change copyright to "Copyright The Helm Authors" 2018-08-24 12:03:55 -07:00
Adam Reese
f012940d9c
ref(*): refactor chart/chartutil
ref(chartutil): move chart loading out of chartutil into new package
    add chart loader interface to allow lazy loading
feat(chart): create chart accessors
ref(*): cleanup requirements
ref(tiller): remove optional template engines
ref(tiller): simplify sorting releases and hooks
ref(*): code simplification
ref(hapi): move chart package out of hapi
ref(chart): add requirements and lock to Chart struct
2018-08-24 11:28:29 -07:00
Adam Reese
aa859e3f88
feat(*): remove Time, Namespace, and Revision from template functions
Removes Time, Namespace, and Revision from being exposed to templates to
make template rendering discrete and repeatable.
2018-05-18 12:09:54 -07:00
Adam Reese
726e3c41be
feat(*): print stacktrace on error with debug enabled 2018-05-10 09:34:41 -07:00
Adam Reese
75c4df0b56
ref(tests): use golden files for testing command output 2018-05-09 08:37:20 -07:00
Adam Reese
36e034551f
ref(*): rebuild build version object 2018-05-02 15:26:26 -07:00
Adam Reese
29e772f631
ref(*): replace TillerVersion with HelmVersion 2018-04-20 00:37:34 -07:00
Adam Reese
4c95185164
ref(*): replace chart.config with []byte 2018-04-20 00:13:19 -07:00
Adam Reese
c5a76deba3
ref(*): use go conventions for naming types 2018-04-19 11:12:46 -07:00
Adam Reese
36536d77ba
ref(*): remove protobuf any type 2018-04-18 16:28:50 -07:00
Adam Reese
91a6ebfed5
ref(*): remove protobuf timestamps 2018-04-18 15:35:37 -07:00
Adam Reese
6345f04190
ref(hapi): convert protobuf to go types 2018-04-18 14:53:38 -07:00
Nic Doye
73017d7e88 Accept .yml files as well as .yaml for templates.
See https://github.com/helm/helm-classic/pull/306 for helm classic
and
https://kubernetes.slack.com/archives/C51E88VDG/p1520588964000061
2018-03-09 17:05:57 +00: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 Farina
22e5381251
feat(chart): Adding maintainer url
Each maintainer can have an optional URL. There are seceral use
cases for providing a URL instead of an email address:
- The case where a maintainer wants to hide their email address
  behind a webform for personal security
- When the maintainer is an organization and feedback should
  go to an issue queue

This change:
- Adds the proto field for url
- Updates the generated files for the chart proto
- Includes linting for the url
- Updates the docs to include the url

Closes #3056
2017-10-24 11:44:28 -04:00
Kazuki Suda
3508cebbf6 Use the same defaults as done in helm lint for Capabilities 2017-09-11 10:09:42 +09:00
Matthew Fisher
8b512808df bump k8s version in helm lint to 1.7 2017-09-06 10:01:38 -07: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
Matt Butcher
cb0a6c7e07
feat(tiller): add {{.Capabilities}} object
This adds the {{.Capabilities}} object to the template variables so that
chart authors can write charts that are aware of teh Kubernetes
capabilities of the current cluster.

Closes #1608
2017-01-09 18:09:20 -07:00
Michelle Noorali
06867b22d4 fix(linter): disable checking for empty values
resolves #1463
2016-12-19 15:04:12 -05:00
John Hofman
c38fb120bf fix(helm): add trimSuffix to helper functions 2016-12-05 10:01:25 +01:00
Adam Reese
d59f66fc9e fix(*): fix new linter errors 2016-11-11 19:24:11 -08:00
Matt Butcher
58164e0009
fix(linter): remove spurious namespace error
Long ago, Helm did not support cross-namespace installs. There was a
linter rule to catch this. When we changed the way Helm worked, we did
not remove the linter rule. This commit removes that linter rule.

Closes #1489
2016-11-01 13:41:29 -06:00
Matt Butcher
36f7eb0b2a fix(linter): add engine.FuncMap so linter can use real function list
This adds a function engine.FuncMap that returns a function mapping that
better represents the functions passed to a template. The linting logic
is reconfigured to use this function instead of the sprig.FuncMap
function.

Closes #1366
2016-10-14 16:28:43 -06:00