@@ -21,8 +21,8 @@ import (
21
21
"net/http"
22
22
23
23
"github.com/Azure/azure-sdk-for-go/arm/compute"
24
- "github.com/Azure/azure-sdk-for-go/arm/network"
25
24
computepreview "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute"
25
+ "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"
26
26
"github.com/Azure/go-autorest/autorest"
27
27
"github.com/golang/glog"
28
28
@@ -168,16 +168,18 @@ func (az *Cloud) CreateOrUpdateLBWithRetry(lb network.LoadBalancer) error {
168
168
func (az * Cloud ) ListLBWithRetry () ([]network.LoadBalancer , error ) {
169
169
allLBs := []network.LoadBalancer {}
170
170
var result network.LoadBalancerListResult
171
+ var resultPage LoadBalancerListResultPage
171
172
172
173
err := wait .ExponentialBackoff (az .requestBackoff (), func () (bool , error ) {
173
174
var retryErr error
174
- result , retryErr = az .LoadBalancerClient .List (az .ResourceGroup )
175
+ resultPage , retryErr = az .LoadBalancerClient .List (az .ResourceGroup )
175
176
if retryErr != nil {
176
177
glog .Errorf ("LoadBalancerClient.List(%v) - backoff: failure, will retry,err=%v" ,
177
178
az .ResourceGroup ,
178
179
retryErr )
179
180
return false , retryErr
180
181
}
182
+ result = resultPage .Response ()
181
183
glog .V (2 ).Infof ("LoadBalancerClient.List(%v) - backoff: success" , az .ResourceGroup )
182
184
return true , nil
183
185
})
@@ -194,13 +196,14 @@ func (az *Cloud) ListLBWithRetry() ([]network.LoadBalancer, error) {
194
196
if result .NextLink != nil {
195
197
err := wait .ExponentialBackoff (az .requestBackoff (), func () (bool , error ) {
196
198
var retryErr error
197
- result , retryErr = az .LoadBalancerClient .ListNextResults (az .ResourceGroup , result )
199
+ resultPage , retryErr = az .LoadBalancerClient .ListNextResults (az .ResourceGroup , resultPage )
198
200
if retryErr != nil {
199
201
glog .Errorf ("LoadBalancerClient.ListNextResults(%v) - backoff: failure, will retry,err=%v" ,
200
202
az .ResourceGroup ,
201
203
retryErr )
202
204
return false , retryErr
203
205
}
206
+ result = resultPage .Response ()
204
207
glog .V (2 ).Infof ("LoadBalancerClient.ListNextResults(%v) - backoff: success" , az .ResourceGroup )
205
208
return true , nil
206
209
})
@@ -218,15 +221,18 @@ func (az *Cloud) ListLBWithRetry() ([]network.LoadBalancer, error) {
218
221
func (az * Cloud ) ListPIPWithRetry (pipResourceGroup string ) ([]network.PublicIPAddress , error ) {
219
222
allPIPs := []network.PublicIPAddress {}
220
223
var result network.PublicIPAddressListResult
224
+ var resultPage PublicIPAddressListResultPage
225
+
221
226
err := wait .ExponentialBackoff (az .requestBackoff (), func () (bool , error ) {
222
227
var retryErr error
223
- result , retryErr = az .PublicIPAddressesClient .List (pipResourceGroup )
228
+ resultPage , retryErr = az .PublicIPAddressesClient .List (pipResourceGroup )
224
229
if retryErr != nil {
225
230
glog .Errorf ("PublicIPAddressesClient.List(%v) - backoff: failure, will retry,err=%v" ,
226
231
pipResourceGroup ,
227
232
retryErr )
228
233
return false , retryErr
229
234
}
235
+ result = resultPage .Response ()
230
236
glog .V (2 ).Infof ("PublicIPAddressesClient.List(%v) - backoff: success" , pipResourceGroup )
231
237
return true , nil
232
238
})
@@ -243,13 +249,14 @@ func (az *Cloud) ListPIPWithRetry(pipResourceGroup string) ([]network.PublicIPAd
243
249
if result .NextLink != nil {
244
250
err := wait .ExponentialBackoff (az .requestBackoff (), func () (bool , error ) {
245
251
var retryErr error
246
- result , retryErr = az .PublicIPAddressesClient .ListNextResults (az .ResourceGroup , result )
252
+ resultPage , retryErr = az .PublicIPAddressesClient .ListNextResults (az .ResourceGroup , resultPage )
247
253
if retryErr != nil {
248
254
glog .Errorf ("PublicIPAddressesClient.ListNextResults(%v) - backoff: failure, will retry,err=%v" ,
249
255
pipResourceGroup ,
250
256
retryErr )
251
257
return false , retryErr
252
258
}
259
+ result = resultPage .Response ()
253
260
glog .V (2 ).Infof ("PublicIPAddressesClient.ListNextResults(%v) - backoff: success" , pipResourceGroup )
254
261
return true , nil
255
262
})
0 commit comments