mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 21:50:05 +00:00
normalize -etcd_servers flag across all commands
The -etcd_servers flag is used inconsistently by the Kubernetes commands, both externally and internally. This patch fixes the issue by using the same type to represent a list of etcd servers internally, and declares the -etcd_servers flag consistently across all commands. This patch should be 100% backwards compatible with no changes in behavior.
This commit is contained in:
@@ -33,16 +33,20 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
etcdServers = flag.String("etcd_servers", "", "Servers for the etcd (http://ip:port).")
|
||||
master = flag.String("master", "", "The address of the Kubernetes API server")
|
||||
etcdServerList util.StringList
|
||||
master = flag.String("master", "", "The address of the Kubernetes API server")
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.Var(&etcdServerList, "etcd_servers", "List of etcd servers to watch (http://ip:port), comma separated")
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
util.InitLogs()
|
||||
defer util.FlushLogs()
|
||||
|
||||
if len(*etcdServers) == 0 || len(*master) == 0 {
|
||||
if len(etcdServerList) == 0 || len(*master) == 0 {
|
||||
glog.Fatal("usage: controller-manager -etcd_servers <servers> -master <master>")
|
||||
}
|
||||
|
||||
@@ -50,7 +54,7 @@ func main() {
|
||||
etcd.SetLogger(util.NewLogger("etcd "))
|
||||
|
||||
controllerManager := controller.MakeReplicationManager(
|
||||
etcd.NewClient([]string{*etcdServers}),
|
||||
etcd.NewClient(etcdServerList),
|
||||
client.New("http://"+*master, nil))
|
||||
|
||||
controllerManager.Run(10 * time.Second)
|
||||
|
Reference in New Issue
Block a user