@@ -15,7 +15,7 @@ import (
1515 "k8s.io/utils/set"
1616 k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
1717
18- api "github.com/SlinkyProject/slurm-client/api/v0043 "
18+ slurmapi "github.com/SlinkyProject/slurm-client/api/v0044 "
1919 slurmclient "github.com/SlinkyProject/slurm-client/pkg/client"
2020 "github.com/SlinkyProject/slurm-client/pkg/client/fake"
2121 "github.com/SlinkyProject/slurm-client/pkg/client/interceptor"
@@ -30,19 +30,19 @@ import (
3030func newFakeClientList (interceptorFuncs interceptor.Funcs , initObjLists ... object.ObjectList ) slurmclient.Client {
3131 updateFn := func (_ context.Context , obj object.Object , req any , opts ... slurmclient.UpdateOption ) error {
3232 switch o := obj .(type ) {
33- case * slurmtypes.V0043Node :
34- r , ok := req .(api. V0043UpdateNodeMsg )
33+ case * slurmtypes.V0044Node :
34+ r , ok := req .(slurmapi. V0044UpdateNodeMsg )
3535 if ! ok {
3636 return errors .New ("failed to cast request object" )
3737 }
38- stateSet := set .New (ptr .Deref (o .State , []api. V0043NodeState {})... )
39- statesReq := ptr .Deref (r .State , []api. V0043UpdateNodeMsgState {})
38+ stateSet := set .New (ptr .Deref (o .State , []slurmapi. V0044NodeState {})... )
39+ statesReq := ptr .Deref (r .State , []slurmapi. V0044UpdateNodeMsgState {})
4040 for _ , stateReq := range statesReq {
4141 switch stateReq {
42- case api . V0043UpdateNodeMsgStateUNDRAIN :
43- stateSet .Delete (api . V0043NodeStateDRAIN )
42+ case slurmapi . V0044UpdateNodeMsgStateUNDRAIN :
43+ stateSet .Delete (slurmapi . V0044NodeStateDRAIN )
4444 default :
45- stateSet .Insert (api . V0043NodeState (stateReq ))
45+ stateSet .Insert (slurmapi . V0044NodeState (stateReq ))
4646 }
4747 }
4848 o .State = ptr .To (stateSet .UnsortedList ())
@@ -95,7 +95,7 @@ var _ = Describe("Slurm NodeSet", func() {
9595 nodesetKey := k8sclient .ObjectKeyFromObject (nodeset )
9696 Eventually (func (g Gomega ) {
9797 g .Expect (k8sClient .Get (ctx , nodesetKey , createdNodeset )).To (Succeed ())
98- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
98+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
9999
100100 By ("Waiting for N replicas" )
101101 podList := & corev1.PodList {}
@@ -106,7 +106,7 @@ var _ = Describe("Slurm NodeSet", func() {
106106 Eventually (func (g Gomega ) {
107107 g .Expect (k8sClient .List (ctx , podList , optsList )).To (Succeed ())
108108 g .Expect (len (podList .Items )).Should (Equal (replicas ))
109- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
109+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
110110
111111 }, SpecTimeout (testutils .Timeout ))
112112 })
@@ -151,7 +151,7 @@ var _ = Describe("Slurm NodeSet", func() {
151151 Eventually (func (g Gomega ) {
152152 g .Expect (k8sClient .List (ctx , podList , optsList )).To (Succeed ())
153153 g .Expect (len (podList .Items )).Should (Equal (replicas ))
154- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
154+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
155155
156156 clientMap .Add (controllerKey , newFakeClientList (interceptor.Funcs {}))
157157
@@ -162,13 +162,13 @@ var _ = Describe("Slurm NodeSet", func() {
162162 g .Expect (k8sClient .Update (ctx , nodeset )).To (Succeed ())
163163 replicas := int (ptr .Deref (nodeset .Spec .Replicas , 0 ))
164164 g .Expect (replicas ).Should (Equal (0 ))
165- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
165+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
166166
167167 By ("Verifying pods were deleted" )
168168 Eventually (func (g Gomega ) {
169169 g .Expect (k8sClient .List (ctx , podList , optsList )).To (Succeed ())
170170 g .Expect (len (podList .Items )).Should (Equal (0 ))
171- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
171+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
172172 }, SpecTimeout (testutils .Timeout ))
173173 })
174174
@@ -212,22 +212,22 @@ var _ = Describe("Slurm NodeSet", func() {
212212 Eventually (func (g Gomega ) {
213213 g .Expect (k8sClient .List (ctx , podList , optsList )).To (Succeed ())
214214 g .Expect (len (podList .Items )).Should (Equal (replicas ))
215- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
215+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
216216
217217 By ("Simulating Slurm functionality" )
218- slurmNodes := make ([]slurmtypes.V0043Node , 0 )
218+ slurmNodes := make ([]slurmtypes.V0044Node , 0 )
219219 for _ , pod := range podList .Items {
220220 // Register Slurm node for pod
221- node := slurmtypes.V0043Node {
222- V0043Node : api. V0043Node {
221+ node := slurmtypes.V0044Node {
222+ V0044Node : slurmapi. V0044Node {
223223 Name : ptr .To (nodesetutils .GetNodeName (& pod )),
224- State : ptr .To ([]api. V0043NodeState { api . V0043NodeStateIDLE }),
224+ State : ptr .To ([]slurmapi. V0044NodeState { slurmapi . V0044NodeStateIDLE }),
225225 },
226226 }
227227 slurmNodes = append (slurmNodes , node )
228228 }
229229 clientMap .Add (controllerKey ,
230- newFakeClientList (interceptor.Funcs {}, & slurmtypes.V0043NodeList {
230+ newFakeClientList (interceptor.Funcs {}, & slurmtypes.V0044NodeList {
231231 Items : slurmNodes ,
232232 }),
233233 )
@@ -251,23 +251,23 @@ var _ = Describe("Slurm NodeSet", func() {
251251 g .Expect (k8sClient .Update (ctx , nodeset )).To (Succeed ())
252252 replicas := int (ptr .Deref (nodeset .Spec .Replicas , 0 ))
253253 g .Expect (replicas ).Should (Equal (0 ))
254- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
254+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
255255
256256 By ("Verifying Slurm nodes were drained first" )
257257 slurmClient := clientMap .Get (controllerKey )
258258 Eventually (func (g Gomega ) {
259- slurmNodes := & slurmtypes.V0043NodeList {}
259+ slurmNodes := & slurmtypes.V0044NodeList {}
260260 g .Expect (slurmClient .List (ctx , slurmNodes )).To (Succeed ())
261261 for _ , node := range slurmNodes .Items {
262- g .Expect (node .GetStateAsSet ().Has (api . V0043NodeStateDRAIN )).Should (BeTrue ())
262+ g .Expect (node .GetStateAsSet ().Has (slurmapi . V0044NodeStateDRAIN )).Should (BeTrue ())
263263 }
264- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
264+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
265265
266266 By ("Verifying pods were deleted" )
267267 Eventually (func (g Gomega ) {
268268 g .Expect (k8sClient .List (ctx , podList , optsList )).To (Succeed ())
269269 g .Expect (len (podList .Items )).Should (Equal (0 ))
270- }, testutils .Timeout , testutils .Internal ).Should (Succeed ())
270+ }, testutils .Timeout , testutils .Interval ).Should (Succeed ())
271271
272272 By ("Simulating Slurm nodes being unregistered" )
273273 clientMap .Add (controllerKey , newFakeClientList (interceptor.Funcs {}))
0 commit comments