Skip to content

Commit

Permalink
lifecycler uses interface autodetect
Browse files Browse the repository at this point in the history
  • Loading branch information
aldernero authored and pracucci committed Feb 10, 2022
1 parent a9283b4 commit 45071db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ring/lifecycler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/kv"
"github.com/grafana/dskit/netutil"
"github.com/grafana/dskit/services"
)

Expand Down Expand Up @@ -81,7 +82,7 @@ func (cfg *LifecyclerConfig) RegisterFlagsWithPrefix(prefix string, f *flag.Flag
panic(fmt.Errorf("failed to get hostname %s", err))
}

cfg.InfNames = []string{"eth0", "en0"}
cfg.InfNames = netutil.PrivateNetworkInterfaces(log.NewLogfmtLogger(os.Stdout))
f.Var((*flagext.StringSlice)(&cfg.InfNames), prefix+"lifecycler.interface", "Name of network interface to read address from.")
f.StringVar(&cfg.Addr, prefix+"lifecycler.addr", "", "IP address to advertise in the ring.")
f.IntVar(&cfg.Port, prefix+"lifecycler.port", 0, "port to advertise in consul (defaults to server.grpc-listen-port).")
Expand Down

0 comments on commit 45071db

Please sign in to comment.