@@ -327,72 +327,4 @@ var _ = framework.Describe("[group:ipam]", func() {
327
327
err = cs .AppsV1 ().StatefulSets (namespaceName ).Delete (context .TODO (), name , metav1.DeleteOptions {})
328
328
framework .ExpectNoError (err , "failed to delete statefulset " + name )
329
329
})
330
-
331
- // separate ippool annotation by comma
332
- framework .ConformanceIt ("should allocate static ip for statefulset with ippool separated by comma" , func () {
333
- if f .ClusterIpFamily == "dual" {
334
- ginkgo .Skip ("Comma separated ippool is not supported for dual stack" )
335
- }
336
-
337
- ippoolSep := ","
338
- replicas := 3
339
- ippool := framework .RandomIPPool (cidr , ippoolSep , replicas )
340
- labels := map [string ]string {"app" : stsName }
341
-
342
- ginkgo .By ("Creating statefulset " + stsName + " with ippool " + ippool )
343
- sts := framework .MakeStatefulSet (stsName , stsName , int32 (replicas ), labels , framework .PauseImage )
344
- sts .Spec .Template .Annotations = map [string ]string {util .IpPoolAnnotation : ippool }
345
- sts = stsClient .CreateSync (sts )
346
-
347
- ginkgo .By ("Getting pods for statefulset " + stsName )
348
- pods := stsClient .GetPods (sts )
349
- framework .ExpectHaveLen (pods .Items , replicas )
350
-
351
- ips := make ([]string , 0 , replicas )
352
- for _ , pod := range pods .Items {
353
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .AllocatedAnnotation , "true" )
354
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .CidrAnnotation , subnet .Spec .CIDRBlock )
355
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .GatewayAnnotation , subnet .Spec .Gateway )
356
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .IpPoolAnnotation , ippool )
357
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .LogicalSwitchAnnotation , subnet .Name )
358
- framework .ExpectMAC (pod .Annotations [util .MacAddressAnnotation ])
359
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .RoutedAnnotation , "true" )
360
-
361
- podIPs := make ([]string , 0 , len (pod .Status .PodIPs ))
362
- for _ , podIP := range pod .Status .PodIPs {
363
- podIPs = append (podIPs , podIP .IP )
364
- }
365
- framework .ExpectConsistOf (podIPs , strings .Split (pod .Annotations [util .IpAddressAnnotation ], "," ))
366
- ips = append (ips , pod .Annotations [util .IpAddressAnnotation ])
367
- }
368
- framework .ExpectConsistOf (ips , strings .Split (ippool , ippoolSep ))
369
-
370
- ginkgo .By ("Deleting pods for statefulset " + stsName )
371
- for _ , pod := range pods .Items {
372
- err := podClient .Delete (context .TODO (), pod .Name , metav1.DeleteOptions {})
373
- framework .ExpectNoError (err , "failed to delete pod " + pod .Name )
374
- }
375
- stsClient .WaitForRunningAndReady (sts )
376
-
377
- ginkgo .By ("Getting pods for statefulset " + stsName )
378
- pods = stsClient .GetPods (sts )
379
- framework .ExpectHaveLen (pods .Items , replicas )
380
-
381
- for i , pod := range pods .Items {
382
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .AllocatedAnnotation , "true" )
383
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .CidrAnnotation , subnet .Spec .CIDRBlock )
384
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .GatewayAnnotation , subnet .Spec .Gateway )
385
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .IpPoolAnnotation , ippool )
386
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .IpAddressAnnotation , ips [i ])
387
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .LogicalSwitchAnnotation , subnet .Name )
388
- framework .ExpectMAC (pod .Annotations [util .MacAddressAnnotation ])
389
- framework .ExpectHaveKeyWithValue (pod .Annotations , util .RoutedAnnotation , "true" )
390
-
391
- podIPs := make ([]string , 0 , len (pod .Status .PodIPs ))
392
- for _ , podIP := range pod .Status .PodIPs {
393
- podIPs = append (podIPs , podIP .IP )
394
- }
395
- framework .ExpectConsistOf (podIPs , strings .Split (pod .Annotations [util .IpAddressAnnotation ], "," ))
396
- }
397
- })
398
330
})
0 commit comments