-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat(rules): enable/disable automated rules #1084
feat(rules): enable/disable automated rules #1084
Conversation
Looks mostly good from a reading. I haven't tested it out yet but judging by the test changes I think it would work as expected. One change I would like to see is to use the request body for the cryostat/src/main/java/io/cryostat/net/web/http/api/v1/TargetRecordingPatchHandler.java Line 117 in d55889e
Here we get the request body as a simple String, which is either So rather than |
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.
It might be worth adding an integration test here. I think it can be pretty simple:
- create a rule definition with enabled=false
- start an external target container that matches the rule's matchExpression
- query the list of recordings on that target and assert that the list is empty
- patch the rule to enable it
- sleep a few seconds
- query the recording list again and assert that it has one recording with the expected name
4964b26
to
62043c6
Compare
Created a new test in the AutoRulesIT. |
82f5467
to
df52e59
Compare
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.
Looks good, thanks!
Fixes #773
http PATCH :8181/api/v2/rules/demo?enabled=false
When a rule created disabled is enabled, the rule is activated and it starts recording.