-
Notifications
You must be signed in to change notification settings - Fork 36
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
key does not exists for file backend when value is int or boolean #33
Comments
Sorry, using {{getv("/bcr/port")}}, not {{getenv("/bcr/port")}} |
Keys and values need to be strings in all backends. |
Is there any way to pull boolean or integer values to config from backend? |
Do you need them as ints and bools or would it be ok to transform the values to strings? |
Its ok to be transformed as strings in this requirement. Also any suggestions if we need to use these as ints and bools? |
I think i can try to adjust the file backend so that files like
are parseable. We could then, if neccessary, tranform these values back with a filter function (toInt, toBool or something like that). What do you tink? |
Yes, this will be perfectly fine :-) |
I experienced this too. After looking at it, I think it's because the nodeWalk function for the file backend has no cases for the other types. Compare easykv's nodeWalk with confd's: https://github.com/HeavyHorst/easykv/blob/v1.2.4/file/client.go#L92-L114 confd transforms the value to its string representation so the interface can stay consistent across backends, but it'd be up to the end user to transform them back (if necessary since the values will be rendered as strings in a template anyway). |
I just pushed HeavyHorst/easykv@4d4fac1 |
Thanks @HeavyHorst |
Remco uses the newest easykv release now. Other types should work now (if you build from master). |
Its working thanks. |
Great! |
Is it possible to add info about this fix to v0.12.0-beta.2 release notes? I started with 'stable' 0.11.1 version and spend about an hour investigating this issue. Already prepared test setup to create new issue but finally found this one. |
I added infos to the release notes. |
key does not exists for file backend when value is int or boolean
[0000] INFO remco[6]: set file path backend=file filepath=/opt/better_chef_rundeck/bcr.json
[0000] ERROR remco[6]: createStageFileAndSync failed: create stage file failed: template execution failed: [Error (where: execution) in /etc/remco/templates/run.sh | Line 5 Col 96 near 'getv'] key does not exist: /bcr/port resource=run.sh.toml
[0000] ERROR remco[6]: not all templates could be rendered, trying again after 18 seconds resource=run.sh.toml
Using {{getenv("/bcr/port")}} for value replacement.
My json file bcr.json:
{
"bcr": {
"port": 3000
}
}
The text was updated successfully, but these errors were encountered: