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
63ee42e9
Commit
63ee42e9
authored
Feb 22, 2019
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timeout in GetVolumeLimits operation
add timeout for getAllStorageAccounts
parent
51bb3831
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
azure_blobDiskController.go
...cloudprovider/providers/azure/azure_blobDiskController.go
+2
-1
azure_dd.go
pkg/volume/azure_dd/azure_dd.go
+4
-1
No files found.
pkg/cloudprovider/providers/azure/azure_blobDiskController.go
View file @
63ee42e9
...
@@ -18,6 +18,7 @@ package azure
...
@@ -18,6 +18,7 @@ package azure
import
(
import
(
"bytes"
"bytes"
"context"
"encoding/binary"
"encoding/binary"
"fmt"
"fmt"
"net/url"
"net/url"
...
@@ -439,7 +440,7 @@ func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
...
@@ -439,7 +440,7 @@ func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
}
}
func
(
c
*
BlobDiskController
)
getAllStorageAccounts
()
(
map
[
string
]
*
storageAccountState
,
error
)
{
func
(
c
*
BlobDiskController
)
getAllStorageAccounts
()
(
map
[
string
]
*
storageAccountState
,
error
)
{
ctx
,
cancel
:=
getContextWithCancel
(
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
60
*
time
.
Second
)
defer
cancel
()
defer
cancel
()
accountListResult
,
err
:=
c
.
common
.
cloud
.
StorageAccountClient
.
ListByResourceGroup
(
ctx
,
c
.
common
.
resourceGroup
)
accountListResult
,
err
:=
c
.
common
.
cloud
.
StorageAccountClient
.
ListByResourceGroup
(
ctx
,
c
.
common
.
resourceGroup
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/volume/azure_dd/azure_dd.go
View file @
63ee42e9
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"context"
"context"
"fmt"
"fmt"
"strings"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage"
...
@@ -160,7 +161,9 @@ func (plugin *azureDataDiskPlugin) GetVolumeLimits() (map[string]int64, error) {
...
@@ -160,7 +161,9 @@ func (plugin *azureDataDiskPlugin) GetVolumeLimits() (map[string]int64, error) {
}
}
if
vmSizeList
==
nil
{
if
vmSizeList
==
nil
{
result
,
err
:=
az
.
VirtualMachineSizesClient
.
List
(
context
.
TODO
(),
az
.
Location
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
60
*
time
.
Second
)
defer
cancel
()
result
,
err
:=
az
.
VirtualMachineSizesClient
.
List
(
ctx
,
az
.
Location
)
if
err
!=
nil
||
result
.
Value
==
nil
{
if
err
!=
nil
||
result
.
Value
==
nil
{
klog
.
Errorf
(
"failed to list vm sizes in GetVolumeLimits, plugin.host: %s, location: %s"
,
plugin
.
host
.
GetHostName
(),
az
.
Location
)
klog
.
Errorf
(
"failed to list vm sizes in GetVolumeLimits, plugin.host: %s, location: %s"
,
plugin
.
host
.
GetHostName
(),
az
.
Location
)
return
volumeLimits
,
nil
return
volumeLimits
,
nil
...
...
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