Skip to content

Commit 092b0da

Browse files
andrewhsutamilmani1989
authored andcommitted
fix ipamclient failures (#169)
* fix ipamclient_test.go Unable to compile. Variables like getAddressSpacesPath were not declared. Signed-off-by: Andrew Hsu <[email protected]> * fixed ipamclient.go nil pointer dereference Signed-off-by: Andrew Hsu <[email protected]>
1 parent f09a713 commit 092b0da

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cns/ipamclient/ipamclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (ic *IpamClient) ReleaseIPAddress(poolID string, reservationID string) erro
207207

208208
return nil
209209
}
210-
log.Printf("[Azure CNS] ReleaseIP invalid http status code: %v err:%v", res.StatusCode, err.Error())
210+
log.Printf("[Azure CNS] ReleaseIP invalid http status code: %v", res.StatusCode)
211211
return err
212212

213213
}

cns/ipamclient/ipamclient_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"testing"
1212

1313
"github.com/Azure/azure-container-networking/common"
14+
"github.com/Azure/azure-container-networking/cnm/ipam"
1415
)
1516

1617
var mux *http.ServeMux
@@ -27,11 +28,11 @@ func TestMain(m *testing.M) {
2728
fmt.Printf("Failed to create agent, err:%v.\n", err)
2829
return
2930
}
30-
ipamAgent.AddHandler(getAddressSpacesPath, handleIpamAsIDQuery)
31-
ipamAgent.AddHandler(requestPoolPath, handlePoolIDQuery)
32-
ipamAgent.AddHandler(reserveAddrPath, handleReserveIPQuery)
33-
ipamAgent.AddHandler(releaseAddrPath, handleReleaseIPQuery)
34-
ipamAgent.AddHandler(getPoolInfoPath, handleIPUtilizationQuery)
31+
ipamAgent.AddHandler(ipam.GetAddressSpacesPath, handleIpamAsIDQuery)
32+
ipamAgent.AddHandler(ipam.RequestPoolPath, handlePoolIDQuery)
33+
ipamAgent.AddHandler(ipam.RequestAddressPath, handleReserveIPQuery)
34+
ipamAgent.AddHandler(ipam.ReleasePoolPath, handleReleaseIPQuery)
35+
ipamAgent.AddHandler(ipam.GetPoolInfoPath, handleIPUtilizationQuery)
3536

3637
err = ipamAgent.Start(make(chan error, 1))
3738
if err != nil {

0 commit comments

Comments
 (0)