Using lists in values file causes an error
gadiener opened this issue · 2 comments
gadiener commented
Current Behavior
I get an error using a list in the .ymlv
file. The error is as follows:
13:41:36.862 [info] Reading config file "/bitbucket-config/bitbucket.config".
escript: exception error: no function clause matching bec_yml:to_mustache([<<"admin_group">>]) (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bec_yml.erl, line 33)
in function bitbucket_repo_config:'-read_vars/1-fun-1-'/3 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bitbucket_repo_config.erl, line 53)
in call from maps:fold_1/3 (maps.erl, line 257)
in call from lists:map/2 (lists.erl, line 1239)
in call from bitbucket_repo_config:verify/2 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bitbucket_repo_config.erl, line 25)
in call from bec:do_main/1 (/home/jenkins/agent/workspace/tools-bec_3.2.0/src/bec.erl, line 40)
Steps to Reproduce
- Create the
config.ymlt
andconfig.ymlv
:
config.ymlt
project: {{ project }}
repo: {{ repo }}
users:
admin: []
write: []
read: []
groups:
admin: {{ admin_groups }}
write: []
read: []
config.ymlv:
- project: test
repo: test
admin_groups:
- admin_group
- Run
bec
.
Context
Tested on the docker with the current master state.
docker run --rm -v ${PWD}:/bitbucket-config -t ${BEC_DOCKER_IMAGE} -vv -c /bitbucket-config/bitbucket.config -r /bitbucket-config/config.ymlt
Tested with mustache directly I get the expected output:
project: test
repo: test
users:
admin: []
write: []
read: []
groups:
admin: ["admin_group"]
write: []
read: []
lilach commented
Any news on this? It would be very helpful for me
szaffarano commented
I found a workaround to make it works:
main.ymlv
- project: test
repo: test
admin_groups: "[group1, group2]"
main.ymlt
project: {{ project }}
repo: {{ repo }}
users:
admin: []
write: []
read: []
groups:
admin: {{ admin_groups }}
write: []
read: []
Hope it helps