From 22702c228513ef21d3b9fdc6d28220cafb64cd3c Mon Sep 17 00:00:00 2001
From: Jan Chaloupka <jchaloup@redhat.com>
Date: Tue, 7 Jul 2015 03:04:57 +0200
Subject: [PATCH] set ETCD_ADVERTISE_CLIENT_URLS if needed
---
main.go | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/main.go b/main.go
index d627fb0..844b175 100644
--- a/main.go
+++ b/main.go
@@ -24,7 +24,15 @@
package main
import "github.com/coreos/etcd/etcdmain"
+import "os"
+import "log"
func main() {
+ etcd_listen_client_urls := os.Getenv("ETCD_LISTEN_CLIENT_URLS")
+ if etcd_listen_client_urls != "" &&
+ os.Getenv("ETCD_ADVERTISE_CLIENT_URLS") == "" {
+ if os.Setenv("ETCD_ADVERTISE_CLIENT_URLS", etcd_listen_client_urls) == nil {
+ log.Printf("etcd: ETCD_LISTEN_CLIENT_URLS set but ETCD_ADVERTISE_CLIENT_URLS not, setting ETCD_ADVERTISE_CLIENT_URLS to ETCD_ADVERTISE_CLIENT_URLS")}
+ }
etcdmain.Main()
}
--
1.9.3