mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
libnetwork/osl/kernel: ApplyOSTweaks: don't log errors if not found
I noticed these errors logged inside the dev-container;
ERRO[2025-10-14T16:15:46.603781797Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh1 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh1: no such file or directory"
ERRO[2025-10-14T16:15:46.603808089Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh2 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh2: no such file or directory"
ERRO[2025-10-14T16:15:46.603819922Z] error reading the kernel parameter net.ipv4.neigh.default.gc_thresh3 error="open /proc/sys/net/ipv4/neigh/default/gc_thresh3: no such file or directory"
Given that these happen during an initial check, we can probably ignore them
if there's nothing to tweak.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -32,14 +32,16 @@ func ApplyOSTweaks(osConfig map[string]*OSValue) {
|
||||
// read the existing property from disk
|
||||
oldv, err := readSystemProperty(k)
|
||||
if err != nil {
|
||||
log.G(context.TODO()).WithError(err).Errorf("error reading the kernel parameter %s", k)
|
||||
if !os.IsNotExist(err) {
|
||||
log.G(context.TODO()).WithError(err).Errorf("error reading the kernel parameter %s", k)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if propertyIsValid(oldv, v.Value, v.CheckFn) {
|
||||
// write new prop value to disk
|
||||
if err := writeSystemProperty(k, v.Value); err != nil {
|
||||
log.G(context.TODO()).WithError(err).Errorf("error setting the kernel parameter %s = %s, (leaving as %s)", k, v.Value, oldv)
|
||||
log.G(context.TODO()).WithError(err).Warnf("error setting the kernel parameter %s = %s, (leaving as %s)", k, v.Value, oldv)
|
||||
continue
|
||||
}
|
||||
log.G(context.TODO()).Debugf("updated kernel parameter %s = %s (was %s)", k, v.Value, oldv)
|
||||
|
||||
Reference in New Issue
Block a user