remove WARNING writter twice

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
Victor Vieux 2014-02-28 02:40:15 +00:00
parent 31e08fdc96
commit f67e725e68
1 changed files with 4 additions and 4 deletions

View File

@ -1631,11 +1631,11 @@ func (srv *Server) ContainerCreate(job *engine.Job) engine.Status {
return job.Errorf("Minimum memory limit allowed is 512k") return job.Errorf("Minimum memory limit allowed is 512k")
} }
if config.Memory > 0 && !srv.runtime.sysInfo.MemoryLimit { if config.Memory > 0 && !srv.runtime.sysInfo.MemoryLimit {
job.Errorf("WARNING: Your kernel does not support memory limit capabilities. Limitation discarded.\n") job.Errorf("Your kernel does not support memory limit capabilities. Limitation discarded.\n")
config.Memory = 0 config.Memory = 0
} }
if config.Memory > 0 && !srv.runtime.sysInfo.SwapLimit { if config.Memory > 0 && !srv.runtime.sysInfo.SwapLimit {
job.Errorf("WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.\n") job.Errorf("Your kernel does not support swap limit capabilities. Limitation discarded.\n")
config.MemorySwap = -1 config.MemorySwap = -1
} }
resolvConf, err := utils.GetResolvConf() resolvConf, err := utils.GetResolvConf()
@ -1643,7 +1643,7 @@ func (srv *Server) ContainerCreate(job *engine.Job) engine.Status {
return job.Error(err) return job.Error(err)
} }
if !config.NetworkDisabled && len(config.Dns) == 0 && len(srv.runtime.config.Dns) == 0 && utils.CheckLocalDns(resolvConf) { if !config.NetworkDisabled && len(config.Dns) == 0 && len(srv.runtime.config.Dns) == 0 && utils.CheckLocalDns(resolvConf) {
job.Errorf("WARNING: Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : %v\n", defaultDns) job.Errorf("Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : %v\n", defaultDns)
config.Dns = defaultDns config.Dns = defaultDns
} }
@ -1659,7 +1659,7 @@ func (srv *Server) ContainerCreate(job *engine.Job) engine.Status {
return job.Error(err) return job.Error(err)
} }
if !container.Config.NetworkDisabled && srv.runtime.sysInfo.IPv4ForwardingDisabled { if !container.Config.NetworkDisabled && srv.runtime.sysInfo.IPv4ForwardingDisabled {
job.Errorf("WARNING: IPv4 forwarding is disabled.\n") job.Errorf("IPv4 forwarding is disabled.\n")
} }
srv.LogEvent("create", container.ID, srv.runtime.repositories.ImageName(container.Image)) srv.LogEvent("create", container.ID, srv.runtime.repositories.ImageName(container.Image))
// FIXME: this is necessary because runtime.Create might return a nil container // FIXME: this is necessary because runtime.Create might return a nil container