pantacor / pvr

mirror of https://gitlab.com/pantacor/pvr/
https://gitlab.com/pantacor/pvr/
Apache License 2.0
1 stars 0 forks source link

Add LXC extra configuration line by line with PV_LXC_EXTRA_CONF #7

Open anpopa opened 2 years ago

anpopa commented 2 years ago

Currently adding extra configuration in PV_LXC_EXTRA_CONF result in sourcing the value content directly without any option to define multiple lines in the configuration file. For example an array of strings like:

"PV_LXC_EXTRA_CONF" : [ "lxc.mount.entry = <mount1>\n", "lxc.mount.entry = <mount2>\n" ], will generate the invalid lxc.container.conf output:

[ lxc.mount.entry = <mount1> lxc.mount.entry = <mount1> ] The issue is how the value is sourced in the template file: https://github.com/pantacor/pvr/blob/master/templates/builtin-lxc-docker.go#L156 Is very hard to work with a very long line in configuration files. Is better to split the extra conf with an array of strings. Other options like PV_LXC_CAP_KEEP are actually handling the elements as key:value which makes the split possible.

asac commented 2 years ago

Yes, I agree that this is a worthwhile improvement to make with pvr. Would have to try how to make a good improvement without breaking the current format of that CONF entry....

asac commented 2 years ago

if you feel you have a PR I would happily take it.... please use our gitlab.com/pantacor/pvr code base to submit a MR though as that is the current primary source tree...