@@ -153,7 +153,7 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos
153153 con = strings .SplitN (opt , "=" , 2 )
154154 } else if strings .Contains (opt , ":" ) {
155155 con = strings .SplitN (opt , ":" , 2 )
156- logrus .Warnf ("Security options with `:` as a separator are deprecated and will be completely unsupported in 1.13, use `=` instead." )
156+ logrus .Warn ("Security options with `:` as a separator are deprecated and will be completely unsupported in 1.13, use `=` instead." )
157157 }
158158
159159 if len (con ) != 2 {
@@ -197,7 +197,7 @@ func getBlkioThrottleDevices(devs []*blkiodev.ThrottleDevice) ([]specs.ThrottleD
197197
198198func checkKernelVersion (k , major , minor int ) bool {
199199 if v , err := kernel .GetKernelVersion (); err != nil {
200- logrus .Warnf ("%s" , err )
200+ logrus .Warnf ("error getting kernel version: %s" , err )
201201 } else {
202202 if kernel .CompareKernelVersion (* v , kernel.VersionInfo {Kernel : k , Major : major , Minor : minor }) < 0 {
203203 return false
@@ -273,13 +273,13 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
273273 }
274274 if resources .Memory > 0 && ! sysInfo .MemoryLimit {
275275 warnings = append (warnings , "Your kernel does not support memory limit capabilities. Limitation discarded." )
276- logrus .Warnf ("Your kernel does not support memory limit capabilities. Limitation discarded." )
276+ logrus .Warn ("Your kernel does not support memory limit capabilities. Limitation discarded." )
277277 resources .Memory = 0
278278 resources .MemorySwap = - 1
279279 }
280280 if resources .Memory > 0 && resources .MemorySwap != - 1 && ! sysInfo .SwapLimit {
281281 warnings = append (warnings , "Your kernel does not support swap limit capabilities, memory limited without swap." )
282- logrus .Warnf ("Your kernel does not support swap limit capabilities, memory limited without swap." )
282+ logrus .Warn ("Your kernel does not support swap limit capabilities, memory limited without swap." )
283283 resources .MemorySwap = - 1
284284 }
285285 if resources .Memory > 0 && resources .MemorySwap > 0 && resources .MemorySwap < resources .Memory {
@@ -290,7 +290,7 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
290290 }
291291 if resources .MemorySwappiness != nil && * resources .MemorySwappiness != - 1 && ! sysInfo .MemorySwappiness {
292292 warnings = append (warnings , "Your kernel does not support memory swappiness capabilities, memory swappiness discarded." )
293- logrus .Warnf ("Your kernel does not support memory swappiness capabilities, memory swappiness discarded." )
293+ logrus .Warn ("Your kernel does not support memory swappiness capabilities, memory swappiness discarded." )
294294 resources .MemorySwappiness = nil
295295 }
296296 if resources .MemorySwappiness != nil {
@@ -301,7 +301,7 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
301301 }
302302 if resources .MemoryReservation > 0 && ! sysInfo .MemoryReservation {
303303 warnings = append (warnings , "Your kernel does not support memory soft limit capabilities. Limitation discarded." )
304- logrus .Warnf ("Your kernel does not support memory soft limit capabilities. Limitation discarded." )
304+ logrus .Warn ("Your kernel does not support memory soft limit capabilities. Limitation discarded." )
305305 resources .MemoryReservation = 0
306306 }
307307 if resources .MemoryReservation > 0 && resources .MemoryReservation < linuxMinMemory {
@@ -312,64 +312,64 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
312312 }
313313 if resources .KernelMemory > 0 && ! sysInfo .KernelMemory {
314314 warnings = append (warnings , "Your kernel does not support kernel memory limit capabilities. Limitation discarded." )
315- logrus .Warnf ("Your kernel does not support kernel memory limit capabilities. Limitation discarded." )
315+ logrus .Warn ("Your kernel does not support kernel memory limit capabilities. Limitation discarded." )
316316 resources .KernelMemory = 0
317317 }
318318 if resources .KernelMemory > 0 && resources .KernelMemory < linuxMinMemory {
319319 return warnings , fmt .Errorf ("Minimum kernel memory limit allowed is 4MB" )
320320 }
321321 if resources .KernelMemory > 0 && ! checkKernelVersion (4 , 0 , 0 ) {
322322 warnings = append (warnings , "You specified a kernel memory limit on a kernel older than 4.0. Kernel memory limits are experimental on older kernels, it won't work as expected and can cause your system to be unstable." )
323- logrus .Warnf ("You specified a kernel memory limit on a kernel older than 4.0. Kernel memory limits are experimental on older kernels, it won't work as expected and can cause your system to be unstable." )
323+ logrus .Warn ("You specified a kernel memory limit on a kernel older than 4.0. Kernel memory limits are experimental on older kernels, it won't work as expected and can cause your system to be unstable." )
324324 }
325325 if resources .OomKillDisable != nil && ! sysInfo .OomKillDisable {
326326 // only produce warnings if the setting wasn't to *disable* the OOM Kill; no point
327327 // warning the caller if they already wanted the feature to be off
328328 if * resources .OomKillDisable {
329329 warnings = append (warnings , "Your kernel does not support OomKillDisable, OomKillDisable discarded." )
330- logrus .Warnf ("Your kernel does not support OomKillDisable, OomKillDisable discarded." )
330+ logrus .Warn ("Your kernel does not support OomKillDisable, OomKillDisable discarded." )
331331 }
332332 resources .OomKillDisable = nil
333333 }
334334
335335 if resources .PidsLimit != 0 && ! sysInfo .PidsLimit {
336336 warnings = append (warnings , "Your kernel does not support pids limit capabilities, pids limit discarded." )
337- logrus .Warnf ("Your kernel does not support pids limit capabilities, pids limit discarded." )
337+ logrus .Warn ("Your kernel does not support pids limit capabilities, pids limit discarded." )
338338 resources .PidsLimit = 0
339339 }
340340
341341 // cpu subsystem checks and adjustments
342342 if resources .CPUShares > 0 && ! sysInfo .CPUShares {
343343 warnings = append (warnings , "Your kernel does not support CPU shares. Shares discarded." )
344- logrus .Warnf ("Your kernel does not support CPU shares. Shares discarded." )
344+ logrus .Warn ("Your kernel does not support CPU shares. Shares discarded." )
345345 resources .CPUShares = 0
346346 }
347347 if resources .CPUPeriod > 0 && ! sysInfo .CPUCfsPeriod {
348348 warnings = append (warnings , "Your kernel does not support CPU cfs period. Period discarded." )
349- logrus .Warnf ("Your kernel does not support CPU cfs period. Period discarded." )
349+ logrus .Warn ("Your kernel does not support CPU cfs period. Period discarded." )
350350 resources .CPUPeriod = 0
351351 }
352352 if resources .CPUPeriod != 0 && (resources .CPUPeriod < 1000 || resources .CPUPeriod > 1000000 ) {
353353 return warnings , fmt .Errorf ("CPU cfs period can not be less than 1ms (i.e. 1000) or larger than 1s (i.e. 1000000)" )
354354 }
355355 if resources .CPUQuota > 0 && ! sysInfo .CPUCfsQuota {
356356 warnings = append (warnings , "Your kernel does not support CPU cfs quota. Quota discarded." )
357- logrus .Warnf ("Your kernel does not support CPU cfs quota. Quota discarded." )
357+ logrus .Warn ("Your kernel does not support CPU cfs quota. Quota discarded." )
358358 resources .CPUQuota = 0
359359 }
360360 if resources .CPUQuota > 0 && resources .CPUQuota < 1000 {
361361 return warnings , fmt .Errorf ("CPU cfs quota can not be less than 1ms (i.e. 1000)" )
362362 }
363363 if resources .CPUPercent > 0 {
364364 warnings = append (warnings , "%s does not support CPU percent. Percent discarded." , runtime .GOOS )
365- logrus .Warnf ("%s does not support CPU percent. Percent discarded." , runtime .GOOS )
365+ logrus .Warn ("%s does not support CPU percent. Percent discarded." , runtime .GOOS )
366366 resources .CPUPercent = 0
367367 }
368368
369369 // cpuset subsystem checks and adjustments
370370 if (resources .CpusetCpus != "" || resources .CpusetMems != "" ) && ! sysInfo .Cpuset {
371371 warnings = append (warnings , "Your kernel does not support cpuset. Cpuset discarded." )
372- logrus .Warnf ("Your kernel does not support cpuset. Cpuset discarded." )
372+ logrus .Warn ("Your kernel does not support cpuset. Cpuset discarded." )
373373 resources .CpusetCpus = ""
374374 resources .CpusetMems = ""
375375 }
@@ -391,7 +391,7 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
391391 // blkio subsystem checks and adjustments
392392 if resources .BlkioWeight > 0 && ! sysInfo .BlkioWeight {
393393 warnings = append (warnings , "Your kernel does not support Block I/O weight. Weight discarded." )
394- logrus .Warnf ("Your kernel does not support Block I/O weight. Weight discarded." )
394+ logrus .Warn ("Your kernel does not support Block I/O weight. Weight discarded." )
395395 resources .BlkioWeight = 0
396396 }
397397 if resources .BlkioWeight > 0 && (resources .BlkioWeight < 10 || resources .BlkioWeight > 1000 ) {
@@ -402,27 +402,27 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
402402 }
403403 if len (resources .BlkioWeightDevice ) > 0 && ! sysInfo .BlkioWeightDevice {
404404 warnings = append (warnings , "Your kernel does not support Block I/O weight_device." )
405- logrus .Warnf ("Your kernel does not support Block I/O weight_device. Weight-device discarded." )
405+ logrus .Warn ("Your kernel does not support Block I/O weight_device. Weight-device discarded." )
406406 resources .BlkioWeightDevice = []* pblkiodev.WeightDevice {}
407407 }
408408 if len (resources .BlkioDeviceReadBps ) > 0 && ! sysInfo .BlkioReadBpsDevice {
409409 warnings = append (warnings , "Your kernel does not support Block read limit in bytes per second." )
410- logrus .Warnf ("Your kernel does not support Block I/O read limit in bytes per second. --device-read-bps discarded." )
410+ logrus .Warn ("Your kernel does not support Block I/O read limit in bytes per second. --device-read-bps discarded." )
411411 resources .BlkioDeviceReadBps = []* pblkiodev.ThrottleDevice {}
412412 }
413413 if len (resources .BlkioDeviceWriteBps ) > 0 && ! sysInfo .BlkioWriteBpsDevice {
414414 warnings = append (warnings , "Your kernel does not support Block write limit in bytes per second." )
415- logrus .Warnf ("Your kernel does not support Block I/O write limit in bytes per second. --device-write-bps discarded." )
415+ logrus .Warn ("Your kernel does not support Block I/O write limit in bytes per second. --device-write-bps discarded." )
416416 resources .BlkioDeviceWriteBps = []* pblkiodev.ThrottleDevice {}
417417 }
418418 if len (resources .BlkioDeviceReadIOps ) > 0 && ! sysInfo .BlkioReadIOpsDevice {
419419 warnings = append (warnings , "Your kernel does not support Block read limit in IO per second." )
420- logrus .Warnf ("Your kernel does not support Block I/O read limit in IO per second. -device-read-iops discarded." )
420+ logrus .Warn ("Your kernel does not support Block I/O read limit in IO per second. -device-read-iops discarded." )
421421 resources .BlkioDeviceReadIOps = []* pblkiodev.ThrottleDevice {}
422422 }
423423 if len (resources .BlkioDeviceWriteIOps ) > 0 && ! sysInfo .BlkioWriteIOpsDevice {
424424 warnings = append (warnings , "Your kernel does not support Block write limit in IO per second." )
425- logrus .Warnf ("Your kernel does not support Block I/O write limit in IO per second. --device-write-iops discarded." )
425+ logrus .Warn ("Your kernel does not support Block I/O write limit in IO per second. --device-write-iops discarded." )
426426 resources .BlkioDeviceWriteIOps = []* pblkiodev.ThrottleDevice {}
427427 }
428428
@@ -492,7 +492,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
492492 // ip-forwarding does not affect container with '--net=host' (or '--net=none')
493493 if sysInfo .IPv4ForwardingDisabled && ! (hostConfig .NetworkMode .IsHost () || hostConfig .NetworkMode .IsNone ()) {
494494 warnings = append (warnings , "IPv4 forwarding is disabled. Networking will not work." )
495- logrus .Warnf ("IPv4 forwarding is disabled. Networking will not work" )
495+ logrus .Warn ("IPv4 forwarding is disabled. Networking will not work" )
496496 }
497497 // check for various conflicting options with user namespaces
498498 if daemon .configStore .RemappedRoot != "" && hostConfig .UsernsMode .IsPrivate () {
@@ -916,7 +916,7 @@ func setupRemappedRoot(config *Config) ([]idtools.IDMap, []idtools.IDMap, error)
916916 if username == "root" {
917917 // Cannot setup user namespaces with a 1-to-1 mapping; "--root=0:0" is a no-op
918918 // effectively
919- logrus .Warnf ("User namespaces: root cannot be remapped with itself; user namespaces are OFF" )
919+ logrus .Warn ("User namespaces: root cannot be remapped with itself; user namespaces are OFF" )
920920 return uidMaps , gidMaps , nil
921921 }
922922 logrus .Infof ("User namespaces: ID ranges will be mapped to subuid/subgid ranges of: %s:%s" , username , groupname )
0 commit comments