Fix kubelet panic.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2018-11-16 16:21:57 -08:00
parent 859ab7450d
commit 59e80cdac3

View File

@ -62,7 +62,7 @@ func (c *logMetricsCollector) Collect(ch chan<- prometheus.Metric) {
for _, ps := range podStats {
for _, c := range ps.Containers {
if c.Logs.UsedBytes != nil {
if c.Logs != nil && c.Logs.UsedBytes != nil {
ch <- prometheus.MustNewConstMetric(
descLogSize,
prometheus.GaugeValue,