@@ -745,35 +745,17 @@ func verifyResult(c clientset.Interface, expectedScheduled int, expectedNotSched
745
745
framework .ExpectNoError (err )
746
746
scheduledPods , notScheduledPods := e2epod .GetPodsScheduled (masterNodes , allPods )
747
747
748
- printed := false
749
- printOnce := func (msg string ) string {
750
- if ! printed {
751
- printed = true
752
- return msg
753
- }
754
- return ""
755
- }
756
-
757
- framework .ExpectEqual (len (notScheduledPods ), expectedNotScheduled , printOnce (fmt .Sprintf ("Not scheduled Pods: %#v" , notScheduledPods )))
758
- framework .ExpectEqual (len (scheduledPods ), expectedScheduled , printOnce (fmt .Sprintf ("Scheduled Pods: %#v" , scheduledPods )))
748
+ framework .ExpectEqual (len (notScheduledPods ), expectedNotScheduled , fmt .Sprintf ("Not scheduled Pods: %#v" , notScheduledPods ))
749
+ framework .ExpectEqual (len (scheduledPods ), expectedScheduled , fmt .Sprintf ("Scheduled Pods: %#v" , scheduledPods ))
759
750
}
760
751
761
752
// verifyReplicasResult is wrapper of verifyResult for a group pods with same "name: labelName" label, which means they belong to same RC
762
753
func verifyReplicasResult (c clientset.Interface , expectedScheduled int , expectedNotScheduled int , ns string , labelName string ) {
763
754
allPods := getPodsByLabels (c , ns , map [string ]string {"name" : labelName })
764
755
scheduledPods , notScheduledPods := e2epod .GetPodsScheduled (masterNodes , allPods )
765
756
766
- printed := false
767
- printOnce := func (msg string ) string {
768
- if ! printed {
769
- printed = true
770
- return msg
771
- }
772
- return ""
773
- }
774
-
775
- framework .ExpectEqual (len (notScheduledPods ), expectedNotScheduled , printOnce (fmt .Sprintf ("Not scheduled Pods: %#v" , notScheduledPods )))
776
- framework .ExpectEqual (len (scheduledPods ), expectedScheduled , printOnce (fmt .Sprintf ("Scheduled Pods: %#v" , scheduledPods )))
757
+ framework .ExpectEqual (len (notScheduledPods ), expectedNotScheduled , fmt .Sprintf ("Not scheduled Pods: %#v" , notScheduledPods ))
758
+ framework .ExpectEqual (len (scheduledPods ), expectedScheduled , fmt .Sprintf ("Scheduled Pods: %#v" , scheduledPods ))
777
759
}
778
760
779
761
func getPodsByLabels (c clientset.Interface , ns string , labelsMap map [string ]string ) * v1.PodList {
0 commit comments