-
Notifications
You must be signed in to change notification settings - Fork 15
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
Added logic to verify the generated prometheus rule file #18
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ script: | |
done | ||
|
||
- make all | ||
- make generate_k8s | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,12 @@ lint: prometheus_alert_rules.yaml | |
|
||
clean: | ||
rm -rf prometheus_alert_rules.yaml | ||
|
||
generate_k8s: | ||
cd extras; cp manifests/prometheus-rules.yaml .; jb install; ./build.sh example.jsonnet; cd - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of semicolon( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand both have different purpose. With && if previous one is successful then only second would be executed. Anyway let me try that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think line 25 will always fail because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes while verifying the changes I figured this out. Will test ad send the updated PR soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly: And this should copy all the files that the dev can change. Eg config files, alert rule files, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR we will take up later as there are other issues while copying the files under |
||
cmp -s extras/prometheus-rules.yaml extras/manifests/prometheus-rules.yaml; \ | ||
RETVAL=$$?; \ | ||
if [ $$RETVAL -eq 0 ]; then \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be "not equal to 0" ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's a mistake. Will correct that. |
||
echo "Rule files are different"; \ | ||
exit 1; \ | ||
fi |
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.
Can we give a name like
kubernetes_object_yaml
?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.
Ack.