You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helm provides a built in linter, accessed through the helm lint command, which provides basic validation of the chart contents.
In corporate and departmental scenarios, a team may want to augment the built in linting capabilities with their own linting rules, for example:
service.type=ClusterIP --> Default service type must be ClusterIP if a service is defined
resources != nil --> resources limits and requests must be defined for all charts
To provide this capability, the existing plugin mechanism within Helm could be utilized, augmenting the plugin.yaml metadata attributes with indicators that a plugin contains linting rules:
name: "mylinter"
...
linter: true
When the helm lint command is run, the internal lint rules would first be evaluated, followed by any lint plugins. The results of the internal linter and various plugins would be accumulated before being presented to the user.
Reacted by andrewgdavis, Johan Lyheden, Sergey Melnik, Lukas Eichler, Baargav, rimusz, Lukas Rieder, Jason Carter, Illia Dus, Matthew Balvanz and 11 more
My organization requires that the values.yml contain specific content. I suspect that not all organizations would want to enforce some of these rules, for example:
service.type=ClusterIP --> Default service type must be ClusterIP if a service is defined
resources != nil --> resources limits and requests must be defined for all charts
Since Helm already has a plugin mechanism, perhaps linters could be accounted for within that framework rather than trying to find another way to plugin validation rules.
So the proposal is to flag a plugin as containing a linting plugin, and add the logic to helm to handle that properly, correct? Just want to make sure it is as clear as possible 🙂. Then we'll see if anyone has comments and I'll close the original issue
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
I am commenting here to not let this get stale or deleted.
This would help us in validating packages submitted in our CI.
I can image optional checks like would be pretty common, and could greatly enhance the value of helm lint:
# checks if a livenessProbe, readinessProbe is present and properly configured
--check=livenessProbe
--check=readinessProbe
# checks if resource requests (memory and cpu) are configured
--check=resources.requests
# checks if memory resource requests are configured
--check=resources.requests.memory
# checks if cpu resource limits are configured
--check=resources.limits.cpu
Activity
[-]Pluggable lint rules[/-][+]Proposal: Pluggable lint rules[/+]thomastaylor312 commentedon Jul 17, 2017
@kyleschlosser Can you give an example of what this would look like? I think that would help solidify this a bit
kyleschlosser commentedon Jul 17, 2017
My organization requires that the values.yml contain specific content. I suspect that not all organizations would want to enforce some of these rules, for example:
Since Helm already has a plugin mechanism, perhaps linters could be accounted for within that framework rather than trying to find another way to plugin validation rules.
thomastaylor312 commentedon Jul 19, 2017
So the proposal is to flag a plugin as containing a linting plugin, and add the logic to helm to handle that properly, correct? Just want to make sure it is as clear as possible 🙂. Then we'll see if anyone has comments and I'll close the original issue
kyleschlosser commentedon Aug 10, 2017
Yes, that's right. I have updated the opening comment to better reflect that.
[-]Proposal: Pluggable lint rules[/-][+]Proposal: pluggable rulesets for helm lint[/+]fejta-bot commentedon Jan 30, 2018
Issues go stale after 90d of inactivity.
Mark the issue as fresh with
/remove-lifecycle stale.Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with
/close.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
bacongobbler commentedon Jan 31, 2018
/remove-lifecycle stale
/lifecycle frozen
darrenhaken commentedon Aug 2, 2018
Has any work been done on this?
Overbryd commentedon Sep 10, 2018
I am commenting here to not let this get stale or deleted.
This would help us in validating packages submitted in our CI.
I can image optional checks like would be pretty common, and could greatly enhance the value of
helm lint:Edit: For everybody who lands here through a Google search, you may want to have a look at this 3rd party project: https://github.com/helm/chart-testing
It combines a YAML-schema validator with helm lint into a docker image that can run custom chart linting + validation.
kbambridge commentedon Mar 23, 2019
I would like to be able to use
.helmextensions without the linter complaining to differentiate from standard yaml for our file validators.cabrinoob commentedon May 16, 2019
This feature would be very useful. I vote for it!
bridgetkromhout commentedon Sep 5, 2020
Hi, all - many changes have been made to the linter since this issue was opened. If you have a remaining request, we now have a defined process so that if you'd like, you can submit a Helm Improvement Proposal so as to work in the community to make these ideas a reality: https://github.com/helm/community/blob/master/hips/hip-0001.md - meanwhile, I will close this issue. Thanks!
jspiro commentedon Oct 22, 2020
+1 – I came looking specifically for a way to ensure certain resources exist, e.g. limits.