manager: datamodel: better representation of paths and better error messages
The way we process file paths in our datamodel is kind of messy. In short, all paths are resolved relative to $cwd
and at startup, rundir
is set as the $cwd
. That means, there is an chicken-egg problem. To parse the config, we need to know the rundir
field in the config. So if we check that the file paths exist during config validation, everything could fail. Moreover, the rundir
can be a relative path, therefore the validation result depends on the initial $cwd
.
Proposed solution
- limit
rundir
to be only an absolute path #784 - eliminate dependence on
$cwd
(implicit global variable) and passrundir
around in some context object
Both of these fixes at once would lead to the ability to deterministically load config files from anywhere without any dependence on $cwd
. For example, we could then load the config file from within kresctl
to determine the location of the management socket.
Current state of the MR
- done
- no clue how to do it nicely
These changes might be a dead end and they might not be worth it.