mirror of
https://github.com/kanidm/kanidm.git
synced 2025-05-23 01:13:54 +02:00
Do not require instances to exist during optional config load (#3591)
* Do not require instances to exist during optional config load We were incorrectly requiring every config file to have the named instance be present during configuration loading. This led to a situation where if /etc/kanidm/config didn't have a user configured instance from their ~/.config/kanidm, that the cli would fail to load. * CLIPS FOR THE CLIP GODS
This commit is contained in:
parent
f2d4f65bc6
commit
b27fd2f3de
|
@ -375,12 +375,15 @@ impl KanidmClientBuilder {
|
|||
if let Some(instance_config) = config.instances.remove(instance_name) {
|
||||
self.apply_config_options(instance_config)
|
||||
} else {
|
||||
let emsg = format!(
|
||||
"instance {} does not exist in config file {:?}",
|
||||
instance_name, config_path
|
||||
info!(
|
||||
"instance {} does not exist in config file {}",
|
||||
instance_name,
|
||||
config_path.as_ref().display()
|
||||
);
|
||||
error!(%emsg);
|
||||
Err(ClientError::ConfigParseIssue(emsg))
|
||||
|
||||
// It's not an error if the instance isn't present, the build step
|
||||
// will fail if there is insufficent information to proceed.
|
||||
Ok(self)
|
||||
}
|
||||
} else {
|
||||
self.apply_config_options(config.default)
|
||||
|
|
Loading…
Reference in a new issue