-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hack scripts to test urls, update add-runbook #12
base: main
Are you sure you want to change the base?
Conversation
✔️ Deploy Preview for distracted-northcutt-e0bccc ready! 🔨 Explore the source changes: 6862dc7 🔍 Inspect the deploy log: https://app.netlify.com/sites/distracted-northcutt-e0bccc/deploys/620fef66c1b07f00080ac4b5 😎 Browse the preview: https://deploy-preview-12--distracted-northcutt-e0bccc.netlify.app |
#!/usr/bin/env bash | ||
# check urls via trying to connect to hugo server on localhost:1313 | ||
|
||
rm -rf kps | ||
git clone --depth 1 https://github.com/prometheus-community/helm-charts/ kps | ||
|
||
URL_PATHS=$(grep -R "runbook_url:" kps/charts/kube-prometheus-stack | grep .yaml | awk '{print $5}' | tr -d "}" | sort | uniq) | ||
|
||
ENDPOINT=${ENDPOINT:-"http://localhost:1313/runbooks"} | ||
|
||
exit_code=0 | ||
echo "Checking runbook urls... please wait" | ||
|
||
for runbook in $URL_PATHS; do | ||
if ! curl --output /dev/null --silent --head --fail "${ENDPOINT}${runbook}"; then | ||
rule_file=$(grep -n -R "$runbook" kps/charts/kube-prometheus-stack | awk '{print $1}') | ||
echo -e "Missing ${runbook} \n\t $EDITOR $rule_file" | ||
exit_code=1 | ||
fi | ||
done | ||
|
||
if [ $exit_code == 0 ]; then | ||
echo "Great Success, no issues found!" | ||
else | ||
echo "Oh no, errors!" | ||
fi | ||
exit $exit_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using mdox
for this in kube-prometheus and prometheus-operator. I don't see any reason we shouldn't be using it here too.
No description provided.