-
Notifications
You must be signed in to change notification settings - Fork 989
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
Fixes #31545: Add status of Rails cache to Ping API #9793
Conversation
Issues: #31545 |
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.
Do we want to provide an overall OK/FAIL? I've been thinking about a cache set (with a short TTL) to test it end-to-end. Could be a potential attack vector though.
I've done a round of updates here and found that #9857 is required to not get errors. |
acb6ca8
to
d1e1a78
Compare
When using a non-redis cache, do you feel that the response should be: empty
not present
|
I think I prefer either completely omitting |
I see that the So I think it should be an empty node, since we do know that the cache should be monitored, but we can't tell anything about its status. For me, missing node means that the status doesn't supply information about cache at all. |
This was removed originally to avoid leaking information to a non-authenticated API endpoint. |
Also, this would be nice if we'd have a follow-up PR to hammer https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/ping.rb :) |
What is the needed follow up? I just assumed hammer outputs whatever the API sends. I'm sensing my assumption is incorrect. |
Well, if it was just a blob, it would be true, but since we use explicit fields there, one must be added. Didn't tests this PR against hammer though, so if you'll see the output then the follow-up is not needed. |
Once this is merged, I'll take a look at hammer. I think this PR is ready to go? |
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.
After applying the fix this seems to work fine for me.
hammer
is at least not confused by the new fields:
[root@centos8-stream-foreman-nightly foreman]# hammer status
Version: 3.9.0-develop
API Version: v2
Database:
Status: ok
Server Response: Duration: 1ms
Plugins:
1) Name: foreman_puppet
Version: 6.1.0
Smart Proxies:
1) Name: centos8-stream-foreman-nightly.tanso.example.com
Version: 3.9.0-develop
Status: ok
Features:
1) Name: puppetca
Version: 3.9.0
2) Name: puppet
Version: 3.9.0
3) Name: logs
Version: 3.9.0
Compute Resources:
[root@centos8-stream-foreman-nightly foreman]# hammer ping
database:
Status: ok
Server Response: Duration: 0ms
1e1f4aa
to
d0e7a5a
Compare
Wonder if this works w/o rebase: /packit build |
@ofedoren would you mind having a look with hammer eyes? ;-) I had added
to my hammer ping.rb and things do not look too crazy |
well, ideally they shouldn't :) And something like that (ideally) I'd expect in hammer to be able to see the cache details in hammer output. 👍 |
|
Output from the API in the current format:
Some considerations: