if statement must be true

This commit is contained in:
foxyriver 2016-12-17 11:52:41 +08:00
parent 9ba4a0effc
commit 69c76d8398

View File

@ -122,10 +122,7 @@ func (h *HeapsterMetricsClient) GetResourceMetric(resource v1.ResourceName, name
} }
} }
timestamp := time.Time{} timestamp := metrics.Items[0].Timestamp.Time
if len(metrics.Items) > 0 {
timestamp = metrics.Items[0].Timestamp.Time
}
return res, timestamp, nil return res, timestamp, nil
} }