@@ -40,6 +40,7 @@ import (
40
40
"k8s.io/autoscaler/cluster-autoscaler/core/utils"
41
41
"k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot"
42
42
"k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot/testsnapshot"
43
+ simulator_fake "k8s.io/autoscaler/cluster-autoscaler/simulator/fake"
43
44
"k8s.io/autoscaler/cluster-autoscaler/simulator/framework"
44
45
"k8s.io/autoscaler/cluster-autoscaler/utils/daemonset"
45
46
kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes"
@@ -683,6 +684,11 @@ func TestPodsToEvict(t *testing.T) {
683
684
wantDsPods : []* apiv1.Pod {},
684
685
wantNonDsPods : []* apiv1.Pod {},
685
686
},
687
+ "fake pods are never returned" : {
688
+ pods : []* apiv1.Pod {fakePod ("pod-1" ), fakePod ("pod-2" )},
689
+ wantDsPods : []* apiv1.Pod {},
690
+ wantNonDsPods : []* apiv1.Pod {},
691
+ },
686
692
"non-DS pods are correctly returned" : {
687
693
pods : []* apiv1.Pod {regularPod ("pod-1" ), regularPod ("pod-2" )},
688
694
wantDsPods : []* apiv1.Pod {},
@@ -766,6 +772,10 @@ func mirrorPod(name string) *apiv1.Pod {
766
772
}
767
773
}
768
774
775
+ func fakePod (name string ) * apiv1.Pod {
776
+ return simulator_fake .WithFakePodAnnotation (regularPod (name ))
777
+ }
778
+
769
779
func dsPod (name string , evictable bool ) * apiv1.Pod {
770
780
pod := & apiv1.Pod {
771
781
ObjectMeta : metav1.ObjectMeta {
0 commit comments