Skip to content

Commit

Permalink
use updatedReadyReplica rather than readyreplica and ignore deleteing…
Browse files Browse the repository at this point in the history
… pod

Signed-off-by: Abner-1 <[email protected]>
  • Loading branch information
ABNER-1 committed Apr 8, 2024
1 parent 7951b1c commit aedf80d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/apps/cloneset.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,10 @@ func changeCloneSetAndWaitReady(tester *framework.CloneSetTester, cs *appsv1alph
gomega.Eventually(func() int32 {
cs, err = tester.GetCloneSet(cs.Name)
gomega.Expect(err).NotTo(gomega.HaveOccurred())
return cs.Status.ReadyReplicas
if cs.Status.ObservedGeneration != cs.Generation {
return -1
}
return cs.Status.UpdatedReadyReplicas
}, 120*time.Second, 3*time.Second).Should(gomega.Equal(*cs.Spec.Replicas))

pods, err := tester.ListPodsForCloneSet(cs.Name)
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/framework/cloneset_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func (t *CloneSetTester) ListPodsForCloneSet(name string) (pods []*v1.Pod, err e
}
for i := range podList.Items {
pod := &podList.Items[i]
// ignore deleting pod
if pod.DeletionTimestamp != nil {
continue
}
if owner := metav1.GetControllerOf(pod); owner != nil && owner.Name == name {
pods = append(pods, pod)
}
Expand Down

0 comments on commit aedf80d

Please sign in to comment.