Skip to content
Snippets Groups Projects
Commit 06560657 authored by kaiyou's avatar kaiyou
Browse files

Merge branch 'feat/several-anchors' into 'release-1.31'

feat: be able to give several anchor

See merge request !21
parents 7e0c76ba 73045ab7
No related branches found
No related tags found
1 merge request!21feat: be able to give several anchor
Pipeline #34657 failed
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"net/netip" "net/netip"
"os" "os"
"strings"
"github.com/go-logr/logr" "github.com/go-logr/logr"
"github.com/go-logr/zapr" "github.com/go-logr/zapr"
...@@ -62,10 +63,15 @@ func (c *Config) FlagSet() *flag.FlagSet { ...@@ -62,10 +63,15 @@ func (c *Config) FlagSet() *flag.FlagSet {
return err return err
}) })
fs.IntVar(&config.Cluster.DiscoveryPort, "discovery-port", 7123, "TCP port used for discovery") 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 { fs.Func("anchor", "IP addresses or FQDNs separated by commas for other cluster nodes", func(anchors string) error {
ip, err := netip.ParseAddr(raw) for _, raw := range strings.Split(anchors, ",") {
config.Cluster.Anchors = append(config.Cluster.Anchors, ip.String()) ip, err := netip.ParseAddr(raw)
return err if err != nil {
return err
}
config.Cluster.Anchors = append(config.Cluster.Anchors, ip.String())
}
return nil
}) })
// Container settings // Container settings
fs.StringVar(&config.Iface.Master, "iface", "", "Master network interface") 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