datreeio / helm-datree Goto Github PK
View Code? Open in Web Editor NEWA Helm plugin to validate charts against the Datree's CLI tool
Home Page: https://hub.datree.io/integrations
License: MIT License
A Helm plugin to validate charts against the Datree's CLI tool
Home Page: https://hub.datree.io/integrations
License: MIT License
Describe the bug
I'm running datree in Travis CI using the helm plugin, installing it on every CI run.
helm plugin install https://github.com/datreeio/helm-datree
The installation fails about 1 out of 3 times, which stops my CI and fails my build.
To Reproduce
helm plugin install https://github.com/datreeio/helm-datree
in Travis CI (might work locally as well)Expected behavior
Installation should work and CI continue
Desktop (please complete the following information):
dist: trusty
)Datree plugin version (run helm datree verion
):
Additional context
This may have nothing to do with Travis CI, but rather with the github servers.
Is your feature request related to a problem? Please describe.
I am using the helm3 plugin/addon of microk8s which is run using microk8s helm3
; for easier personal use I just aliased that to helm
but run.sh
doesn't pick that up causing the datree plugin to not compile the chart which in turn causes a "No files detected" error since this line (specifically helm show chart
) fails as the command isn't known:
Line 16 in c4146ef
Describe the solution you'd like
Some flag / env variable for the script to provide an alternative path / way of calling helm to allow executing helm that is prebundled with other tools and thus requires a different command to run.
Describe alternatives you've considered
run.sh
file to include the alias at the top of the file locallyhelm
executable somewhere in the path that essentially serves as the aliasAdditional context
-
helm datree test . --values values.yaml
Error: plugin "datree" exited with error
datree version
0.1.708
helm version
version.BuildInfo{Version:"v3.5.2", GitCommit:"167aac70832d3a384f65f9745335e9fb40169dc2", GitTreeState:"clean", GoVersion:"go1.15.7"}
I think need args "-f" to choose file values. Because my file values.yml not in the same folder chart.
Describe the solution you'd like
Is it currently possible to pass in values files with a -f flag? This is something I'd like to be able to do.
Is your feature request related to a problem? Please describe.
I want to run datree against a bunch of helm charts checked into a single repo. Everytime I add a new repo, I have to manually add in github actions / config to run it against a specific chart.
Describe the solution you'd like
I want to be able to recursively specify a master folder with helm charts against which I want to run datree. I am also fine to follow a certain convention of naming the custom values files or maintain a config file for this
Describe alternatives you've considered
Considering a script which user has to run which generates this and adds to the github actions. But don't want to add that capability to user
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
I would not want to commit to the repos every time I work with fixing the policies. So pre-commit-hooks are useful to Helm Charts users
Describe the solution you'd like
It would be nice to have pre-commit hooks feature as well for the Helm Chart users.
Something like this:
id: install-datree
name: datree helm install
description: Run Helm charts against the datree policy
require_serial: true
pass_filenames: true
entry: scripts/install.sh
language: script
files: [file, yaml]
id: run-datree
name: datree helm test
description: Run Helm charts against the datree policy
require_serial: true
pass_filenames: true
entry: scripts/run.sh
language: script
files: [file, yaml]
Thank you!
If there are spaces in the title of the diagram, there will be an error
Chart.yaml
apiVersion: v2
name: Test Chart v2
description: A Helm chart for Kubernetes
❯ helm datree test ./ -- --values values.yaml --values values-test.yaml --set namespace=test
~/.local/share/helm/plugins/helm-datree/scripts/run.sh: line 34: $tempManifestPath: ambiguous redirect
Error: plugin "datree" exited with error
You should quote the variable $tempManifestPath
run.sh
helm template "${helm_options[@]}" "$helm_chart_location" > "$tempManifestPath"
$HELM_PLUGIN_DIR/bin/datree "${datree_options[@]}" "$tempManifestPath"
Describe the bug
Plugin crashes with helm v3.6.2
To Reproduce
$ helm datree test . --values my-values.yaml
Error: plugin "datree" exited with error
Expected behavior
Datree should analyze the Helm template.
Desktop:
Datree plugin version (run helm datree verion
):
Additional context
$ helm version
version.BuildInfo{Version:"v3.6.2", GitCommit:"ee407bdf364942bcb8e8c665f82e15aa28009b71", GitTreeState:"dirty", GoVersion:"go1.16.5"}
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H1217
$zsh --version
zsh 5.7.1 (x86_64-apple-darwin19.0)
Describe the bug
Wanted to give datree a try, installed helm plugin to check on my charts. Yaml validation is OK, Kubernetes schema validation cannot find file. Tried with example repo, no luck.
To Reproduce
Steps to reproduce the behavior:
helm plugin install https://github.com/datreeio/helm-datree
git clone https://github.com/datreeio/examples.git
helm datree test examples/helm-chart/nginx
Expected behavior
K8s schema is validated, starting policy check.
Desktop (please complete the following information):
Datree plugin version (run helm datree verion
):
Additional context
Same happens with passing values
helm datree test helm-charts/app/ -- --values compiled/DEV1/php.yml
Is your feature request related to a problem? Please describe.
Today, if I will ran datree to test a chart with dependencies (that are not installed), I will get the following error message:
Error: An error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory [CHART_NAME]
Describe the solution you'd like
A flag to skip pre-installed dependencies requirement: helm datree test [CHART_DIRECTORY] --ignore-dependencies
--ignore-dependencies
-> this flag is just an example.
Describe alternatives you've considered
Comment out dependencies section from Chart:
Additional context
An interesting tool overall!
I do not see a way to use it in a CI/CD env, unless I am missing the obvious.
It would be great if it had something along the lines of --quiet
and --error-count
, so that I could parse the result of helm datree test ...
and find our if I need to fail the build or not. Currently this is very cumbersome to do (I get the output and parse it, which to put it mildly, simply sucks).
Thank you for looking into this.
Is your feature request related to a problem? Please describe.
Helm template creates test resources, while helm install does not. This default behavior creates a discrepancy where the datree test fails on policy check on the test resources, while these resources are never applied.
Describe the solution you'd like
Describe the bug
command 'helm datree test my-test-app/'
gives the following error:
Error: unknown flag: --skip-tests
Error: plugin "datree" exited with error
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Output similar to datree test my-test-app.yaml (helm template my-test-app/ > my-test-app.yaml; datree test my-test-app.yaml)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Datree plugin version (run helm datree verion
):
Additional context
Add any other context about the problem here.
Describe the bug
When trying to install the plugin in Gitlab CI with the alpine/helm, I get a failure.
To Reproduce
Steps to reproduce the behavior:
stages:
- test
test:
stage: test
image:
name: alpine/helm:3.7.2
entrypoint: [""]
variables:
DATREE_TOKEN: XXXXXXXXXXXXXXXXXXXXX
HELM_PLUGINS: ./.helm_plugins
before_script:
# Debugging pluging
- helm plugin list # Should be empty
# Install another plugin just to check
- helm plugin install https://github.com/technosophos/helm-github
- helm plugin list # Should list the helm-github plugin
- helm plugin install https://github.com/datreeio/helm-datree
- helm plugin list # Should list both pluging
script:
- ...
sh: ./scripts/install.sh: not found
Expected behavior
The plugin should install
Datree plugin version (run helm datree verion
):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.