Skip to content

Commit

Permalink
Fix invalid log for memberlist creation (#6369)
Browse files Browse the repository at this point in the history
The config is a very large struct and some of the fields cannot be
logged:

```
New memberlist cluster" config="<internal error: json: unsupported type: func(string) bool>"
```

We update the call to klog.InfoS so that only a few selected config
fields are logged.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
  • Loading branch information
antoninbas authored May 28, 2024
1 parent df1655c commit 2801ee2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/agent/memberlist/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func NewCluster(
conf.DeadNodeReclaimTime = 10 * time.Millisecond
conf.Events = &memberlist.ChannelEventDelegate{Ch: nodeEventCh}
conf.LogOutput = io.Discard
klog.V(1).InfoS("New memberlist cluster", "config", conf)
klog.V(1).InfoS("Creating new memberlist cluster", "name", conf.Name, "addr", conf.AdvertiseAddr, "port", conf.AdvertisePort, "deadNodeReclaimTime", conf.DeadNodeReclaimTime)

mList, err := memberlist.Create(conf)
if err != nil {
Expand Down

0 comments on commit 2801ee2

Please sign in to comment.