Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 82f390e

Browse files
author
Arnaud Porterie
committed
Merge pull request moby#11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
2 parents bc7d1d6 + bffe04b commit 82f390e

11 files changed

Lines changed: 28 additions & 28 deletions

File tree

daemon/container.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -897,15 +897,15 @@ func (container *Container) GetSize() (int64, int64) {
897897
)
898898

899899
if err := container.Mount(); err != nil {
900-
log.Errorf("Warning: failed to compute size of container rootfs %s: %s", container.ID, err)
900+
log.Errorf("Failed to compute size of container rootfs %s: %s", container.ID, err)
901901
return sizeRw, sizeRootfs
902902
}
903903
defer container.Unmount()
904904

905905
initID := fmt.Sprintf("%s-init", container.ID)
906906
sizeRw, err = driver.DiffSize(container.ID, initID)
907907
if err != nil {
908-
log.Errorf("Warning: driver %s couldn't return diff size of container %s: %s", driver, container.ID, err)
908+
log.Errorf("Driver %s couldn't return diff size of container %s: %s", driver, container.ID, err)
909909
// FIXME: GetSize should return an error. Not changing it now in case
910910
// there is a side-effect.
911911
sizeRw = -1
@@ -1236,15 +1236,15 @@ func (container *Container) initializeNetworking() error {
12361236
// Make sure the config is compatible with the current kernel
12371237
func (container *Container) verifyDaemonSettings() {
12381238
if container.Config.Memory > 0 && !container.daemon.sysInfo.MemoryLimit {
1239-
log.Infof("WARNING: Your kernel does not support memory limit capabilities. Limitation discarded.")
1239+
log.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
12401240
container.Config.Memory = 0
12411241
}
12421242
if container.Config.Memory > 0 && !container.daemon.sysInfo.SwapLimit {
1243-
log.Infof("WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.")
1243+
log.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.")
12441244
container.Config.MemorySwap = -1
12451245
}
12461246
if container.daemon.sysInfo.IPv4ForwardingDisabled {
1247-
log.Infof("WARNING: IPv4 forwarding is disabled. Networking will not work")
1247+
log.Warnf("IPv4 forwarding is disabled. Networking will not work")
12481248
}
12491249
}
12501250

daemon/daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,11 +1231,11 @@ func checkKernel() error {
12311231
// the circumstances of pre-3.8 crashes are clearer.
12321232
// For details see http://github.com/docker/docker/issues/407
12331233
if k, err := kernel.GetKernelVersion(); err != nil {
1234-
log.Infof("WARNING: %s", err)
1234+
log.Warnf("%s", err)
12351235
} else {
12361236
if kernel.CompareKernelVersion(k, &kernel.KernelVersionInfo{Kernel: 3, Major: 8, Minor: 0}) < 0 {
12371237
if os.Getenv("DOCKER_NOWARN_KERNEL_VERSION") == "" {
1238-
log.Infof("WARNING: You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
1238+
log.Warnf("You are running linux kernel version %s, which might be unstable running docker. Please upgrade your kernel to 3.8.0.", k.String())
12391239
}
12401240
}
12411241
}

daemon/execdriver/lxc/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
261261
log.Debugf("oomKill error %s waitErr %s", oomKill, waitErr)
262262

263263
} else {
264-
log.Warnf("WARNING: Your kernel does not support OOM notifications: %s", err)
264+
log.Warnf("Your kernel does not support OOM notifications: %s", err)
265265
}
266266

267267
<-waitLock

daemon/execdriver/native/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
155155
oomKillNotification, err := cont.NotifyOOM()
156156
if err != nil {
157157
oomKillNotification = nil
158-
log.Warnf("WARNING: Your kernel does not support OOM notifications: %s", err)
158+
log.Warnf("Your kernel does not support OOM notifications: %s", err)
159159
}
160160
waitF := p.Wait
161161
if nss := cont.Config().Namespaces; nss.Contains(configs.NEWPID) {

daemon/graphdriver/aufs/aufs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (a *Driver) Remove(id string) error {
216216
defer a.Unlock()
217217

218218
if a.active[id] != 0 {
219-
log.Errorf("Warning: removing active id %s", id)
219+
log.Errorf("Removing active id %s", id)
220220
}
221221

222222
// Make sure the dir is umounted first

daemon/graphdriver/aufs/mount.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func Unmount(target string) error {
1111
if err := exec.Command("auplink", target, "flush").Run(); err != nil {
12-
log.Errorf("[warning]: couldn't run auplink before unmount: %s", err)
12+
log.Errorf("Couldn't run auplink before unmount: %s", err)
1313
}
1414
if err := syscall.Unmount(target, 0); err != nil {
1515
return err

daemon/graphdriver/devmapper/deviceset.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func (devices *DeviceSet) deviceFileWalkFunction(path string, finfo os.FileInfo)
347347
}
348348

349349
if dinfo.DeviceId > MaxDeviceId {
350-
log.Errorf("Warning: Ignoring Invalid DeviceId=%d", dinfo.DeviceId)
350+
log.Errorf("Ignoring Invalid DeviceId=%d", dinfo.DeviceId)
351351
return nil
352352
}
353353

@@ -554,7 +554,7 @@ func (devices *DeviceSet) createRegisterDevice(hash string) (*DevInfo, error) {
554554
// happen. Now we have a mechianism to find
555555
// a free device Id. So something is not right.
556556
// Give a warning and continue.
557-
log.Errorf("Warning: Device Id %d exists in pool but it is supposed to be unused", deviceId)
557+
log.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
558558
deviceId, err = devices.getNextFreeDeviceId()
559559
if err != nil {
560560
return nil, err
@@ -606,7 +606,7 @@ func (devices *DeviceSet) createRegisterSnapDevice(hash string, baseInfo *DevInf
606606
// happen. Now we have a mechianism to find
607607
// a free device Id. So something is not right.
608608
// Give a warning and continue.
609-
log.Errorf("Warning: Device Id %d exists in pool but it is supposed to be unused", deviceId)
609+
log.Errorf("Device Id %d exists in pool but it is supposed to be unused", deviceId)
610610
deviceId, err = devices.getNextFreeDeviceId()
611611
if err != nil {
612612
return err
@@ -852,18 +852,18 @@ func (devices *DeviceSet) rollbackTransaction() error {
852852
// closed. In that case this call will fail. Just leave a message
853853
// in case of failure.
854854
if err := devicemapper.DeleteDevice(devices.getPoolDevName(), devices.DeviceId); err != nil {
855-
log.Errorf("Warning: Unable to delete device: %s", err)
855+
log.Errorf("Unable to delete device: %s", err)
856856
}
857857

858858
dinfo := &DevInfo{Hash: devices.DeviceIdHash}
859859
if err := devices.removeMetadata(dinfo); err != nil {
860-
log.Errorf("Warning: Unable to remove metadata: %s", err)
860+
log.Errorf("Unable to remove metadata: %s", err)
861861
} else {
862862
devices.markDeviceIdFree(devices.DeviceId)
863863
}
864864

865865
if err := devices.removeTransactionMetaData(); err != nil {
866-
log.Errorf("Warning: Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
866+
log.Errorf("Unable to remove transaction meta file %s: %s", devices.transactionMetaFile(), err)
867867
}
868868

869869
return nil
@@ -883,7 +883,7 @@ func (devices *DeviceSet) processPendingTransaction() error {
883883
// If open transaction Id is less than pool transaction Id, something
884884
// is wrong. Bail out.
885885
if devices.OpenTransactionId < devices.TransactionId {
886-
log.Errorf("Warning: Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionId, devices.TransactionId)
886+
log.Errorf("Open Transaction id %d is less than pool transaction id %d", devices.OpenTransactionId, devices.TransactionId)
887887
return nil
888888
}
889889

@@ -963,7 +963,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error {
963963

964964
// https://github.com/docker/docker/issues/4036
965965
if supported := devicemapper.UdevSetSyncSupport(true); !supported {
966-
log.Warnf("WARNING: Udev sync is not supported. This will lead to unexpected behavior, data loss and errors")
966+
log.Warnf("Udev sync is not supported. This will lead to unexpected behavior, data loss and errors")
967967
}
968968
log.Debugf("devicemapper: udev sync support: %v", devicemapper.UdevSyncSupported())
969969

@@ -1221,7 +1221,7 @@ func (devices *DeviceSet) deactivateDevice(info *DevInfo) error {
12211221
// Wait for the unmount to be effective,
12221222
// by watching the value of Info.OpenCount for the device
12231223
if err := devices.waitClose(info); err != nil {
1224-
log.Errorf("Warning: error waiting for device %s to close: %s", info.Hash, err)
1224+
log.Errorf("Error waiting for device %s to close: %s", info.Hash, err)
12251225
}
12261226

12271227
devinfo, err := devicemapper.GetInfo(info.Name())
@@ -1584,7 +1584,7 @@ func (devices *DeviceSet) getUnderlyingAvailableSpace(loopFile string) (uint64,
15841584
buf := new(syscall.Statfs_t)
15851585
err := syscall.Statfs(loopFile, buf)
15861586
if err != nil {
1587-
log.Warnf("Warning: Couldn't stat loopfile filesystem %v: %v", loopFile, err)
1587+
log.Warnf("Couldn't stat loopfile filesystem %v: %v", loopFile, err)
15881588
return 0, err
15891589
}
15901590
return buf.Bfree * uint64(buf.Bsize), nil
@@ -1594,7 +1594,7 @@ func (devices *DeviceSet) isRealFile(loopFile string) (bool, error) {
15941594
if loopFile != "" {
15951595
fi, err := os.Stat(loopFile)
15961596
if err != nil {
1597-
log.Warnf("Warning: Couldn't stat loopfile %v: %v", loopFile, err)
1597+
log.Warnf("Couldn't stat loopfile %v: %v", loopFile, err)
15981598
return false, err
15991599
}
16001600
return fi.Mode().IsRegular(), nil

daemon/graphdriver/devmapper/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (d *Driver) Get(id, mountLabel string) (string, error) {
164164
func (d *Driver) Put(id string) error {
165165
err := d.DeviceSet.UnmountDevice(id)
166166
if err != nil {
167-
log.Errorf("Warning: error unmounting device %s: %s", id, err)
167+
log.Errorf("Error unmounting device %s: %s", id, err)
168168
}
169169
return err
170170
}

daemon/graphdriver/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,6 @@ func checkPriorDriver(name, root string) {
184184
}
185185
}
186186
if len(priorDrivers) > 0 {
187-
log.Warnf("graphdriver %s selected. Warning: your graphdriver directory %s already contains data managed by other graphdrivers: %s", name, root, strings.Join(priorDrivers, ","))
187+
log.Warnf("Graphdriver %s selected. Your graphdriver directory %s already contains data managed by other graphdrivers: %s", name, root, strings.Join(priorDrivers, ","))
188188
}
189189
}

engine/job_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestJobStderrString(t *testing.T) {
5858
eng := New()
5959
// FIXME: test multiple combinations of output and status
6060
eng.Register("say_something_in_stderr", func(job *Job) Status {
61-
job.Errorf("Warning, something might happen\nHere it comes!\nOh no...\nSomething happened\n")
61+
job.Errorf("Something might happen\nHere it comes!\nOh no...\nSomething happened\n")
6262
return StatusOK
6363
})
6464

0 commit comments

Comments
 (0)