@@ -317,71 +317,6 @@ var _ = Describe("ALL Operator tests", func() {
317317					return  true 
318318				}, 5 * time .Minute , 2 * time .Second ).Should (BeTrue ())
319319			})
320- 
321- 			It ("should deploy components that tolerate CriticalAddonsOnly taint" , func () {
322- 				cr  :=  getCDI (f )
323- 				criticalAddonsToleration  :=  corev1.Toleration {
324- 					Key :      "CriticalAddonsOnly" ,
325- 					Operator : corev1 .TolerationOpExists ,
326- 				}
327- 
328- 				if  ! tolerationExists (cr .Spec .Infra .NodePlacement .Tolerations , criticalAddonsToleration ) {
329- 					Skip ("Unexpected CDI CR (not from cdi-cr.yaml), doesn't tolerate CriticalAddonsOnly" )
330- 				}
331- 
332- 				labelSelector  :=  metav1.LabelSelector {MatchLabels : map [string ]string {"cdi.kubevirt.io/testing" : "" }}
333- 				cdiTestPods , err  :=  f .K8sClient .CoreV1 ().Pods (f .CdiInstallNs ).List (context .TODO (), metav1.ListOptions {
334- 					LabelSelector : labels .Set (labelSelector .MatchLabels ).String (),
335- 				})
336- 				Expect (err ).ToNot (HaveOccurred (), "failed listing cdi testing pods" )
337- 				Expect (cdiTestPods .Items ).ToNot (BeEmpty (), "no cdi testing pods found" )
338- 
339- 				By ("adding taints to all nodes" )
340- 				criticalPodTaint  :=  corev1.Taint {
341- 					Key :    "CriticalAddonsOnly" ,
342- 					Value :  "" ,
343- 					Effect : corev1 .TaintEffectNoExecute ,
344- 				}
345- 
346- 				for  _ , node  :=  range  nodes .Items  {
347- 					Eventually (func () bool  {
348- 						nodeCopy , err  :=  f .K8sClient .CoreV1 ().Nodes ().Get (context .TODO (), node .Name , metav1.GetOptions {})
349- 						Expect (err ).ToNot (HaveOccurred ())
350- 
351- 						if  nodeHasTaint (* nodeCopy , criticalPodTaint ) {
352- 							return  true 
353- 						}
354- 
355- 						nodeCopy .Spec .Taints  =  append (nodeCopy .Spec .Taints , criticalPodTaint )
356- 						_ , _  =  f .K8sClient .CoreV1 ().Nodes ().Update (context .TODO (), nodeCopy , metav1.UpdateOptions {})
357- 						return  false 
358- 					}, 5 * time .Minute , 2 * time .Second ).Should (BeTrue ())
359- 				}
360- 
361- 				By ("Waiting for all CDI testing pods to terminate" )
362- 				Eventually (func () bool  {
363- 					for  _ , cdiTestPod  :=  range  cdiTestPods .Items  {
364- 						By (fmt .Sprintf ("CDI test pod: %s" , cdiTestPod .Name ))
365- 						_ , err  :=  f .K8sClient .CoreV1 ().Pods (cdiTestPod .Namespace ).Get (context .TODO (), cdiTestPod .Name , metav1.GetOptions {})
366- 						if  ! errors .IsNotFound (err ) {
367- 							return  false 
368- 						}
369- 					}
370- 					return  true 
371- 				}, 5 * time .Minute , 2 * time .Second ).Should (BeTrue ())
372- 
373- 				By ("Checking that all the non-testing pods are running" )
374- 				for  _ , cdiPod  :=  range  cdiPods .Items  {
375- 					if  _ , isTestingComponent  :=  cdiPod .Labels ["cdi.kubevirt.io/testing" ]; isTestingComponent  {
376- 						continue 
377- 					}
378- 					By (fmt .Sprintf ("Non-test CDI pod: %s" , cdiPod .Name ))
379- 					podUpdated , err  :=  f .K8sClient .CoreV1 ().Pods (cdiPod .Namespace ).Get (context .TODO (), cdiPod .Name , metav1.GetOptions {})
380- 					Expect (err ).ToNot (HaveOccurred (), "failed setting taint on node" )
381- 					Expect (podUpdated .Status .Phase ).To (Equal (corev1 .PodRunning ))
382- 				}
383- 			})
384- 
385320		})
386321
387322		var  _  =  Describe ("Operator delete CDI CR tests" , func () {
@@ -1356,24 +1291,6 @@ func waitCDI(f *framework.Framework, cr *cdiv1.CDI, cdiPods *corev1.PodList) {
13561291	}
13571292}
13581293
1359- func  tolerationExists (tolerations  []corev1.Toleration , testValue  corev1.Toleration ) bool  {
1360- 	for  _ , toleration  :=  range  tolerations  {
1361- 		if  reflect .DeepEqual (toleration , testValue ) {
1362- 			return  true 
1363- 		}
1364- 	}
1365- 	return  false 
1366- }
1367- 
1368- func  nodeHasTaint (node  corev1.Node , testedTaint  corev1.Taint ) bool  {
1369- 	for  _ , taint  :=  range  node .Spec .Taints  {
1370- 		if  reflect .DeepEqual (taint , testedTaint ) {
1371- 			return  true 
1372- 		}
1373- 	}
1374- 	return  false 
1375- }
1376- 
13771294func  infraDeploymentAvailable (f  * framework.Framework , cr  * cdiv1.CDI ) bool  {
13781295	cdi , _  :=  f .CdiClient .CdiV1beta1 ().CDIs ().Get (context .TODO (), cr .Name , metav1.GetOptions {})
13791296	if  ! conditions .IsStatusConditionTrue (cdi .Status .Conditions , conditions .ConditionAvailable ) {
0 commit comments