-
Notifications
You must be signed in to change notification settings - Fork 37
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
Expose datasource variables __DS_PATH__ and __DS_NAME__ to exec command configuration #262
Comments
Unfortunately computed variables are evaluated at startup and added to the bag of variables given to the jsonnet VM. It's not possible with the current design to have a variable that is created at the point of data source import. |
that said, what you are proposing is a neat idea - let me think about a mechanism to implement it. |
the way I was thinking this would work is that we would implement a first-class helm3 data source rather than shoe-horning it into the exec data source. |
also pretty sure that you cannot import a binary file like a TGZ file using |
This is just a path which is a parameter for helm. Helm renders template and output it as yaml. Right now I use similar approach, but with hardcoded values instead of |
+1 for this, nice example @Andor 👍 |
To me it would be very convenient way to pass parameters via data url. Eg. something like this: local p = import '../../params.libsonnet';
local params = p.components.victoriametrics;
local chart = 'https://github.com/VictoriaMetrics/helm-charts/raw/347d4558d9c25cd341718bf5a2ee167da042c080/packages/victoria-metrics-cluster-0.9.6.tgz';
parap
renderedChart = importstr 'data://helm/template?name=victoriametrics&chart=' + std.base64(chart) + '&values=' + std.base64(params.values);
std.native('parseYaml')(renderedChart) But it depends on google/jsonnet#196 |
if imports could be computed all this data source business that qbec has wouldn't exist at all :) These importers were written specifically because computed imports don't work. |
The data source design gets around the inability to have a computed import by doing a level of indirection such that But that's the key distinction - at startup. Once the initial computation is done, everything is still deterministic as jsonnet requires it to be. What we are essentially trying to do here is get around the at startup limitation which simply cannot be done without forking how jsonnet works. I have some ideas on how to implement this but I need a weekend to try them out :) Well, not exactly this proposal but something almost as convenient. |
thinking out loud, very rough ideas... Currently we have one We could introduce a Then the import could be written as
where |
|
well, actually since it is the |
Sound reasonable, I agree. |
This seems like a good time to evaluate if we want to venture into the plugin space. Define a standard plugin interface and helm could be one implementation |
You mean out of process plugins, right? I'd rather implement a couple like helm3 and possibly vault in-tree and then figure out if a plugin model is needed, can be supported and so on... It's a big investment of time that we are currently in shortage of :( |
Helm3 data source with examples and no docs or tests :) |
Example for kinda universal helm-template datasource:
qbec.yaml
:components/victoriametrics.jsonnet
:environments/test.jsonnet
:The text was updated successfully, but these errors were encountered: