1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/info.go: assign proxy fields directly

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-11-11 11:03:53 -08:00
parent 2bb1c530d7
commit 1df0bb5a13

View file

@ -86,6 +86,9 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
ServerVersion: dockerversion.Version, ServerVersion: dockerversion.Version,
ClusterStore: daemon.config().ClusterStore, ClusterStore: daemon.config().ClusterStore,
ClusterAdvertise: daemon.config().ClusterAdvertise, ClusterAdvertise: daemon.config().ClusterAdvertise,
HTTPProxy: os.Getenv("http_proxy"),
HTTPSProxy: os.Getenv("https_proxy"),
NoProxy: os.Getenv("no_proxy"),
} }
// TODO Windows. Refactor this more once sysinfo is refactored into // TODO Windows. Refactor this more once sysinfo is refactored into
@ -100,15 +103,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
v.CPUCfsQuota = sysInfo.CPUCfsQuota v.CPUCfsQuota = sysInfo.CPUCfsQuota
} }
if httpProxy := os.Getenv("http_proxy"); httpProxy != "" {
v.HTTPProxy = httpProxy
}
if httpsProxy := os.Getenv("https_proxy"); httpsProxy != "" {
v.HTTPSProxy = httpsProxy
}
if noProxy := os.Getenv("no_proxy"); noProxy != "" {
v.NoProxy = noProxy
}
if hostname, err := os.Hostname(); err == nil { if hostname, err := os.Hostname(); err == nil {
v.Name = hostname v.Name = hostname
} }