Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shtripat
Copy link
Contributor

@shtripat shtripat commented Apr 1, 2019

Signed-off-by: Shubhendu shtripat@redhat.com

Signed-off-by: Shubhendu <shtripat@redhat.com>
@shtripat
Copy link
Contributor Author

shtripat commented Apr 1, 2019

@umangachapagain @cloudbehl please review

@shtripat
Copy link
Contributor Author

shtripat commented Apr 1, 2019

@anmolsachan review please

@@ -29,3 +29,4 @@ script:
done

- make all
- make generate_k8s
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

@@ -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 -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of semicolon(;) it's better we use && syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

cd extras; cp manifests/prometheus-rules.yaml .; jb install; ./build.sh example.jsonnet; cd -
cmp -s extras/prometheus-rules.yaml extras/manifests/prometheus-rules.yaml; \
RETVAL=$$?; \
if [ $$RETVAL -eq 0 ]; then \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "not equal to 0" ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a mistake. Will correct that.

@@ -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 -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think line 25 will always fail because jb install; will always clone the upstream. The genterated manifests/prometheus-rules.yaml from ./build.sh example.jsonnet; will always be made from the upstream cloned code. Because of this comparision will always fail.
I think before ./build.sh example.jsonnet; the following line should be added so that the cloned code gets the changes made in the pr : cp -R ./../alerts/* ./vendor/ceph-mixins/alerts/

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 vendor directory like cyclic dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants