1
0
mirror of https://github.com/kubernetes/kubernetes.git synced 2025-02-06 11:01:14 +00:00

Merge 39c90ec1c47363a12ae692e60970839aebf76ae3 into 9a03243789677637762eb0f907e1b4e45a0136c1

This commit is contained in:
jm-franc 2025-02-05 21:30:08 -08:00 committed by GitHub
commit 268029f9d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -380,7 +380,8 @@ func groupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1
unreadyPods = sets.New[string]()
ignoredPods = sets.New[string]()
for _, pod := range pods {
if pod.DeletionTimestamp != nil || pod.Status.Phase == v1.PodFailed {
podTerminated := pod.Status.Phase == v1.PodFailed || pod.Status.Phase == v1.PodSucceeded
if pod.DeletionTimestamp != nil || podTerminated {
ignoredPods.Insert(pod.Name)
continue
}

View File

@ -573,12 +573,12 @@ func TestReplicaCalcScaleHotCpuNoScale(t *testing.T) {
tc.runTest(t)
}
func TestReplicaCalcScaleUpIgnoresFailedPods(t *testing.T) {
func TestReplicaCalcScaleUpIgnoresTerminatedPods(t *testing.T) {
tc := replicaCalcTestCase{
currentReplicas: 2,
expectedReplicas: 4,
podReadiness: []v1.ConditionStatus{v1.ConditionTrue, v1.ConditionTrue, v1.ConditionFalse, v1.ConditionFalse},
podPhase: []v1.PodPhase{v1.PodRunning, v1.PodRunning, v1.PodFailed, v1.PodFailed},
podPhase: []v1.PodPhase{v1.PodRunning, v1.PodRunning, v1.PodFailed, v1.PodSucceeded},
resource: &resourceInfo{
name: v1.ResourceCPU,
requests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")},