Helm-operator: valuesFromFile to create key's value sourced from file content

Created on 2 Aug 2019  路  2Comments  路  Source: fluxcd/helm-operator

valuesFromFile:
  chartFileRef:
    myScript: path/to/file.js
  externalSourceRef:
    defaultScript: https://raw.githubusercontent.com/cdenneen/example/master/script.js

result in equivalent of:

helm install --set-file key=path/to/file.js

values.yaml myScript: | const { events, Job } = require("brigadier") function run(e, project) { console.log("this is my script") } events.on("run", run) defaultScript: | const { events, Job } = require("brigadier") function run(e, project) { console.log("hello default script") } events.on("run", run)

enhancement good first issue help wanted

Most helpful comment

I see, the aim is to put a file content into a subkey of values, rather than expecting a whole values file. Seems reasonable to me.

I think this can be done backward-compatibly by adding a valuesKey field to externalSourceRef, secretKeyRef, chartFileRef, configMapKeyRef (in the cases of secretKeyRef and configMapKeyRef, there is already a field key, so the new field cannot have that name).

All 2 comments

I see, the aim is to put a file content into a subkey of values, rather than expecting a whole values file. Seems reasonable to me.

I think this can be done backward-compatibly by adding a valuesKey field to externalSourceRef, secretKeyRef, chartFileRef, configMapKeyRef (in the cases of secretKeyRef and configMapKeyRef, there is already a field key, so the new field cannot have that name).

So for backward-compatibly, this would look like this if I understand properly :

valuesFromFile:
  chartFileRef:
    valuesKey: myscript
    path: path/to/file.js
  externalSourceRef:
    valuesKey: defaultScript
    url: https://raw.githubusercontent.com/cdenneen/example/master/script.js

If so, then I can have a look, this is something I'd like to have available to only store externally the values and not the whole yaml structure key: value

Was this page helpful?
0 / 5 - 0 ratings