Skip to content

Commit

Permalink
Fix syslog enabled value
Browse files Browse the repository at this point in the history
Context: syslog should be automatically enabled if other fields (e.g. facility
or name) values are provided. This is documented in CTS

Issue: syslog enabled field has to be specifically set to true. Otherwise it is
false even though other config fields are provided.

This was caused by the default was set to enabled=false. When CTS builds the
config, the user-provided config is merged with the default config. If the user
left enabled unconfigured, it would merge with the default enabled=false. This
results in enabled being set to false in a way that looks as though the user set
enabled to false.

Related: #812
  • Loading branch information
lornasong committed Apr 26, 2022
1 parent 2f81df7 commit dd49eb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type SyslogConfig struct {
// DefaultSyslogConfig returns the default configuration struct.
func DefaultSyslogConfig() *SyslogConfig {
return &SyslogConfig{
Enabled: Bool(false),
// No default values. `Enabled` value depends on other fields as
// handled in Finalize()
}
}

Expand Down

0 comments on commit dd49eb7

Please sign in to comment.