@@ -590,6 +590,39 @@ var _ = Describe("Daemon Controller", Ordered, func() {
590590 }, waitTime , retryTime ).Should (Succeed ())
591591 })
592592
593+ It ("Should not wait for device plugin pod when there are no interfaces and blockDevicePluginUntilConfigured is enabled" , func (ctx context.Context ) {
594+ DeferCleanup (func (x bool ) { vars .DisableDrain = x }, vars .DisableDrain )
595+ vars .DisableDrain = true
596+
597+ By ("waiting for drain idle states" )
598+ EventuallyWithOffset (1 , func (g Gomega ) {
599+ g .Expect (k8sClient .Get (context .Background (), types.NamespacedName {Namespace : nodeState .Namespace , Name : nodeState .Name }, nodeState )).
600+ ToNot (HaveOccurred ())
601+
602+ g .Expect (nodeState .Annotations [constants .NodeStateDrainAnnotation ]).To (Equal (constants .DrainIdle ))
603+ g .Expect (nodeState .Annotations [constants .NodeStateDrainAnnotationCurrent ]).To (Equal (constants .DrainIdle ))
604+ }, waitTime , retryTime ).Should (Succeed ())
605+
606+ By ("setting an empty interfaces spec (no policies)" )
607+ EventuallyWithOffset (1 , func (g Gomega ) {
608+ err := k8sClient .Get (ctx , types.NamespacedName {Namespace : nodeState .Namespace , Name : nodeState .Name }, nodeState )
609+ g .Expect (err ).ToNot (HaveOccurred ())
610+
611+ nodeState .Spec .Interfaces = []sriovnetworkv1.Interface {}
612+ err = k8sClient .Update (ctx , nodeState )
613+ g .Expect (err ).ToNot (HaveOccurred ())
614+ }, waitTime , retryTime ).Should (Succeed ())
615+
616+ By ("verifying sync status reaches Succeeded without stalling on device plugin wait" )
617+ eventuallySyncStatusEqual (nodeState , constants .SyncStatusSucceeded )
618+
619+ By ("verifying the device plugin pod still has the wait-for-config annotation (was not unblocked)" )
620+ devicePluginPod := & corev1.Pod {}
621+ Expect (k8sClient .Get (ctx , types.NamespacedName {Name : devicePluginPodName , Namespace : testNamespace },
622+ devicePluginPod )).ToNot (HaveOccurred ())
623+ Expect (devicePluginPod .Annotations ).To (HaveKey (constants .DevicePluginWaitConfigAnnotation ))
624+ })
625+
593626 It ("Should unblock the device plugin pod when configuration is finished" , func (ctx context.Context ) {
594627 DeferCleanup (func (x bool ) { vars .DisableDrain = x }, vars .DisableDrain )
595628 vars .DisableDrain = true
0 commit comments