refuse to start if plugins are enabled and their config is missing
@@ -18,6 +18,15 @@ func initAPIServer(cConfig *csconfig.Config) (*apiserver.APIServer, error) {
if hasPlugins(cConfig.API.Server.Profiles) {
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)
if err != nil {
return nil, fmt.Errorf("unable to run local API: %s", err)
