3939
4040 flags Flags
4141
42- // the state of acquisition
43- dataSources []acquisitionTypes.DataSource
4442 // the state of the buckets
4543 holders []leakybucket.BucketFactory
4644
@@ -66,27 +64,29 @@ func LoadBuckets(cConfig *csconfig.Config, hub *cwhub.Hub) error {
6664}
6765
6866func LoadAcquisition (ctx context.Context , cConfig * csconfig.Config , hub * cwhub.Hub ) ([]acquisitionTypes.DataSource , error ) {
67+ var datasources []acquisitionTypes.DataSource
68+
6969 if flags .SingleFileType != "" && flags .OneShotDSN != "" {
7070 flags .Labels ["type" ] = flags .SingleFileType
7171
7272 ds , err := acquisition .LoadAcquisitionFromDSN (ctx , flags .OneShotDSN , flags .Labels , flags .Transform , hub )
7373 if err != nil {
7474 return nil , err
7575 }
76- dataSources = append (dataSources , ds )
76+ datasources = append (datasources , ds )
7777 } else {
7878 dss , err := acquisition .LoadAcquisitionFromFiles (ctx , cConfig .Crowdsec , cConfig .Prometheus , hub )
7979 if err != nil {
8080 return nil , err
8181 }
82- dataSources = dss
82+ datasources = dss
8383 }
8484
85- if len (dataSources ) == 0 {
85+ if len (datasources ) == 0 {
8686 return nil , errors .New ("no datasource enabled" )
8787 }
8888
89- return dataSources , nil
89+ return datasources , nil
9090}
9191
9292// LoadConfig returns a configuration parsed from configuration file
0 commit comments