refuse to start if plugins are enabled and their config is missing (#954)
This commit is contained in:
parent
90e354650b
commit
9b680ae455
|
@ -18,6 +18,15 @@ func initAPIServer(cConfig *csconfig.Config) (*apiserver.APIServer, error) {
|
||||||
|
|
||||||
if hasPlugins(cConfig.API.Server.Profiles) {
|
if hasPlugins(cConfig.API.Server.Profiles) {
|
||||||
log.Info("initiating plugin broker")
|
log.Info("initiating plugin broker")
|
||||||
|
if cConfig.PluginConfig == nil {
|
||||||
|
return nil, fmt.Errorf("plugins are enabled, but no plugin_config section is missing in the configuration")
|
||||||
|
}
|
||||||
|
if cConfig.ConfigPaths.NotificationDir == "" {
|
||||||
|
return nil, fmt.Errorf("plugins are enabled, but config_paths.notification_dir is not defined")
|
||||||
|
}
|
||||||
|
if cConfig.ConfigPaths.PluginDir == "" {
|
||||||
|
return nil, fmt.Errorf("plugins are enabled, but config_paths.plugin_dir is not defined")
|
||||||
|
}
|
||||||
err = pluginBroker.Init(cConfig.PluginConfig, cConfig.API.Server.Profiles, cConfig.ConfigPaths)
|
err = pluginBroker.Init(cConfig.PluginConfig, cConfig.API.Server.Profiles, cConfig.ConfigPaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to run local API: %s", err)
|
return nil, fmt.Errorf("unable to run local API: %s", err)
|
||||||
|
|
Loading…
Reference in a new issue