Merge pull request #71166 from Random-Liu/fix-kubelet-panic

Fix kubelet panic.
This commit is contained in:
k8s-ci-robot 2018-11-16 20:27:53 -08:00 committed by GitHub
commit df8ad8eae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,