-
Notifications
You must be signed in to change notification settings - Fork 380
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
Support Arbitrary Plugin JsonData #708
Comments
@andrewm-aero if I remember correctly, there was a problem with CRD generation when using a map. But that was on an older version of the operator-sdk. I can try it again. Not sure if there is any other good reason for whitelisting every single new field. |
If arbitrary maps aren't permitted as fields, a workaround would be to make those fields strings, and parse it as JSON within the operator. |
I'll give this a try with a |
@pb82 have you had a chance to look in to this? |
This doesn't appear to have gone anywhere since, however, in my travels, I found found that the "correct" way to do this is with a |
Is your feature request related to a problem? Please describe.
The
jsonData
field in theGrafanaDatasource
CRD is unnecessarily limiting. Grafana has a plugin architecture, so it is simply not possible to have a field for validation for every plugin. Even if there was a bot that periodically scraped the list of all published plugins, and updated the CRD code to include every field for every plugin (no small feat), this would preclude compatibility with unpublished plugins, effectively making the operator unusable for situations that require in-house plugins.(If applicable)If your feature request solves a bug please provide a link to the community issue
N/A, but a quick search shows there to be several issues filled requesting to add fields for new plugins, which demonstrates the point.
Describe the solution you'd like
Please add a field, e.g.
customJsonData
to theGrafanaDatasource
CRD, which is an arbitrary map, which, if present, andjsonData
is empty, is used verbatim as the jsonData field of the datasource, with no validation. Likewise forcustomSecureJsonData
.Describe alternatives you've considered
The only other solution is to make it explicit that the operator only supports a limited set of plugins, and to document that exact list prominently.
Additional context
Grafana's own API treats these as arbitrary maps: https://github.com/grafana/grafana/blob/23956557d8c6a119b7de5be5c42024e29634d002/pkg/services/provisioning/plugins/types.go#L18
Existing solutions
N/A
The text was updated successfully, but these errors were encountered: