diff --git a/cmd/hepto/config.go b/cmd/hepto/config.go index e2f90cc9b8ca1ae442ef634bfca017779892b077..2fc0325b2d302b6b8b9ebc10876f3b52ceec6368 100644 --- a/cmd/hepto/config.go +++ b/cmd/hepto/config.go @@ -6,6 +6,7 @@ import ( "fmt" "net/netip" "os" + "strings" "github.com/go-logr/logr" "github.com/go-logr/zapr" @@ -62,10 +63,15 @@ func (c *Config) FlagSet() *flag.FlagSet { return err }) fs.IntVar(&config.Cluster.DiscoveryPort, "discovery-port", 7123, "TCP port used for discovery") - fs.Func("anchor", "IP address or name of an another cluster node", func(raw string) error { - ip, err := netip.ParseAddr(raw) - config.Cluster.Anchors = append(config.Cluster.Anchors, ip.String()) - return err + fs.Func("anchor", "IP addresses or FQDNs separated by commas for other cluster nodes", func(anchors string) error { + for _, raw := range strings.Split(anchors, ",") { + ip, err := netip.ParseAddr(raw) + if err != nil { + return err + } + config.Cluster.Anchors = append(config.Cluster.Anchors, ip.String()) + } + return nil }) // Container settings fs.StringVar(&config.Iface.Master, "iface", "", "Master network interface")