Closed engelmi closed 4 months ago
Based on our documentation:
Each configuration file should end with .conf suffix, otherwise it's ignored.
However, we only check if .conf is in the file name, not that it ends with it: https://github.com/eclipse-bluechi/bluechi/blob/main/src/libbluechi/common/cfg.c#L234-L239
.conf
Creating two configuration files in /etc/bluechi/controller.conf.d/:
/etc/bluechi/controller.conf.d/
ctrl.conf
ctrl.conf.backup
With different settings, e.g. having port 8420 in the first and 8421 in the second.
Starting bluechi-controller.
bluechi-controller
The same approach can be used with the bluechi-agent - it results in the same behavior.
bluechi-agent
The option from the second configuration (ctrl.conf.backup) is used even though its name doesn't end with .conf.
ctrl.conf.backup is ignored and the option from ctrl.conf is used.
Describe the bug
Based on our documentation:
However, we only check if
.conf
is in the file name, not that it ends with it: https://github.com/eclipse-bluechi/bluechi/blob/main/src/libbluechi/common/cfg.c#L234-L239To Reproduce
Creating two configuration files in
/etc/bluechi/controller.conf.d/
:ctrl.conf
ctrl.conf.backup
With different settings, e.g. having port 8420 in the first and 8421 in the second.
Starting
bluechi-controller
.The same approach can be used with the
bluechi-agent
- it results in the same behavior.The option from the second configuration (
ctrl.conf.backup
) is used even though its name doesn't end with.conf
.Expected behavior
ctrl.conf.backup
is ignored and the option fromctrl.conf
is used.