|
@@ -73,8 +73,7 @@ func reloadHandler(sig os.Signal) (*csconfig.Config, error) {
|
|
return nil, fmt.Errorf("unable to init api server: %w", err)
|
|
return nil, fmt.Errorf("unable to init api server: %w", err)
|
|
}
|
|
}
|
|
|
|
|
|
- apiReady := make(chan bool, 1)
|
|
|
|
- serveAPIServer(apiServer, apiReady)
|
|
|
|
|
|
+ serveAPIServer(apiServer)
|
|
}
|
|
}
|
|
|
|
|
|
if !cConfig.DisableAgent {
|
|
if !cConfig.DisableAgent {
|
|
@@ -295,7 +294,7 @@ func HandleSignals(cConfig *csconfig.Config) error {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
-func Serve(cConfig *csconfig.Config, apiReady chan bool, agentReady chan bool) error {
|
|
|
|
|
|
+func Serve(cConfig *csconfig.Config, agentReady chan bool) error {
|
|
acquisTomb = tomb.Tomb{}
|
|
acquisTomb = tomb.Tomb{}
|
|
parsersTomb = tomb.Tomb{}
|
|
parsersTomb = tomb.Tomb{}
|
|
bucketsTomb = tomb.Tomb{}
|
|
bucketsTomb = tomb.Tomb{}
|
|
@@ -346,10 +345,8 @@ func Serve(cConfig *csconfig.Config, apiReady chan bool, agentReady chan bool) e
|
|
}
|
|
}
|
|
|
|
|
|
if !flags.TestMode {
|
|
if !flags.TestMode {
|
|
- serveAPIServer(apiServer, apiReady)
|
|
|
|
|
|
+ serveAPIServer(apiServer)
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- apiReady <- true
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if !cConfig.DisableAgent {
|
|
if !cConfig.DisableAgent {
|
|
@@ -366,6 +363,8 @@ func Serve(cConfig *csconfig.Config, apiReady chan bool, agentReady chan bool) e
|
|
// if it's just linting, we're done
|
|
// if it's just linting, we're done
|
|
if !flags.TestMode {
|
|
if !flags.TestMode {
|
|
serveCrowdsec(csParsers, cConfig, hub, agentReady)
|
|
serveCrowdsec(csParsers, cConfig, hub, agentReady)
|
|
|
|
+ } else {
|
|
|
|
+ agentReady <- true
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
agentReady <- true
|
|
agentReady <- true
|