From e10b4555e7bcc4786df41e431ceccae3fbaa75f0 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 3 Jul 2015 02:44:04 -0700 Subject: [PATCH] add name, http_proxy, https_proxy and no_proxy to docker info Signed-off-by: Victor Vieux Signed-off-by: Victor Vieux --- api/handlers.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/handlers.go b/api/handlers.go index 15b7884a3f..7cffff385e 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -7,6 +7,7 @@ import ( "fmt" "io/ioutil" "net/http" + "os" "runtime" "sort" "strconv" @@ -37,6 +38,13 @@ func getInfo(c *context, w http.ResponseWriter, r *http.Request) { BridgeNfIp6tables: true, NCPU: c.cluster.TotalCpus(), MemTotal: c.cluster.TotalMemory(), + HttpProxy: os.Getenv("http_proxy"), + HttpsProxy: os.Getenv("https_proxy"), + NoProxy: os.Getenv("no_proxy"), + } + + if hostname, err := os.Hostname(); err == nil { + info.Name = hostname } w.Header().Set("Content-Type", "application/json")