From 0ce84a83c5c22285cabe4dc397777119010b59d5 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Tue, 21 Jul 2020 15:50:24 -0600 Subject: [PATCH] Added -cluster_name command line option This is handy for client libraries that start the server as external executable and pass command line arguments. Without specifying the cluster name, routes can take time to establish and cause some tests to fail. Signed-off-by: Ivan Kozlovic --- main.go | 1 + server/opts.go | 1 + 2 files changed, 2 insertions(+) diff --git a/main.go b/main.go index 8852843e..dcc0751b 100644 --- a/main.go +++ b/main.go @@ -66,6 +66,7 @@ TLS Options: Cluster Options: --routes Routes to solicit and connect --cluster Cluster URL for solicited routes + --cluster_name Cluster Name, if not set one will be dynamically generated --no_advertise Advertise known cluster IPs to clients --cluster_advertise Cluster URL to advertise to other servers --connect_retries For implicit routes, number of connect retries diff --git a/server/opts.go b/server/opts.go index 625ac3cc..375621a0 100644 --- a/server/opts.go +++ b/server/opts.go @@ -3595,6 +3595,7 @@ func ConfigureOptions(fs *flag.FlagSet, args []string, printVersion, printHelp, fs.StringVar(&opts.Cluster.Advertise, "cluster_advertise", "", "Cluster URL to advertise to other servers.") fs.BoolVar(&opts.Cluster.NoAdvertise, "no_advertise", false, "Advertise known cluster IPs to clients.") fs.IntVar(&opts.Cluster.ConnectRetries, "connect_retries", 0, "For implicit routes, number of connect retries.") + fs.StringVar(&opts.Cluster.Name, "cluster_name", "", "Cluster Name, if not set one will be dynamically generated.") fs.BoolVar(&showTLSHelp, "help_tls", false, "TLS help.") fs.BoolVar(&opts.TLS, "tls", false, "Enable TLS.") fs.BoolVar(&opts.TLSVerify, "tlsverify", false, "Enable TLS with client verification.")