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
14ad73ea
Commit
14ad73ea
authored
Dec 04, 2018
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make GetStorageAccesskey public as a lib
parent
8f7405ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
azure_blobDiskController.go
...cloudprovider/providers/azure/azure_blobDiskController.go
+1
-1
azure_storageaccount.go
pkg/cloudprovider/providers/azure/azure_storageaccount.go
+3
-3
azure_storageaccount_test.go
...loudprovider/providers/azure/azure_storageaccount_test.go
+1
-1
No files found.
pkg/cloudprovider/providers/azure/azure_blobDiskController.go
View file @
14ad73ea
...
@@ -108,7 +108,7 @@ func (c *BlobDiskController) DeleteVolume(diskURI string) error {
...
@@ -108,7 +108,7 @@ func (c *BlobDiskController) DeleteVolume(diskURI string) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to parse vhd URI %v"
,
err
)
return
fmt
.
Errorf
(
"failed to parse vhd URI %v"
,
err
)
}
}
key
,
err
:=
c
.
common
.
cloud
.
g
etStorageAccesskey
(
accountName
,
c
.
common
.
resourceGroup
)
key
,
err
:=
c
.
common
.
cloud
.
G
etStorageAccesskey
(
accountName
,
c
.
common
.
resourceGroup
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"no key for storage account %s, err %v"
,
accountName
,
err
)
return
fmt
.
Errorf
(
"no key for storage account %s, err %v"
,
accountName
,
err
)
}
}
...
...
pkg/cloudprovider/providers/azure/azure_storageaccount.go
View file @
14ad73ea
...
@@ -64,8 +64,8 @@ func (az *Cloud) getStorageAccounts(matchingAccountType, matchingAccountKind, re
...
@@ -64,8 +64,8 @@ func (az *Cloud) getStorageAccounts(matchingAccountType, matchingAccountKind, re
return
accounts
,
nil
return
accounts
,
nil
}
}
//
g
etStorageAccesskey gets the storage account access key
//
G
etStorageAccesskey gets the storage account access key
func
(
az
*
Cloud
)
g
etStorageAccesskey
(
account
,
resourceGroup
string
)
(
string
,
error
)
{
func
(
az
*
Cloud
)
G
etStorageAccesskey
(
account
,
resourceGroup
string
)
(
string
,
error
)
{
ctx
,
cancel
:=
getContextWithCancel
()
ctx
,
cancel
:=
getContextWithCancel
()
defer
cancel
()
defer
cancel
()
...
@@ -137,7 +137,7 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, accountKind, res
...
@@ -137,7 +137,7 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, accountKind, res
}
}
// find the access key with this account
// find the access key with this account
accountKey
,
err
:=
az
.
g
etStorageAccesskey
(
accountName
,
resourceGroup
)
accountKey
,
err
:=
az
.
G
etStorageAccesskey
(
accountName
,
resourceGroup
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
""
,
fmt
.
Errorf
(
"could not get storage key for storage account %s: %v"
,
accountName
,
err
)
return
""
,
""
,
fmt
.
Errorf
(
"could not get storage key for storage account %s: %v"
,
accountName
,
err
)
}
}
...
...
pkg/cloudprovider/providers/azure/azure_storageaccount_test.go
View file @
14ad73ea
...
@@ -64,7 +64,7 @@ func TestGetStorageAccessKeys(t *testing.T) {
...
@@ -64,7 +64,7 @@ func TestGetStorageAccessKeys(t *testing.T) {
expectedKey
:=
test
.
expectedKey
expectedKey
:=
test
.
expectedKey
fake
.
Keys
=
test
.
results
fake
.
Keys
=
test
.
results
fake
.
Err
=
test
.
err
fake
.
Err
=
test
.
err
key
,
err
:=
cloud
.
g
etStorageAccesskey
(
"acct"
,
"rg"
)
key
,
err
:=
cloud
.
G
etStorageAccesskey
(
"acct"
,
"rg"
)
if
test
.
expectErr
&&
err
==
nil
{
if
test
.
expectErr
&&
err
==
nil
{
t
.
Errorf
(
"Unexpected non-error"
)
t
.
Errorf
(
"Unexpected non-error"
)
continue
continue
...
...
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