Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f76ef295
Commit
f76ef295
authored
Jul 14, 2017
by
Jack Francis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backing off az.getIPForMachine in az.NodeAddresses
also rate limiting the call to az.getVirtualMachine inside az.getIPForMachine
parent
2525ef99
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
azure_backoff.go
pkg/cloudprovider/providers/azure/azure_backoff.go
+16
-0
azure_instances.go
pkg/cloudprovider/providers/azure/azure_instances.go
+11
-2
azure_util.go
pkg/cloudprovider/providers/azure/azure_util.go
+1
-0
No files found.
pkg/cloudprovider/providers/azure/azure_backoff.go
View file @
f76ef295
...
...
@@ -59,6 +59,22 @@ func (az *Cloud) VirtualMachineClientGetWithRetry(resourceGroup, vmName string,
return
machine
,
err
}
// GetIPForMachineWithRetry invokes az.getIPForMachine with exponential backoff retry
func
(
az
*
Cloud
)
GetIPForMachineWithRetry
(
name
types
.
NodeName
)
(
string
,
error
)
{
var
ip
string
err
:=
wait
.
ExponentialBackoff
(
az
.
resourceRequestBackoff
,
func
()
(
bool
,
error
)
{
var
retryErr
error
ip
,
retryErr
=
az
.
getIPForMachine
(
name
)
if
retryErr
!=
nil
{
glog
.
Errorf
(
"backoff: failure, will retry,err=%v"
,
retryErr
)
return
false
,
nil
}
glog
.
V
(
2
)
.
Infof
(
"backoff: success"
)
return
true
,
nil
})
return
ip
,
err
}
// CreateOrUpdateSGWithRetry invokes az.SecurityGroupsClient.CreateOrUpdate with exponential backoff retry
func
(
az
*
Cloud
)
CreateOrUpdateSGWithRetry
(
sg
network
.
SecurityGroup
)
error
{
return
wait
.
ExponentialBackoff
(
az
.
resourceRequestBackoff
,
func
()
(
bool
,
error
)
{
...
...
pkg/cloudprovider/providers/azure/azure_instances.go
View file @
f76ef295
...
...
@@ -41,8 +41,17 @@ func (az *Cloud) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error) {
}
ip
,
err
:=
az
.
getIPForMachine
(
name
)
if
err
!=
nil
{
glog
.
Errorf
(
"error: az.NodeAddresses, az.getIPForMachine(%s), err=%v"
,
name
,
err
)
return
nil
,
err
if
az
.
CloudProviderBackoff
{
glog
.
V
(
2
)
.
Infof
(
"NodeAddresses(%s) backing off"
,
name
)
ip
,
err
=
az
.
GetIPForMachineWithRetry
(
name
)
if
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"NodeAddresses(%s) abort backoff"
,
name
)
return
nil
,
err
}
}
else
{
glog
.
Errorf
(
"error: az.NodeAddresses, az.getIPForMachine(%s), err=%v"
,
name
,
err
)
return
nil
,
err
}
}
return
[]
v1
.
NodeAddress
{
...
...
pkg/cloudprovider/providers/azure/azure_util.go
View file @
f76ef295
...
...
@@ -249,6 +249,7 @@ outer:
}
func
(
az
*
Cloud
)
getIPForMachine
(
nodeName
types
.
NodeName
)
(
string
,
error
)
{
az
.
operationPollRateLimiter
.
Accept
()
machine
,
exists
,
err
:=
az
.
getVirtualMachine
(
nodeName
)
if
!
exists
{
return
""
,
cloudprovider
.
InstanceNotFound
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment