test integration: use new ServiceCIDR API

Change-Id: I7aaa978842fbe8d75383f8a3159ca4fce01ffdcb
This commit is contained in:
Antonio Ojea 2023-10-29 19:00:48 +00:00
parent 271900a0f0
commit 5d90d07f2d
2 changed files with 11 additions and 6 deletions

View File

@ -230,7 +230,11 @@ func TestMigrateServiceCIDR(t *testing.T) {
return false, err
}
if cidr.Spec.IPv4 != cidr2 {
if len(cidr.Spec.CIDRs) == 0 {
return false, nil
}
if cidr.Spec.CIDRs[0] != cidr2 {
return false, nil
}

View File

@ -304,15 +304,16 @@ func TestServiceCIDRDeletion(t *testing.T) {
}
}
func makeServiceCIDR(name, ipv4, ipv6 string) *networkingv1alpha1.ServiceCIDR {
func makeServiceCIDR(name, primary, secondary string) *networkingv1alpha1.ServiceCIDR {
serviceCIDR := &networkingv1alpha1.ServiceCIDR{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Spec: networkingv1alpha1.ServiceCIDRSpec{
IPv4: ipv4,
IPv6: ipv6,
},
Spec: networkingv1alpha1.ServiceCIDRSpec{},
}
serviceCIDR.Spec.CIDRs = append(serviceCIDR.Spec.CIDRs, primary)
if secondary != "" {
serviceCIDR.Spec.CIDRs = append(serviceCIDR.Spec.CIDRs, secondary)
}
return serviceCIDR
}