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
The reason kubetpl r templates/deployment.yml -i configs/*.yml isn't working is shell expansion. kubetpl r templates/deployment.yml -i configs/*.yml is interpreted (by the shell) as kubetpl r templates/deployment.yml -i configs/config1.yml configs/config2.yml (not kubetpl r templates/deployment.yml -i configs/config1.yml -i configs/config2.yml) and so kubetpl thinks it's got 2 templates to render - templates/deployment.yml and configs/config2.yml.
On a side note, I do agree the error is confusing (I'll keep this ticket open until the error message is updated to include the path to a file that failed to render).
Getting back to the original question, kubetpl merges data from all -i <file> and so the only way to render the same template multiple times given different configs is (unfortunately) to
forcfgin configs/*.yml;do kubetpl r templates/deployment.yml -i $cfg;done
Maybe i've missed something but I'm looking for a way to do a rendering for multiple input files.
Example:
My template is
deployment.yml
. I have multiple config files in one directoryconfig1.yml
andconfig2.yml
.deployment.yml
contains:config1.yml
contains:config2.yml
contains:What I expect to happen:
what actually happens:
Is there any way to accomplish this scenario?
The text was updated successfully, but these errors were encountered: