Skip to content

Commit

Permalink
Log config without passwords
Browse files Browse the repository at this point in the history
Signed-off-by: sashayakovtseva <[email protected]>
  • Loading branch information
sashayakovtseva committed Aug 2, 2023
1 parent 5ffaf07 commit b6e253e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ type KafkaConfig struct {
// SASL/PLAIN or SASL/SCRAM authentication
Username string
// Password for SASL/PLAIN or SASL/SCRAM authentication
Password string
Password string `json:"-"`
GSSAPI struct {
AuthType int // 1. KRB5_USER_AUTH, 2. KRB5_KEYTAB_AUTH
KeyTabPath string
KerberosConfigPath string
ServiceName string
Username string
Password string
Password string `json:"-"`
Realm string
DisablePAFXFAST bool
}
Expand All @@ -91,7 +91,7 @@ type ClickHouseConfig struct {
Hosts [][]string
Port int
Username string
Password string
Password string `json:"-"`

// Whether enable TLS encryption with clickhouse-server
Secure bool
Expand Down
4 changes: 2 additions & 2 deletions task/sinker.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (s *Sinker) applyConfig(newCfg *config.Config) (err error) {
}

func (s *Sinker) applyFirstConfig(newCfg *config.Config) (err error) {
util.Logger.Info("going to apply the first config")
util.Logger.Info("going to apply the first config", zap.Any("config", newCfg))
// 1. Initialize clickhouse connections
chCfg := &newCfg.Clickhouse
if err = pool.InitClusterConn(chCfg.Hosts, chCfg.Port, chCfg.DB, chCfg.Username, chCfg.Password,
Expand Down Expand Up @@ -339,7 +339,7 @@ func (s *Sinker) applyFirstConfig(newCfg *config.Config) (err error) {
}

func (s *Sinker) applyAnotherConfig(newCfg *config.Config) (err error) {
util.Logger.Info("going to apply another config", zap.Int("number", s.numCfg))
util.Logger.Info("going to apply another config", zap.Int("number", s.numCfg), zap.Any("config", newCfg))
if !reflect.DeepEqual(newCfg.Kafka, s.curCfg.Kafka) || !reflect.DeepEqual(newCfg.Clickhouse, s.curCfg.Clickhouse) {
// 1. Stop tasks gracefully. Wait until all flying data be processed (write to CH and commit to Kafka).
s.stopAllTasks()
Expand Down

0 comments on commit b6e253e

Please sign in to comment.