-
Notifications
You must be signed in to change notification settings - Fork 10
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(templates): reimplement custom event templates from mounted volume #445
Conversation
/build_test |
Workflow started at 5/8/2024, 5:46:20 PM. View Actions Run. |
CI build and push: At least one test failed ❌ (JDK17) |
/build_test |
Workflow started at 5/8/2024, 5:53:09 PM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: All tests pass ✅ (JDK17) |
6b486ba
to
4223b86
Compare
…plate by the same name
…ume template by the same name
4223b86
to
14de508
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 to me.
Welcome to Cryostat3! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Fixes: #431
Description of the change:
Adds startup hook processing to the S3-based template storage service. It will scan the templates storage directory (
/opt/cryostat.d/templates.d
by default, same as earlier versions) at start and attempt to upload any files it recursively finds there to S3 storage as an event template. This produces a copy within S3 storage which can be used the same as any other template that the user manually uploads through the UI/API.Motivation for the change:
Part of 2.4 parity - this feature was enabled as a byproduct of old versions' direct filesystem storage of various resources, including custom event templates. The Operator used this to mount configmap files directly into the container's storage. With the move away from direct filesystem storage and instead using S3 for object storage this mechanism didn't work anymore, so this PR brings it back.
How to manually test:
cd cryostat3; mkdir templates; cp mytemplate.jfc templates
- to get amytemplate.jfc
, run the smoketest and download one of the existing event templates. Edit the resulting file and change thelabel
,description
, andprovider
attributes near the top, then move it tocryostat3/mytemplate.jfc
../smoketest.bash -O
mytemplate.jfc
appears as aCUSTOM
template in the tablelabel
attributeTry to delete the custom template and it should be rejectedin the latest version, deletions are accepted. They delete from S3 but leave the original copy on disk in place, so on next restart it would end up re-uploaded to S3.In OpenShift,
oc create configmap mytemplate --from-file=mytemplate.jfc
CORE_IMG=quay.io/andrewazores/cryostat:3.0.0-mounted-templates-1