load feature.yaml as soon as possible
This commit is contained in:
parent
f25fdecc3f
commit
2e91a82aa7
4 changed files with 11 additions and 8 deletions
|
@ -66,10 +66,6 @@ func initConfig() {
|
|||
csConfig = csconfig.NewDefaultConfig()
|
||||
}
|
||||
|
||||
if err := csconfig.LoadFeatureFlagsFile(csConfig, log.StandardLogger()); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// recap of the enabled feature flags, because logging
|
||||
// was not enabled when we set them from envvars
|
||||
if fflist := csconfig.ListFeatureFlags(); fflist != "" {
|
||||
|
|
|
@ -260,10 +260,6 @@ func LoadConfig(cConfig *csconfig.Config) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := csconfig.LoadFeatureFlagsFile(cConfig, log.StandardLogger()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// recap of the enabled feature flags, because logging
|
||||
// was not enabled when we set them from envvars
|
||||
if fflist := csconfig.ListFeatureFlags(); fflist != "" {
|
||||
|
|
|
@ -45,6 +45,10 @@ func (c *Config) LoadCrowdsec() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err = LoadFeatureFlagsFile(c, log.StandardLogger()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if c.Crowdsec == nil {
|
||||
log.Warning("crowdsec agent is disabled")
|
||||
c.DisableAgent = true
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package csconfig
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
/*cscli specific config, such as hub directory*/
|
||||
type CscliCfg struct {
|
||||
Output string `yaml:"output,omitempty"`
|
||||
|
@ -22,6 +26,9 @@ func (c *Config) LoadCSCLI() error {
|
|||
if err := c.LoadConfigurationPaths(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := LoadFeatureFlagsFile(c, log.StandardLogger()); err != nil {
|
||||
return err
|
||||
}
|
||||
c.Cscli.ConfigDir = c.ConfigPaths.ConfigDir
|
||||
c.Cscli.DataDir = c.ConfigPaths.DataDir
|
||||
c.Cscli.HubDir = c.ConfigPaths.HubDir
|
||||
|
|
Loading…
Reference in a new issue