kapitan
kapitan copied to clipboard
Jsonnet doesn't remember file mode
Describe the bug/feature When you render a file with the jinja2 input type, it remembers the file mode (e.g. executable). With the jsonnet input type this is not working.
To Reproduce Steps to reproduce the behavior:
- Have a jsonnet input with the following main.jsonnet:
local kapitan = import 'lib/kapitan.libjsonnet';
{
["apply.sh"]: kapitan.jinja2_template(
"template/apply.sh",
{})
}
- make sure
template/apply.sh
exists and has executable flags (chmod +x template/apply.sh) - the output has no executable flag after compiling
Expected behavior the output file apply.sh should have the same file mode as the input template
Hey, I would like to work on this issue. I am a first-time contributor. Can you suggest relevant resources to be studied for working on this issue?
Hey @sanyam1997 this particular issue requires a bit more thought as jsonnet per se does not allow doing this. An idea to solve this issue is to allow setting a new option in the inventory to set the mode file permissions for a particular pattern of files.
I suggest you have a look at the inputs/base.py
which already has basic support for this, but needs to be rethought.
Hey @ramaro, I am new to open source and was looking for some guidance during the initial phase of open source contribution. Can you please email me at [email protected]?