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
8f69bc85
Commit
8f69bc85
authored
May 23, 2018
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add verbose logs for azure cloud provider
parent
cc5b33b1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
azure_backoff.go
pkg/cloudprovider/providers/azure/azure_backoff.go
+7
-7
azure_instances.go
pkg/cloudprovider/providers/azure/azure_instances.go
+1
-1
azure_loadbalancer.go
pkg/cloudprovider/providers/azure/azure_loadbalancer.go
+0
-0
azure_routes.go
pkg/cloudprovider/providers/azure/azure_routes.go
+16
-16
azure_standard.go
pkg/cloudprovider/providers/azure/azure_standard.go
+6
-6
No files found.
pkg/cloudprovider/providers/azure/azure_backoff.go
View file @
8f69bc85
...
@@ -56,10 +56,10 @@ func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.Virtua
...
@@ -56,10 +56,10 @@ func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.Virtua
return
true
,
cloudprovider
.
InstanceNotFound
return
true
,
cloudprovider
.
InstanceNotFound
}
}
if
retryErr
!=
nil
{
if
retryErr
!=
nil
{
glog
.
Errorf
(
"
backoff: failure, will retry,err=%v"
,
retryErr
)
glog
.
Errorf
(
"
GetVirtualMachineWithRetry(%s): backoff failure, will retry, err=%v"
,
name
,
retryErr
)
return
false
,
nil
return
false
,
nil
}
}
glog
.
V
(
2
)
.
Info
(
"backoff: success"
)
glog
.
V
(
2
)
.
Info
f
(
"GetVirtualMachineWithRetry(%s): backoff success"
,
name
)
return
true
,
nil
return
true
,
nil
})
})
if
err
==
wait
.
ErrWaitTimeout
{
if
err
==
wait
.
ErrWaitTimeout
{
...
@@ -123,10 +123,10 @@ func (az *Cloud) GetIPForMachineWithRetry(name types.NodeName) (string, string,
...
@@ -123,10 +123,10 @@ func (az *Cloud) GetIPForMachineWithRetry(name types.NodeName) (string, string,
var
retryErr
error
var
retryErr
error
ip
,
publicIP
,
retryErr
=
az
.
getIPForMachine
(
name
)
ip
,
publicIP
,
retryErr
=
az
.
getIPForMachine
(
name
)
if
retryErr
!=
nil
{
if
retryErr
!=
nil
{
glog
.
Errorf
(
"
backoff: failure, will retry,err=%v"
,
retryErr
)
glog
.
Errorf
(
"
GetIPForMachineWithRetry(%s): backoff failure, will retry,err=%v"
,
name
,
retryErr
)
return
false
,
nil
return
false
,
nil
}
}
glog
.
V
(
2
)
.
Info
(
"backoff: success"
)
glog
.
V
(
2
)
.
Info
f
(
"GetIPForMachineWithRetry(%s): backoff success"
,
name
)
return
true
,
nil
return
true
,
nil
})
})
return
ip
,
publicIP
,
err
return
ip
,
publicIP
,
err
...
@@ -365,11 +365,11 @@ func (az *Cloud) UpdateVmssVMWithRetry(ctx context.Context, resourceGroupName st
...
@@ -365,11 +365,11 @@ func (az *Cloud) UpdateVmssVMWithRetry(ctx context.Context, resourceGroupName st
// A wait.ConditionFunc function to deal with common HTTP backoff response conditions
// A wait.ConditionFunc function to deal with common HTTP backoff response conditions
func
processRetryResponse
(
resp
autorest
.
Response
,
err
error
)
(
bool
,
error
)
{
func
processRetryResponse
(
resp
autorest
.
Response
,
err
error
)
(
bool
,
error
)
{
if
isSuccessHTTPResponse
(
resp
)
{
if
isSuccessHTTPResponse
(
resp
)
{
glog
.
V
(
2
)
.
Infof
(
"
backoff:
success, HTTP response=%d"
,
resp
.
StatusCode
)
glog
.
V
(
2
)
.
Infof
(
"
processRetryResponse: backoff
success, HTTP response=%d"
,
resp
.
StatusCode
)
return
true
,
nil
return
true
,
nil
}
}
if
shouldRetryAPIRequest
(
resp
,
err
)
{
if
shouldRetryAPIRequest
(
resp
,
err
)
{
glog
.
Errorf
(
"
backoff:
failure, will retry, HTTP response=%d, err=%v"
,
resp
.
StatusCode
,
err
)
glog
.
Errorf
(
"
processRetryResponse: backoff
failure, will retry, HTTP response=%d, err=%v"
,
resp
.
StatusCode
,
err
)
// suppress the error object so that backoff process continues
// suppress the error object so that backoff process continues
return
false
,
nil
return
false
,
nil
}
}
...
@@ -422,7 +422,7 @@ func processHTTPRetryResponse(resp *http.Response, err error) (bool, error) {
...
@@ -422,7 +422,7 @@ func processHTTPRetryResponse(resp *http.Response, err error) (bool, error) {
}
}
if
shouldRetryHTTPRequest
(
resp
,
err
)
{
if
shouldRetryHTTPRequest
(
resp
,
err
)
{
glog
.
Errorf
(
"
backoff:
failure, will retry, HTTP response=%d, err=%v"
,
resp
.
StatusCode
,
err
)
glog
.
Errorf
(
"
processHTTPRetryResponse: backoff
failure, will retry, HTTP response=%d, err=%v"
,
resp
.
StatusCode
,
err
)
// suppress the error object so that backoff process continues
// suppress the error object so that backoff process continues
return
false
,
nil
return
false
,
nil
}
}
...
...
pkg/cloudprovider/providers/azure/azure_instances.go
View file @
8f69bc85
...
@@ -34,7 +34,7 @@ func (az *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.N
...
@@ -34,7 +34,7 @@ func (az *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.N
addressGetter
:=
func
(
nodeName
types
.
NodeName
)
([]
v1
.
NodeAddress
,
error
)
{
addressGetter
:=
func
(
nodeName
types
.
NodeName
)
([]
v1
.
NodeAddress
,
error
)
{
ip
,
publicIP
,
err
:=
az
.
GetIPForMachineWithRetry
(
nodeName
)
ip
,
publicIP
,
err
:=
az
.
GetIPForMachineWithRetry
(
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"NodeAddresses(%s) abort backoff
"
,
nodeName
)
glog
.
V
(
2
)
.
Infof
(
"NodeAddresses(%s) abort backoff
: %v"
,
nodeName
,
err
)
return
nil
,
err
return
nil
,
err
}
}
...
...
pkg/cloudprovider/providers/azure/azure_loadbalancer.go
View file @
8f69bc85
This diff is collapsed.
Click to expand it.
pkg/cloudprovider/providers/azure/azure_routes.go
View file @
8f69bc85
...
@@ -30,7 +30,7 @@ import (
...
@@ -30,7 +30,7 @@ import (
// ListRoutes lists all managed routes that belong to the specified clusterName
// ListRoutes lists all managed routes that belong to the specified clusterName
func
(
az
*
Cloud
)
ListRoutes
(
ctx
context
.
Context
,
clusterName
string
)
([]
*
cloudprovider
.
Route
,
error
)
{
func
(
az
*
Cloud
)
ListRoutes
(
ctx
context
.
Context
,
clusterName
string
)
([]
*
cloudprovider
.
Route
,
error
)
{
glog
.
V
(
10
)
.
Infof
(
"
list
: START clusterName=%q"
,
clusterName
)
glog
.
V
(
10
)
.
Infof
(
"
ListRoutes
: START clusterName=%q"
,
clusterName
)
routeTable
,
existsRouteTable
,
err
:=
az
.
getRouteTable
()
routeTable
,
existsRouteTable
,
err
:=
az
.
getRouteTable
()
return
processRoutes
(
routeTable
,
existsRouteTable
,
err
)
return
processRoutes
(
routeTable
,
existsRouteTable
,
err
)
}
}
...
@@ -50,7 +50,7 @@ func processRoutes(routeTable network.RouteTable, exists bool, err error) ([]*cl
...
@@ -50,7 +50,7 @@ func processRoutes(routeTable network.RouteTable, exists bool, err error) ([]*cl
for
i
,
route
:=
range
*
routeTable
.
Routes
{
for
i
,
route
:=
range
*
routeTable
.
Routes
{
instance
:=
mapRouteNameToNodeName
(
*
route
.
Name
)
instance
:=
mapRouteNameToNodeName
(
*
route
.
Name
)
cidr
:=
*
route
.
AddressPrefix
cidr
:=
*
route
.
AddressPrefix
glog
.
V
(
10
)
.
Infof
(
"
list
: * instance=%q, cidr=%q"
,
instance
,
cidr
)
glog
.
V
(
10
)
.
Infof
(
"
ListRoutes
: * instance=%q, cidr=%q"
,
instance
,
cidr
)
kubeRoutes
[
i
]
=
&
cloudprovider
.
Route
{
kubeRoutes
[
i
]
=
&
cloudprovider
.
Route
{
Name
:
*
route
.
Name
,
Name
:
*
route
.
Name
,
...
@@ -60,13 +60,13 @@ func processRoutes(routeTable network.RouteTable, exists bool, err error) ([]*cl
...
@@ -60,13 +60,13 @@ func processRoutes(routeTable network.RouteTable, exists bool, err error) ([]*cl
}
}
}
}
glog
.
V
(
10
)
.
Info
(
"
list
: FINISH"
)
glog
.
V
(
10
)
.
Info
(
"
ListRoutes
: FINISH"
)
return
kubeRoutes
,
nil
return
kubeRoutes
,
nil
}
}
func
(
az
*
Cloud
)
createRouteTableIfNotExists
(
clusterName
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
func
(
az
*
Cloud
)
createRouteTableIfNotExists
(
clusterName
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
if
_
,
existsRouteTable
,
err
:=
az
.
getRouteTable
();
err
!=
nil
{
if
_
,
existsRouteTable
,
err
:=
az
.
getRouteTable
();
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"create error: couldn't get routetable. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"create
RouteTableIfNotExists
error: couldn't get routetable. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
return
err
return
err
}
else
if
existsRouteTable
{
}
else
if
existsRouteTable
{
return
nil
return
nil
...
@@ -81,17 +81,17 @@ func (az *Cloud) createRouteTable() error {
...
@@ -81,17 +81,17 @@ func (az *Cloud) createRouteTable() error {
RouteTablePropertiesFormat
:
&
network
.
RouteTablePropertiesFormat
{},
RouteTablePropertiesFormat
:
&
network
.
RouteTablePropertiesFormat
{},
}
}
glog
.
V
(
3
)
.
Infof
(
"create: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
glog
.
V
(
3
)
.
Infof
(
"create
RouteTable
: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
respChan
,
errChan
:=
az
.
RouteTablesClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
routeTable
,
nil
)
respChan
,
errChan
:=
az
.
RouteTablesClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
routeTable
,
nil
)
resp
:=
<-
respChan
resp
:=
<-
respChan
err
:=
<-
errChan
err
:=
<-
errChan
glog
.
V
(
10
)
.
Infof
(
"RouteTablesClient.CreateOrUpdate(%q): end"
,
az
.
RouteTableName
)
glog
.
V
(
10
)
.
Infof
(
"RouteTablesClient.CreateOrUpdate(%q): end"
,
az
.
RouteTableName
)
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
.
Response
,
err
)
{
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
.
Response
,
err
)
{
glog
.
V
(
2
)
.
Infof
(
"create backing off: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
glog
.
V
(
2
)
.
Infof
(
"create
RouteTable
backing off: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
retryErr
:=
az
.
CreateOrUpdateRouteTableWithRetry
(
routeTable
)
retryErr
:=
az
.
CreateOrUpdateRouteTableWithRetry
(
routeTable
)
if
retryErr
!=
nil
{
if
retryErr
!=
nil
{
err
=
retryErr
err
=
retryErr
glog
.
V
(
2
)
.
Infof
(
"create abort backoff: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
glog
.
V
(
2
)
.
Infof
(
"create
RouteTableIfNotExists
abort backoff: creating routetable. routeTableName=%q"
,
az
.
RouteTableName
)
}
}
}
}
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -107,7 +107,7 @@ func (az *Cloud) createRouteTable() error {
...
@@ -107,7 +107,7 @@ func (az *Cloud) createRouteTable() error {
// route.Name will be ignored, although the cloud-provider may use nameHint
// route.Name will be ignored, although the cloud-provider may use nameHint
// to create a more user-meaningful name.
// to create a more user-meaningful name.
func
(
az
*
Cloud
)
CreateRoute
(
ctx
context
.
Context
,
clusterName
string
,
nameHint
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
func
(
az
*
Cloud
)
CreateRoute
(
ctx
context
.
Context
,
clusterName
string
,
nameHint
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
glog
.
V
(
2
)
.
Infof
(
"
crea
te: creating route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
CreateRou
te: creating route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
if
err
:=
az
.
createRouteTableIfNotExists
(
clusterName
,
kubeRoute
);
err
!=
nil
{
if
err
:=
az
.
createRouteTableIfNotExists
(
clusterName
,
kubeRoute
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -126,31 +126,31 @@ func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint s
...
@@ -126,31 +126,31 @@ func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint s
},
},
}
}
glog
.
V
(
3
)
.
Infof
(
"crea
te: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"CreateRou
te: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
respChan
,
errChan
:=
az
.
RoutesClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
*
route
.
Name
,
route
,
nil
)
respChan
,
errChan
:=
az
.
RoutesClient
.
CreateOrUpdate
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
*
route
.
Name
,
route
,
nil
)
resp
:=
<-
respChan
resp
:=
<-
respChan
err
=
<-
errChan
err
=
<-
errChan
glog
.
V
(
10
)
.
Infof
(
"RoutesClient.CreateOrUpdate(%q): end"
,
az
.
RouteTableName
)
glog
.
V
(
10
)
.
Infof
(
"RoutesClient.CreateOrUpdate(%q): end"
,
az
.
RouteTableName
)
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
.
Response
,
err
)
{
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
.
Response
,
err
)
{
glog
.
V
(
2
)
.
Infof
(
"
crea
te backing off: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
CreateRou
te backing off: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
retryErr
:=
az
.
CreateOrUpdateRouteWithRetry
(
route
)
retryErr
:=
az
.
CreateOrUpdateRouteWithRetry
(
route
)
if
retryErr
!=
nil
{
if
retryErr
!=
nil
{
err
=
retryErr
err
=
retryErr
glog
.
V
(
2
)
.
Infof
(
"
crea
te abort backoff: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
CreateRou
te abort backoff: creating route: instance=%q cidr=%q"
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
}
}
}
}
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
glog
.
V
(
2
)
.
Infof
(
"
crea
te: route created. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
CreateRou
te: route created. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
return
nil
return
nil
}
}
// DeleteRoute deletes the specified managed route
// DeleteRoute deletes the specified managed route
// Route should be as returned by ListRoutes
// Route should be as returned by ListRoutes
func
(
az
*
Cloud
)
DeleteRoute
(
ctx
context
.
Context
,
clusterName
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
func
(
az
*
Cloud
)
DeleteRoute
(
ctx
context
.
Context
,
clusterName
string
,
kubeRoute
*
cloudprovider
.
Route
)
error
{
glog
.
V
(
2
)
.
Infof
(
"
dele
te: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
DeleteRou
te: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
routeName
:=
mapNodeNameToRouteName
(
kubeRoute
.
TargetNode
)
routeName
:=
mapNodeNameToRouteName
(
kubeRoute
.
TargetNode
)
respChan
,
errChan
:=
az
.
RoutesClient
.
Delete
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
routeName
,
nil
)
respChan
,
errChan
:=
az
.
RoutesClient
.
Delete
(
az
.
ResourceGroup
,
az
.
RouteTableName
,
routeName
,
nil
)
...
@@ -159,18 +159,18 @@ func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute
...
@@ -159,18 +159,18 @@ func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute
glog
.
V
(
10
)
.
Infof
(
"RoutesClient.Delete(%q): end"
,
az
.
RouteTableName
)
glog
.
V
(
10
)
.
Infof
(
"RoutesClient.Delete(%q): end"
,
az
.
RouteTableName
)
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
,
err
)
{
if
az
.
CloudProviderBackoff
&&
shouldRetryAPIRequest
(
resp
,
err
)
{
glog
.
V
(
2
)
.
Infof
(
"
dele
te backing off: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
DeleteRou
te backing off: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
retryErr
:=
az
.
DeleteRouteWithRetry
(
routeName
)
retryErr
:=
az
.
DeleteRouteWithRetry
(
routeName
)
if
retryErr
!=
nil
{
if
retryErr
!=
nil
{
err
=
retryErr
err
=
retryErr
glog
.
V
(
2
)
.
Infof
(
"
dele
te abort backoff: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
DeleteRou
te abort backoff: deleting route. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
}
}
}
}
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
glog
.
V
(
2
)
.
Infof
(
"
dele
te: route deleted. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
glog
.
V
(
2
)
.
Infof
(
"
DeleteRou
te: route deleted. clusterName=%q instance=%q cidr=%q"
,
clusterName
,
kubeRoute
.
TargetNode
,
kubeRoute
.
DestinationCIDR
)
return
nil
return
nil
}
}
...
...
pkg/cloudprovider/providers/azure/azure_standard.go
View file @
8f69bc85
...
@@ -172,7 +172,7 @@ func getProtocolsFromKubernetesProtocol(protocol v1.Protocol) (*network.Transpor
...
@@ -172,7 +172,7 @@ func getProtocolsFromKubernetesProtocol(protocol v1.Protocol) (*network.Transpor
securityProto
=
network
.
SecurityRuleProtocolUDP
securityProto
=
network
.
SecurityRuleProtocolUDP
return
&
transportProto
,
&
securityProto
,
nil
,
nil
return
&
transportProto
,
&
securityProto
,
nil
,
nil
default
:
default
:
return
&
transportProto
,
&
securityProto
,
&
probeProto
,
fmt
.
Errorf
(
"
O
nly TCP and UDP are supported for Azure LoadBalancers"
)
return
&
transportProto
,
&
securityProto
,
&
probeProto
,
fmt
.
Errorf
(
"
o
nly TCP and UDP are supported for Azure LoadBalancers"
)
}
}
}
}
...
@@ -284,7 +284,7 @@ outer:
...
@@ -284,7 +284,7 @@ outer:
return
smallest
,
nil
return
smallest
,
nil
}
}
return
-
1
,
fmt
.
Errorf
(
"
S
ecurityGroup priorities are exhausted"
)
return
-
1
,
fmt
.
Errorf
(
"
s
ecurityGroup priorities are exhausted"
)
}
}
func
(
az
*
Cloud
)
getIPForMachine
(
nodeName
types
.
NodeName
)
(
string
,
string
,
error
)
{
func
(
az
*
Cloud
)
getIPForMachine
(
nodeName
types
.
NodeName
)
(
string
,
string
,
error
)
{
...
@@ -371,10 +371,10 @@ func (as *availabilitySet) GetInstanceIDByNodeName(name string) (string, error)
...
@@ -371,10 +371,10 @@ func (as *availabilitySet) GetInstanceIDByNodeName(name string) (string, error)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
if
as
.
CloudProviderBackoff
{
if
as
.
CloudProviderBackoff
{
glog
.
V
(
2
)
.
Infof
(
"
InstanceID
(%s) backing off"
,
name
)
glog
.
V
(
2
)
.
Infof
(
"
GetInstanceIDByNodeName
(%s) backing off"
,
name
)
machine
,
err
=
as
.
GetVirtualMachineWithRetry
(
types
.
NodeName
(
name
))
machine
,
err
=
as
.
GetVirtualMachineWithRetry
(
types
.
NodeName
(
name
))
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"
InstanceID
(%s) abort backoff"
,
name
)
glog
.
V
(
2
)
.
Infof
(
"
GetInstanceIDByNodeName
(%s) abort backoff"
,
name
)
return
""
,
err
return
""
,
err
}
}
}
else
{
}
else
{
...
@@ -399,7 +399,7 @@ func (as *availabilitySet) GetNodeNameByProviderID(providerID string) (types.Nod
...
@@ -399,7 +399,7 @@ func (as *availabilitySet) GetNodeNameByProviderID(providerID string) (types.Nod
func
(
as
*
availabilitySet
)
GetInstanceTypeByNodeName
(
name
string
)
(
string
,
error
)
{
func
(
as
*
availabilitySet
)
GetInstanceTypeByNodeName
(
name
string
)
(
string
,
error
)
{
machine
,
err
:=
as
.
getVirtualMachine
(
types
.
NodeName
(
name
))
machine
,
err
:=
as
.
getVirtualMachine
(
types
.
NodeName
(
name
))
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"
error: as.GetInstanceTypeByNodeName(%s),
as.getVirtualMachine(%s) err=%v"
,
name
,
name
,
err
)
glog
.
Errorf
(
"
as.GetInstanceTypeByNodeName(%s) failed:
as.getVirtualMachine(%s) err=%v"
,
name
,
name
,
err
)
return
""
,
err
return
""
,
err
}
}
...
@@ -436,7 +436,7 @@ func (as *availabilitySet) GetIPByNodeName(name, vmSetName string) (string, stri
...
@@ -436,7 +436,7 @@ func (as *availabilitySet) GetIPByNodeName(name, vmSetName string) (string, stri
ipConfig
,
err
:=
getPrimaryIPConfig
(
nic
)
ipConfig
,
err
:=
getPrimaryIPConfig
(
nic
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"
error: as.GetIPByNodeName(%s),
getPrimaryIPConfig(%v), err=%v"
,
name
,
nic
,
err
)
glog
.
Errorf
(
"
as.GetIPByNodeName(%s) failed:
getPrimaryIPConfig(%v), err=%v"
,
name
,
nic
,
err
)
return
""
,
""
,
err
return
""
,
""
,
err
}
}
...
...
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