You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you try to template an individual secret object by parsing it out of a JSON file returned by all-secrets kind, and that individual secret doesn't exist in the JSON, AKVA will panic and fail. For example:
resources:
- kind: all-secrets
vaultBaseURL: https://my-testing.vault.azure.net/
sinks:
- path: secrets.json
template: "{{ index .Secrets | toValues | toJson }}"
- path: testcert.pem
template: '{{ index .Secrets "testcert" | fullChain }}' # testcert.pem does not exist in secrets.json
...
AKVA logs show the following:
{"_timestamp":"2023-05-25T13:16:21-04:00","level":"fatal","msg":"Caught Panic In Worker: Error executing template: {{ in
dex .Secrets \"testcert\" | fullChain }} Error: template: template:1:43: executing \"template\" at 'ful
lChain': error calling fullChain: runtime error: invalid memory address or nil pointer dereference"}
Proposed Solution
We should update this code to loop through the resource sinks twice. The first pass will render all of the templates, and if a template fails, AKVA should bail out (but not crash). If all templated items render correctly in the first loop, then AKVA should write them all in the second loop.
The text was updated successfully, but these errors were encountered:
The Issue
Currently, if you try to template an individual secret object by parsing it out of a JSON file returned by all-secrets kind, and that individual secret doesn't exist in the JSON, AKVA will panic and fail. For example:
Proposed Solution
We should update this code to loop through the resource sinks twice. The first pass will render all of the templates, and if a template fails, AKVA should bail out (but not crash). If all templated items render correctly in the first loop, then AKVA should write them all in the second loop.
The text was updated successfully, but these errors were encountered: