@@ -610,83 +610,6 @@ var _ = Describe("BPF Proxy", func() {
610
610
})
611
611
})
612
612
})
613
-
614
- Context ("with terminating workloads" , func () {
615
- var (
616
- p proxy.Proxy
617
- dp * mockSyncer
618
- k8s * fake.Clientset
619
- )
620
-
621
- BeforeEach (func () {
622
- By ("creating proxy with fake client and mock syncer" , func () {
623
- var err error
624
-
625
- k8s = fake .NewSimpleClientset (testSvc , testSvcEpsSlice )
626
- syncStop = make (chan struct {})
627
- dp = newMockSyncer (syncStop )
628
-
629
- opts := []proxy.Option {proxy .WithImmediateSync ()}
630
-
631
- p , err = proxy .New (k8s , dp , "test-node" , opts ... )
632
- Expect (err ).NotTo (HaveOccurred ())
633
- })
634
- })
635
-
636
- AfterEach (func () {
637
- By ("stopping the proxy" , func () {
638
- close (syncStop )
639
- p .Stop ()
640
- })
641
- })
642
-
643
- It ("should see IsReady=false and IsTerminating=true" , func () {
644
- By ("getting the initial sync" )
645
-
646
- dp .checkState (func (s proxy.DPSyncerState ) {
647
- Expect (len (s .SvcMap )).To (Equal (1 ))
648
- Expect (len (s .EpsMap )).To (Equal (1 ))
649
-
650
- })
651
-
652
- By ("placing one endpoint to terminating state" )
653
-
654
- falsePtr := new (bool )
655
- * falsePtr = false
656
-
657
- truePtr := new (bool )
658
- * truePtr = true
659
-
660
- testSvcEpsSlice .Endpoints [0 ].Conditions .Ready = falsePtr
661
- testSvcEpsSlice .Endpoints [0 ].Conditions .Terminating = truePtr
662
- err := k8s .Tracker ().Update (discovery .SchemeGroupVersion .WithResource ("endpointslices" ),
663
- testSvcEpsSlice , "default" )
664
- Expect (err ).NotTo (HaveOccurred ())
665
-
666
- dp .checkState (func (s proxy.DPSyncerState ) {
667
- Expect (len (s .SvcMap )).To (Equal (1 ))
668
- Expect (len (s .EpsMap )).To (Equal (1 ))
669
-
670
- var key k8sp.ServicePortName
671
-
672
- for key = range s .EpsMap {
673
- }
674
-
675
- isReady := 0
676
- isTerminating := 0
677
- for _ , ep := range s .EpsMap [key ] {
678
- if ep .IsReady () {
679
- isReady ++
680
- }
681
- if ep .IsTerminating () {
682
- isTerminating ++
683
- }
684
- }
685
- Expect (isReady ).To (Equal (1 ))
686
- Expect (isTerminating ).To (Equal (1 ))
687
- })
688
- })
689
- })
690
613
})
691
614
692
615
type mockSyncer struct {
0 commit comments