feat: Implement helm lint

Signed-off-by: wilmardo <info@wilmardenouden.nl>
This commit is contained in:
wilmardo 2019-08-15 10:44:03 +02:00 committed by mergify[bot]
parent 8fddb53931
commit 30fb7de118
85 changed files with 16 additions and 6 deletions

View File

@ -46,6 +46,8 @@ jobs:
- curl -sf - curl -sf
"https://install.goreleaser.com/github.com/golangci/golangci-lint.sh" "https://install.goreleaser.com/github.com/golangci/golangci-lint.sh"
| bash -s -- -b $GOPATH/bin "${GOLANGCI_VERSION}" | bash -s -- -b $GOPATH/bin "${GOLANGCI_VERSION}"
# install helm for helm lint
- curl -L https://git.io/get_helm.sh | bash
script: script:
- make static-check - make static-check
- make go-test - make go-test

View File

@ -149,12 +149,12 @@ test the deployment further.
The same requirements from the Kubernetes section apply here, i.e. Kubernetes The same requirements from the Kubernetes section apply here, i.e. Kubernetes
version, privileged flag and shared mounts. version, privileged flag and shared mounts.
The Helm chart is located in `deploy/rbd/helm`. The Helm chart is located in `deploy/rbd/kubernetes/v1.14+/helm/ceph-csi-rbd`.
**Deploy Helm Chart:** **Deploy Helm Chart:**
```bash ```bash
helm install ./deploy/rbd/helm helm install deploy/rbd/kubernetes/v1.14+/helm/ceph-csi-rbd
``` ```
The Helm chart deploys all of the required resources to use the CSI RBD driver. The Helm chart deploys all of the required resources to use the CSI RBD driver.

View File

@ -11,6 +11,7 @@ scriptdir="$(dirname "$(realpath "$0")")"
cd "$scriptdir/.." cd "$scriptdir/.."
# run_check <file_regex> <checker_exe> [optional args to checker...] # run_check <file_regex> <checker_exe> [optional args to checker...]
# Pass empty regex when no regex is needed
function run_check() { function run_check() {
regex="$1" regex="$1"
shift shift
@ -18,8 +19,12 @@ function run_check() {
shift shift
if [ -x "$(command -v "$exe")" ]; then if [ -x "$(command -v "$exe")" ]; then
find . -path ./vendor -prune -o -regextype egrep -iregex "$regex" -print0 | if [ -z "$regex" ]; then
xargs -0rt -n1 "$exe" "$@" "$exe" "$@"
else
find . -path ./vendor -prune -o -regextype egrep -iregex "$regex" -print0 |
xargs -0rt -n1 "$exe" "$@"
fi
elif [ "$all_required" -eq 0 ]; then elif [ "$all_required" -eq 0 ]; then
echo "Warning: $exe not found... skipping some tests." echo "Warning: $exe not found... skipping some tests."
else else
@ -43,7 +48,10 @@ run_check '.*\.(ba)?sh' shellcheck
run_check '.*\.(ba)?sh' bash -n run_check '.*\.(ba)?sh' bash -n
# Install via: pip install yamllint # Install via: pip install yamllint
# disable yamlint chekck for helm chats # disable yamlint check for helm charts
run_check '.*\.ya?ml' yamllint -s -d "{extends: default, rules: {line-length: {allow-non-breakable-inline-mappings: true}},ignore: deploy/*/kubernetes/*/helm/templates/*.yaml}" run_check '.*\.ya?ml' yamllint -s -d "{extends: default, rules: {line-length: {allow-non-breakable-inline-mappings: true}},ignore: deploy/*/kubernetes/*/helm/*/templates/*.yaml}"
# Install via: https://github.com/helm/helm/blob/master/docs/install.md
run_check '' helm lint --namespace=test deploy/*/kubernetes/*/helm/*
echo "ALL OK." echo "ALL OK."