Skip to content
Snippets Groups Projects
Verified Commit 73045ab7 authored by cyrinux's avatar cyrinux :construction_worker_tone1:
Browse files

feat: be able to give several anchors comma-separeted

parent 7e0c76ba
No related branches found
No related tags found
1 merge request!21feat: be able to give several anchor
Pipeline #34655 failed
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment