keep logs_agent simple

This commit is contained in:
kongfei 2022-06-02 01:02:21 +08:00
parent a5300405a7
commit 1f6a816969
1 changed files with 1 additions and 3 deletions

View File

@ -150,13 +150,11 @@ const (
func startLogAgent() {
logSources := logsconfig.NewLogSources()
var sources []*logsconfig.LogSource
for _, c := range coreConfig.LogConfig.Items {
if c == nil {
continue
}
source := logsconfig.NewLogSource(c.Name, c)
sources = append(sources, source)
if err := c.Validate(); err != nil {
log.Println("W! Invalid logs configuration:", err)
source.Status.Error(err)
@ -165,7 +163,7 @@ func startLogAgent() {
logSources.AddSource(source)
}
if len(sources) == 0 {
if coreConfig.LogConfig != nil && len(coreConfig.LogConfig.Items) == 0 {
return
}
httpConnectivity := logsconfig.HTTPConnectivityFailure