@@ -22,6 +22,7 @@ import (
2222 corev1 "k8s.io/api/core/v1"
2323 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424 "k8s.io/apimachinery/pkg/util/sets"
25+ "k8s.io/utils/ptr"
2526)
2627
2728const (
@@ -677,7 +678,7 @@ func TestOpenStackPlugin(t *testing.T) {
677678 IPv6 : "2000::/64" ,
678679 },
679680 Capacity : capacity {
680- IP : openstackMaxCapacity ,
681+ IP : ptr . To ( openstackMaxCapacity ) ,
681682 },
682683 },
683684 }
@@ -804,7 +805,7 @@ func TestGetNodeEgressIPConfiguration(t *testing.T) {
804805 IPv6 : "2000::/64" ,
805806 },
806807 Capacity : capacity {
807- IP : openstackMaxCapacity ,
808+ IP : ptr . To ( openstackMaxCapacity ) ,
808809 },
809810 },
810811 },
@@ -840,7 +841,7 @@ func TestGetNodeEgressIPConfiguration(t *testing.T) {
840841 IPv6 : "2001::/64" ,
841842 },
842843 Capacity : capacity {
843- IP : openstackMaxCapacity ,
844+ IP : ptr . To ( openstackMaxCapacity ) ,
844845 },
845846 },
846847 },
@@ -884,7 +885,7 @@ func TestGetNodeEgressIPConfiguration(t *testing.T) {
884885 IPv6 : "2000::/64" ,
885886 },
886887 Capacity : capacity {
887- IP : openstackMaxCapacity ,
888+ IP : ptr . To ( openstackMaxCapacity ) ,
888889 },
889890 },
890891 },
@@ -931,7 +932,7 @@ func TestGetNodeEgressIPConfiguration(t *testing.T) {
931932 IPv6 : "2000::/64" ,
932933 },
933934 Capacity : capacity {
934- IP : openstackMaxCapacity ,
935+ IP : ptr . To ( openstackMaxCapacity ) ,
935936 },
936937 },
937938 },
@@ -943,7 +944,7 @@ func TestGetNodeEgressIPConfiguration(t *testing.T) {
943944 IPv6 : "2001::/64" ,
944945 },
945946 Capacity : capacity {
946- IP : openstackMaxCapacity ,
947+ IP : ptr . To ( openstackMaxCapacity ) ,
947948 },
948949 },
949950 },
@@ -1028,7 +1029,7 @@ func TestGetNeutronPortNodeEgressIPConfiguration(t *testing.T) {
10281029 IPv6 : "2000::/64" ,
10291030 },
10301031 Capacity : capacity {
1031- IP : openstackMaxCapacity - 2 , // 2 allowed_address_pairs configured on the port.
1032+ IP : ptr . To ( openstackMaxCapacity - 2 ) , // 2 allowed_address_pairs configured on the port.
10321033 },
10331034 },
10341035 },
@@ -1041,7 +1042,7 @@ func TestGetNeutronPortNodeEgressIPConfiguration(t *testing.T) {
10411042 IPv6 : "2000::/64" ,
10421043 },
10431044 Capacity : capacity {
1044- IP : openstackMaxCapacity + 3 - 2 , // excluding 2 allowed_address_pairs configured on the port.
1045+ IP : ptr . To ( openstackMaxCapacity + 3 - 2 ) , // excluding 2 allowed_address_pairs configured on the port.
10451046 },
10461047 },
10471048 // Configure cloudPrivateIPConfigs with 3 ips are within neutron subnet, 1 ip outside neutron subnet.
0 commit comments