Skip to content

Added logic to verify the generated prometheus rule file#18

Open
shtripat wants to merge 1 commit into
ceph:masterfrom
shtripat:travis-fixes
Open

Added logic to verify the generated prometheus rule file#18
shtripat wants to merge 1 commit into
ceph:masterfrom
shtripat:travis-fixes

Conversation

@shtripat

@shtripat shtripat commented Apr 1, 2019

Copy link
Copy Markdown
Contributor

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

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

shtripat commented Apr 1, 2019

Copy link
Copy Markdown
Contributor Author

@umangachapagain @cloudbehl please review

@shtripat

shtripat commented Apr 1, 2019

Copy link
Copy Markdown
Contributor Author

@anmolsachan review please

Comment thread .travis.yml
done

- make all
- make generate_k8s

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack.

Comment thread Makefile
rm -rf prometheus_alert_rules.yaml

generate_k8s:
cd extras; cp manifests/prometheus-rules.yaml .; jb install; ./build.sh example.jsonnet; cd -

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Makefile
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
Copy Markdown
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
Copy Markdown
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.

Comment thread Makefile
rm -rf prometheus_alert_rules.yaml

generate_k8s:
cd extras; cp manifests/prometheus-rules.yaml .; jb install; ./build.sh example.jsonnet; cd -

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants