mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 12:11:43 +00:00
Merge pull request #38917 from foxyriver/if-statement-must-be-true
Automatic merge from submit-queue (batch tested with PRs 38426, 38917, 38891, 38935) if statement must be true **What this PR does / why we need it**: if len(metrics.Items)==0, the function would been returned. so the statement if len(metrics.Items) > 0 is redudant, it must be true. **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
@@ -122,10 +122,7 @@ func (h *HeapsterMetricsClient) GetResourceMetric(resource v1.ResourceName, name
|
||||
}
|
||||
}
|
||||
|
||||
timestamp := time.Time{}
|
||||
if len(metrics.Items) > 0 {
|
||||
timestamp = metrics.Items[0].Timestamp.Time
|
||||
}
|
||||
timestamp := metrics.Items[0].Timestamp.Time
|
||||
|
||||
return res, timestamp, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user