@@ -22,7 +22,7 @@ import (
22
22
"time"
23
23
24
24
v1 "k8s.io/api/core/v1"
25
- discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1 "
25
+ discoveryv1beta1 "k8s.io/api/discovery/v1beta1 "
26
26
apierrors "k8s.io/apimachinery/pkg/api/errors"
27
27
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28
28
"k8s.io/apimachinery/pkg/util/intstr"
@@ -192,7 +192,7 @@ var _ = SIGDescribe("EndpointSlice [Feature:EndpointSlice]", func() {
192
192
// and takes some shortcuts with the assumption that those test cases will be
193
193
// the only caller of this function.
194
194
func expectEndpointsAndSlices (cs clientset.Interface , ns string , svc * v1.Service , pods []* v1.Pod , numSubsets , numSlices int , namedPort bool ) {
195
- endpointSlices := []discoveryv1alpha1 .EndpointSlice {}
195
+ endpointSlices := []discoveryv1beta1 .EndpointSlice {}
196
196
endpoints := & v1.Endpoints {}
197
197
198
198
err := wait .Poll (5 * time .Second , 1 * time .Minute , func () (bool , error ) {
@@ -353,18 +353,18 @@ func expectEndpointsAndSlices(cs clientset.Interface, ns string, svc *v1.Service
353
353
// hasMatchingEndpointSlices returns any EndpointSlices that match the
354
354
// conditions along with a boolean indicating if all the conditions have been
355
355
// met.
356
- func hasMatchingEndpointSlices (cs clientset.Interface , ns , svcName string , numEndpoints , numSlices int ) ([]discoveryv1alpha1 .EndpointSlice , bool ) {
357
- listOptions := metav1.ListOptions {LabelSelector : fmt .Sprintf ("%s=%s" , discoveryv1alpha1 .LabelServiceName , svcName )}
358
- esList , err := cs .DiscoveryV1alpha1 ().EndpointSlices (ns ).List (context .TODO (), listOptions )
356
+ func hasMatchingEndpointSlices (cs clientset.Interface , ns , svcName string , numEndpoints , numSlices int ) ([]discoveryv1beta1 .EndpointSlice , bool ) {
357
+ listOptions := metav1.ListOptions {LabelSelector : fmt .Sprintf ("%s=%s" , discoveryv1beta1 .LabelServiceName , svcName )}
358
+ esList , err := cs .DiscoveryV1beta1 ().EndpointSlices (ns ).List (context .TODO (), listOptions )
359
359
framework .ExpectNoError (err , "Error fetching EndpointSlice for %s/%s Service" , ns , svcName )
360
360
361
361
if len (esList .Items ) == 0 {
362
362
framework .Logf ("EndpointSlice for %s/%s Service not found" , ns , svcName )
363
- return []discoveryv1alpha1 .EndpointSlice {}, false
363
+ return []discoveryv1beta1 .EndpointSlice {}, false
364
364
}
365
365
if len (esList .Items ) != numSlices {
366
366
framework .Logf ("Expected %d EndpointSlices for %s/%s Service, got %d" , numSlices , ns , svcName , len (esList .Items ))
367
- return []discoveryv1alpha1 .EndpointSlice {}, false
367
+ return []discoveryv1beta1 .EndpointSlice {}, false
368
368
}
369
369
370
370
actualNumEndpoints := 0
@@ -373,7 +373,7 @@ func hasMatchingEndpointSlices(cs clientset.Interface, ns, svcName string, numEn
373
373
}
374
374
if actualNumEndpoints != numEndpoints {
375
375
framework .Logf ("EndpointSlices for %s/%s Service have %d/%d endpoints" , ns , svcName , actualNumEndpoints , numEndpoints )
376
- return []discoveryv1alpha1 .EndpointSlice {}, false
376
+ return []discoveryv1beta1 .EndpointSlice {}, false
377
377
}
378
378
379
379
return esList .Items , true
0 commit comments