Skip to content

Commit

Permalink
Expose memberlist config label (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Fratto <[email protected]>
  • Loading branch information
wildum and rfratto authored Aug 28, 2023
1 parent 0f8917b commit f92727a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type Config struct {
// Optional sharder to synchronize cluster changes to. Synchronization of the
// Sharder happens prior to Observers being notified of changes.
Sharder shard.Sharder

// Optional identifier to prevent clusters from accidentally merging.
// Nodes are prevented from joining a cluster with an explicit label if
// they do not share the same label.
Label string
}

func (c *Config) validate() error {
Expand Down Expand Up @@ -168,6 +173,7 @@ func NewNode(cli *http.Client, cfg Config) (*Node, error) {
mlc.AdvertiseAddr = advertiseIP.String()
mlc.AdvertisePort = advertisePort
mlc.LogOutput = io.Discard
mlc.Label = cfg.Label

if cfg.Log != nil {
mlc.LogOutput = log.NewStdlibAdapter(level.Debug(log.With(cfg.Log, "component", "memberlist")))
Expand Down

0 comments on commit f92727a

Please sign in to comment.