@@ -58,7 +58,7 @@ func TestReconcileNCWithExistingState(t *testing.T) {
5858 var startingIndex = 6
5959 for i := 0 ; i < 4 ; i ++ {
6060 ipaddress := "10.0.0." + strconv .Itoa (startingIndex )
61- secIpConfig := newSecondaryIPConfig (ipaddress , 32 )
61+ secIpConfig := newSecondaryIPConfig (ipaddress )
6262 ipId := uuid .New ()
6363 secondaryIPConfigs [ipId .String ()] = secIpConfig
6464 startingIndex ++
@@ -95,7 +95,7 @@ func TestReconcileNCWithSystemPods(t *testing.T) {
9595 var startingIndex = 6
9696 for i := 0 ; i < 4 ; i ++ {
9797 ipaddress := "10.0.0." + strconv .Itoa (startingIndex )
98- secIpConfig := newSecondaryIPConfig (ipaddress , 32 )
98+ secIpConfig := newSecondaryIPConfig (ipaddress )
9999 ipId := uuid .New ()
100100 secondaryIPConfigs [ipId .String ()] = secIpConfig
101101 startingIndex ++
@@ -136,7 +136,7 @@ func validateCreateOrUpdateNCInternal(t *testing.T, secondaryIpCount int) {
136136 var startingIndex = 6
137137 for i := 0 ; i < secondaryIpCount ; i ++ {
138138 ipaddress := "10.0.0." + strconv .Itoa (startingIndex )
139- secIpConfig := newSecondaryIPConfig (ipaddress , 32 )
139+ secIpConfig := newSecondaryIPConfig (ipaddress )
140140 ipId := uuid .New ()
141141 secondaryIPConfigs [ipId .String ()] = secIpConfig
142142 startingIndex ++
@@ -148,7 +148,7 @@ func validateCreateOrUpdateNCInternal(t *testing.T, secondaryIpCount int) {
148148 fmt .Println ("Validate Scaleup" )
149149 for i := 0 ; i < secondaryIpCount ; i ++ {
150150 ipaddress := "10.0.0." + strconv .Itoa (startingIndex )
151- secIpConfig := newSecondaryIPConfig (ipaddress , 32 )
151+ secIpConfig := newSecondaryIPConfig (ipaddress )
152152 ipId := uuid .New ()
153153 secondaryIPConfigs [ipId .String ()] = secIpConfig
154154 startingIndex ++
@@ -216,8 +216,8 @@ func validateNetworkRequest(t *testing.T, req cns.CreateNetworkContainerRequest)
216216 if secondaryIpConfig , ok := req .SecondaryIPConfigs [ipid ]; ! ok {
217217 t .Fatalf ("PodIpConfigState has stale ipId: %s, config: %+v" , ipid , ipStatus )
218218 } else {
219- if ipStatus .IPSubnet != secondaryIpConfig .IPSubnet {
220- t .Fatalf ("IPId: %s IPSubnet doesnt match: expected %+v, actual: %+v" , ipid , secondaryIpConfig .IPSubnet , ipStatus .IPSubnet )
219+ if ipStatus .IPAddress != secondaryIpConfig .IPAddress {
220+ t .Fatalf ("IPId: %s IPSubnet doesnt match: expected %+v, actual: %+v" , ipid , secondaryIpConfig .IPAddress , ipStatus .IPAddress )
221221 }
222222
223223 // Validate IP state
@@ -239,12 +239,12 @@ func validateNetworkRequest(t *testing.T, req cns.CreateNetworkContainerRequest)
239239 t .Fatalf ("IPId: %s State is not Available, ipStatus: %+v" , ipid , ipStatus )
240240 }
241241
242- alreadyValidated [ipid ] = ipStatus .IPSubnet . IPAddress
242+ alreadyValidated [ipid ] = ipStatus .IPAddress
243243 }
244244 } else {
245245 // if ipaddress is not same, then fail
246- if ipaddress != ipStatus .IPSubnet . IPAddress {
247- t .Fatalf ("Added the same IP guid :%s with different ipaddress, expected:%s, actual %s" , ipid , ipStatus .IPSubnet . IPAddress , ipaddress )
246+ if ipaddress != ipStatus .IPAddress {
247+ t .Fatalf ("Added the same IP guid :%s with different ipaddress, expected:%s, actual %s" , ipid , ipStatus .IPAddress , ipaddress )
248248 }
249249 }
250250 }
@@ -298,7 +298,7 @@ func validateNCStateAfterReconcile(t *testing.T, ncRequest *cns.CreateNetworkCon
298298 }
299299
300300 // Validate if IPAddress matches
301- if ipConfigstate .IPSubnet . IPAddress != ipaddress {
301+ if ipConfigstate .IPAddress != ipaddress {
302302 t .Fatalf ("IpAddress %s is not same, for Pod: %+v, actual ipState: %+v" , ipaddress , podInfo , ipConfigstate )
303303 }
304304
@@ -319,7 +319,7 @@ func validateNCStateAfterReconcile(t *testing.T, ncRequest *cns.CreateNetworkCon
319319 // validate rest of Secondary IPs in Available state
320320 if ncRequest != nil {
321321 for secIpId , secIpConfig := range ncRequest .SecondaryIPConfigs {
322- if _ , exists := expectedAllocatedPods [secIpConfig .IPSubnet . IPAddress ]; exists {
322+ if _ , exists := expectedAllocatedPods [secIpConfig .IPAddress ]; exists {
323323 continue
324324 }
325325
0 commit comments