1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

Use Structured Logging For Unknown Strategy Log Message

Always use structured logging. Therefore update klog.Errorf() to instead
use klog.ErrorS().

Here is an example of the new log message.

E0428 23:58:57.048912 586 descheduler.go:145] "skipping strategy" err="unknown strategy name" strategy=ASDFPodLifeTime
This commit is contained in:
Sean Malloy
2021-04-29 00:00:07 -05:00
parent 724ff8a188
commit 6bde95c9a1

View File

@@ -142,7 +142,7 @@ func RunDeschedulerStrategies(ctx context.Context, rs *options.DeschedulerServer
f(ctx, rs.Client, strategy, nodes, podEvictor)
}
} else {
klog.Errorf("Unknown strategy name '%s', skipping", name)
klog.ErrorS(fmt.Errorf("unknown strategy name"), "skipping strategy", "strategy", name)
}
}