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
38f09085
Commit
38f09085
authored
Mar 03, 2019
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make funcs in azure cloud provider as public
parent
79ce30cc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
azure_blobDiskController.go
...cloudprovider/providers/azure/azure_blobDiskController.go
+1
-1
azure_managedDiskController.go
...udprovider/providers/azure/azure_managedDiskController.go
+3
-3
azure_storage.go
pkg/cloudprovider/providers/azure/azure_storage.go
+1
-1
azure_storageaccount.go
pkg/cloudprovider/providers/azure/azure_storageaccount.go
+2
-2
No files found.
pkg/cloudprovider/providers/azure/azure_blobDiskController.go
View file @
38f09085
...
...
@@ -82,7 +82,7 @@ func (c *BlobDiskController) initStorageAccounts() {
// If no storage account is given, search all the storage accounts associated with the resource group and pick one that
// fits storage type and location.
func
(
c
*
BlobDiskController
)
CreateVolume
(
blobName
,
accountName
,
accountType
,
location
string
,
requestGB
int
)
(
string
,
string
,
int
,
error
)
{
account
,
key
,
err
:=
c
.
common
.
cloud
.
e
nsureStorageAccount
(
accountName
,
accountType
,
string
(
defaultStorageAccountKind
),
c
.
common
.
resourceGroup
,
location
,
dedicatedDiskAccountNamePrefix
)
account
,
key
,
err
:=
c
.
common
.
cloud
.
E
nsureStorageAccount
(
accountName
,
accountType
,
string
(
defaultStorageAccountKind
),
c
.
common
.
resourceGroup
,
location
,
dedicatedDiskAccountNamePrefix
)
if
err
!=
nil
{
return
""
,
""
,
0
,
fmt
.
Errorf
(
"could not get storage key for storage account %s: %v"
,
accountName
,
err
)
}
...
...
pkg/cloudprovider/providers/azure/azure_managedDiskController.go
View file @
38f09085
...
...
@@ -151,7 +151,7 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) (
diskID
:=
""
err
=
kwait
.
ExponentialBackoff
(
defaultBackOff
,
func
()
(
bool
,
error
)
{
provisionState
,
id
,
err
:=
c
.
g
etDisk
(
options
.
ResourceGroup
,
options
.
DiskName
)
provisionState
,
id
,
err
:=
c
.
G
etDisk
(
options
.
ResourceGroup
,
options
.
DiskName
)
diskID
=
id
// We are waiting for provisioningState==Succeeded
// We don't want to hand-off managed disks to k8s while they are
...
...
@@ -197,8 +197,8 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error {
return
nil
}
// return: disk provisionState, diskID, error
func
(
c
*
ManagedDiskController
)
g
etDisk
(
resourceGroup
,
diskName
string
)
(
string
,
string
,
error
)
{
//
GetDisk
return: disk provisionState, diskID, error
func
(
c
*
ManagedDiskController
)
G
etDisk
(
resourceGroup
,
diskName
string
)
(
string
,
string
,
error
)
{
ctx
,
cancel
:=
getContextWithCancel
()
defer
cancel
()
...
...
pkg/cloudprovider/providers/azure/azure_storage.go
View file @
38f09085
...
...
@@ -38,7 +38,7 @@ func (az *Cloud) CreateFileShare(shareName, accountName, accountType, accountKin
resourceGroup
=
az
.
resourceGroup
}
account
,
key
,
err
:=
az
.
e
nsureStorageAccount
(
accountName
,
accountType
,
accountKind
,
resourceGroup
,
location
,
fileShareAccountNamePrefix
)
account
,
key
,
err
:=
az
.
E
nsureStorageAccount
(
accountName
,
accountType
,
accountKind
,
resourceGroup
,
location
,
fileShareAccountNamePrefix
)
if
err
!=
nil
{
return
""
,
""
,
fmt
.
Errorf
(
"could not get storage key for storage account %s: %v"
,
accountName
,
err
)
}
...
...
pkg/cloudprovider/providers/azure/azure_storageaccount.go
View file @
38f09085
...
...
@@ -89,8 +89,8 @@ func (az *Cloud) GetStorageAccesskey(account, resourceGroup string) (string, err
return
""
,
fmt
.
Errorf
(
"no valid keys"
)
}
//
e
nsureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
func
(
az
*
Cloud
)
e
nsureStorageAccount
(
accountName
,
accountType
,
accountKind
,
resourceGroup
,
location
,
genAccountNamePrefix
string
)
(
string
,
string
,
error
)
{
//
E
nsureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
func
(
az
*
Cloud
)
E
nsureStorageAccount
(
accountName
,
accountType
,
accountKind
,
resourceGroup
,
location
,
genAccountNamePrefix
string
)
(
string
,
string
,
error
)
{
if
len
(
accountName
)
==
0
{
// find a storage account that matches accountType
accounts
,
err
:=
az
.
getStorageAccounts
(
accountType
,
accountKind
,
resourceGroup
,
location
)
...
...
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