Skip to content

Commit

Permalink
docs: fix linting user-guide with updated docker image (prometheus-op…
Browse files Browse the repository at this point in the history
…erator#3685)

* 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 <[email protected]>
  • Loading branch information
barakplasma and barakplasma authored Nov 20, 2020
1 parent 1d30fed commit 5173e42
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Documentation/user-guides/linting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
```

0 comments on commit 5173e42

Please sign in to comment.