1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

docs: fix linting user-guide with updated docker image ()

* docs: fix linting user-guide with updated docker image
the docker image was updated, but the example script was not

* docs: simplify the shell script by only using bash

Co-authored-by: Michael Salaverry <michael_salaverry@intuit.com>
This commit is contained in:
Michael Salaverry 2020-11-20 14:52:35 +02:00 committed by GitHub
parent 1d30fed29b
commit 5173e422bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,7 @@ Here is an example script to lint a `src` sub-directory full of Prometheus Opera
```sh
#!/bin/sh
LINTER="quay.io/coreos/prometheus-operator-lint"
SCRIPT=$(basename "$0")
LINTER="quay.io/coreos/po-tooling"
lint_files() {
if [ -x "$(command -v po-lint)" ]; then
@ -35,17 +34,13 @@ lint_files() {
exit ${had_errors}
elif [ -x "$(command -v docker)" ]; then
echo "Using Dockerized linter."
docker run \
--rm \
--volume "$(pwd):/data:ro" \
--entrypoint "/data/${SCRIPT}" \
--workdir /data \
"${LINTER}" "${1}" "${2}"
docker run --rm --volume "$PWD:/data:ro" --workdir /data ${LINTER} \
/bin/bash -c "/go/bin/po-lint $1/$2"
else
echo "Linter executable not found."
exit 1
fi
}
lint_files "src" "*.yaml"
lint_files "./src" "*.yaml"
```