Fix rendering conf twice

This commit is contained in:
Daniel Berteaud 2024-01-05 15:57:18 +01:00
parent 8bfc6c6c3e
commit b620231526
1 changed files with 1 additions and 1 deletions

2
ctctl
View File

@ -607,6 +607,7 @@ ctctl_render_templates(){
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context "${VAR_FILES[@]}" -i "[[ . | toYAML ]]" > ${CONFIG}
# And render it again so we can replace any templated values in the config itself
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context ${VAR_FILES} -f ${CONFIG} -o ${CONFIG}
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context ${VAR_FILES} -f ${CONFIG} -o ${CONFIG}
GOMPLATE_COMMON_ARGS+=(--context .=file://${CONFIG})
echo "Redering bundles with gomplate ${GOMPLATE_COMMON_ARGS[@]} ${GOMPLATE_BUNDLE_ARGS[@]} ${GOMPLATE_OUT_ARGS[@]}"
@ -661,7 +662,6 @@ ctctl_render_templates(){
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context "${VAR_FILES[@]}" -i "[[ . | toYAML ]]" > ${CONFIG}
# And render it again so we can replace any templated values in the config itself
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context ${VAR_FILES} -f ${CONFIG} -o ${CONFIG}
# Render it twice so we can reference 2 levels of templates in variables
gomplate "${GOMPLATE_COMMON_ARGS[@]}" --context ${VAR_FILES} -f ${CONFIG} -o ${CONFIG}
# First, cleanup any previously rendered files