Skip to content

Commit

Permalink
Merge pull request #207 from Cryptophobia/master
Browse files Browse the repository at this point in the history
fix(config.go): fix buffer path name check
  • Loading branch information
Cryptophobia authored Apr 21, 2021
2 parents 39ef433 + c82dafe commit c0be66d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config-reloader/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (cfg *Config) Validate() error {
return fmt.Errorf("invalid annotation name: '%s'", cfg.AnnotConfigmapName)
}

if cfg.BufferMountFolder != "" && cfg.hasValidBufferMountFolder() {
if cfg.BufferMountFolder != "" && !cfg.hasValidBufferMountFolder() {
return fmt.Errorf("invalid fluentd buffer mount folder: '%s%s'", "/var/log/", cfg.BufferMountFolder)
}

Expand Down Expand Up @@ -288,9 +288,9 @@ func (cfg *Config) ParseFluentdLogLevel() (string, error) {
func (cfg *Config) hasValidBufferMountFolder() bool {
for _, r := range cfg.BufferMountFolder {
if !unicode.IsLetter(r) && !unicode.IsDigit(r) && r != '-' && r != '_' {
continue
} else {
return false
} else {
continue
}
}
return true
Expand Down

0 comments on commit c0be66d

Please sign in to comment.