Merge pull request #114740 from kushagra98/master

Misleading message when there are no metrics.
This commit is contained in:
Kubernetes Prow Robot 2022-12-29 11:09:28 -08:00 committed by GitHub
commit 00aae4c10c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ func (c *ReplicaCalculator) GetResourceReplicas(ctx context.Context, currentRepl
removeMetricsForPods(metrics, ignoredPods)
removeMetricsForPods(metrics, unreadyPods)
if len(metrics) == 0 {
return 0, 0, 0, time.Time{}, fmt.Errorf("did not receive metrics for any ready pods")
return 0, 0, 0, time.Time{}, fmt.Errorf("did not receive metrics for targeted pods (pods might be unready)")
}
requests, err := calculatePodRequests(podList, container, resource)
@ -191,7 +191,7 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet
removeMetricsForPods(metrics, unreadyPods)
if len(metrics) == 0 {
return 0, 0, fmt.Errorf("did not receive metrics for any ready pods")
return 0, 0, fmt.Errorf("did not receive metrics for targeted pods (pods might be unready)")
}
usageRatio, usage := metricsclient.GetMetricUsageRatio(metrics, targetUsage)