@@ -42,29 +42,25 @@ var _ = Describe("bufferKeyOf", func() {
4242 Expect (bufferKeyOf (pod )).To (Equal ("" ))
4343 })
4444
45- It ("should return empty string when namespace label is missing" , func () {
45+ It ("should return empty string when namespace annotation is missing" , func () {
4646 pod := & corev1.Pod {ObjectMeta : metav1.ObjectMeta {
4747 Name : "virt" ,
4848 Namespace : "default" ,
4949 Annotations : map [string ]string {
5050 autoscalingv1beta1 .FakePodAnnotationKey : autoscalingv1beta1 .FakePodAnnotationValue ,
51- },
52- Labels : map [string ]string {
53- autoscalingv1beta1 .BufferNameLabel : "my-buffer" ,
51+ autoscalingv1beta1 .BufferNameAnnotation : "my-buffer" ,
5452 },
5553 }}
5654 Expect (bufferKeyOf (pod )).To (Equal ("" ))
5755 })
5856
59- It ("should return empty string when name label is missing" , func () {
57+ It ("should return empty string when name annotation is missing" , func () {
6058 pod := & corev1.Pod {ObjectMeta : metav1.ObjectMeta {
6159 Name : "virt" ,
6260 Namespace : "default" ,
6361 Annotations : map [string ]string {
64- autoscalingv1beta1 .FakePodAnnotationKey : autoscalingv1beta1 .FakePodAnnotationValue ,
65- },
66- Labels : map [string ]string {
67- autoscalingv1beta1 .BufferNamespaceLabel : "default" ,
62+ autoscalingv1beta1 .FakePodAnnotationKey : autoscalingv1beta1 .FakePodAnnotationValue ,
63+ autoscalingv1beta1 .BufferNamespaceAnnotation : "default" ,
6864 },
6965 }}
7066 Expect (bufferKeyOf (pod )).To (Equal ("" ))
@@ -75,11 +71,9 @@ var _ = Describe("bufferKeyOf", func() {
7571 Name : "virt" ,
7672 Namespace : "default" ,
7773 Annotations : map [string ]string {
78- autoscalingv1beta1 .FakePodAnnotationKey : autoscalingv1beta1 .FakePodAnnotationValue ,
79- },
80- Labels : map [string ]string {
81- autoscalingv1beta1 .BufferNameLabel : "my-buffer" ,
82- autoscalingv1beta1 .BufferNamespaceLabel : "default" ,
74+ autoscalingv1beta1 .FakePodAnnotationKey : autoscalingv1beta1 .FakePodAnnotationValue ,
75+ autoscalingv1beta1 .BufferNameAnnotation : "my-buffer" ,
76+ autoscalingv1beta1 .BufferNamespaceAnnotation : "default" ,
8377 },
8478 }}
8579 Expect (bufferKeyOf (pod )).To (Equal ("default/my-buffer" ))
@@ -116,7 +110,7 @@ var _ = Describe("classifyBufferPods", func() {
116110 cbA := test .ReadyBuffer ("a" , 3 )
117111 cbB := test .ReadyBuffer ("b" , 2 )
118112 buffers := map [string ]* autoscalingv1beta1.CapacityBuffer {"default/a" : cbA , "default/b" : cbB }
119- spec := corev1.PodSpec {}
113+ spec := corev1.PodTemplateSpec {}
120114
121115 aPods := virtualpods .BuildVirtualPods (cbA , spec )
122116 bPods := virtualpods .BuildVirtualPods (cbB , spec )
@@ -151,7 +145,7 @@ var _ = Describe("classifyBufferPods", func() {
151145 "ns-a/buffer" : cbA ,
152146 "ns-b/buffer" : cbB ,
153147 }
154- spec := corev1.PodSpec {}
148+ spec := corev1.PodTemplateSpec {}
155149
156150 aPods := virtualpods .BuildVirtualPods (cbA , spec )
157151 bPods := virtualpods .BuildVirtualPods (cbB , spec )
@@ -217,7 +211,7 @@ var _ = Describe("bufferPodCountsFromResults", func() {
217211 It ("should count virtual pods per providerID on existing nodes" , func () {
218212 cbA := test .ReadyBuffer ("a" , 3 )
219213 cbB := test .ReadyBuffer ("b" , 2 )
220- spec := corev1.PodSpec {}
214+ spec := corev1.PodTemplateSpec {}
221215
222216 aPods := virtualpods .BuildVirtualPods (cbA , spec )
223217 bPods := virtualpods .BuildVirtualPods (cbB , spec )
@@ -279,7 +273,7 @@ var _ = Describe("computeProvisioningCondition with scalableRef buffer", func()
279273var _ = Describe ("filterVirtualPodErrors" , func () {
280274 It ("should remove virtual pods from error map" , func () {
281275 cb := test .ReadyBuffer ("web" , 2 )
282- virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodSpec {})
276+ virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodTemplateSpec {})
283277 realPod := & corev1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "real" , Namespace : "default" }}
284278
285279 input := map [* corev1.Pod ]error {
@@ -295,7 +289,7 @@ var _ = Describe("filterVirtualPodErrors", func() {
295289
296290 It ("should return empty map when all pods are virtual" , func () {
297291 cb := test .ReadyBuffer ("web" , 2 )
298- virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodSpec {})
292+ virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodTemplateSpec {})
299293
300294 input := map [* corev1.Pod ]error {
301295 virtualPods [0 ]: fmt .Errorf ("err" ),
@@ -328,7 +322,7 @@ var _ = Describe("filterVirtualPodErrors", func() {
328322var _ = Describe ("filterVirtualPodMapping" , func () {
329323 It ("should remove virtual pods from pod slices" , func () {
330324 cb := test .ReadyBuffer ("web" , 2 )
331- virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodSpec {})
325+ virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodTemplateSpec {})
332326 realPod := & corev1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "real" , Namespace : "default" }}
333327
334328 input := map [string ][]* corev1.Pod {
@@ -343,7 +337,7 @@ var _ = Describe("filterVirtualPodMapping", func() {
343337
344338 It ("should drop keys entirely when only virtual pods remain" , func () {
345339 cb := test .ReadyBuffer ("web" , 2 )
346- virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodSpec {})
340+ virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodTemplateSpec {})
347341 realPod := & corev1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "real" , Namespace : "default" }}
348342
349343 input := map [string ][]* corev1.Pod {
@@ -359,7 +353,7 @@ var _ = Describe("filterVirtualPodMapping", func() {
359353
360354 It ("should return empty map when all pods are virtual" , func () {
361355 cb := test .ReadyBuffer ("web" , 2 )
362- virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodSpec {})
356+ virtualPods := virtualpods .BuildVirtualPods (cb , corev1.PodTemplateSpec {})
363357
364358 input := map [string ][]* corev1.Pod {
365359 "nodepool-a" : {virtualPods [0 ], virtualPods [1 ]},
0 commit comments