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
bb42103f
Commit
bb42103f
authored
Nov 09, 2017
by
andyzhangx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move InitStorageAccount into azure disk provision func
parent
11fc906c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
azure_blobDiskController.go
...cloudprovider/providers/azure/azure_blobDiskController.go
+2
-15
azure_dd.go
pkg/volume/azure_dd/azure_dd.go
+2
-0
azure_provision.go
pkg/volume/azure_dd/azure_provision.go
+3
-0
No files found.
pkg/cloudprovider/providers/azure/azure_blobDiskController.go
View file @
bb42103f
...
...
@@ -22,7 +22,6 @@ import (
"fmt"
"math"
"net/url"
"os"
"regexp"
"sync"
...
...
@@ -70,12 +69,6 @@ var accountsLock = &sync.Mutex{}
func
newBlobDiskController
(
common
*
controllerCommon
)
(
*
BlobDiskController
,
error
)
{
c
:=
BlobDiskController
{
common
:
common
}
err
:=
c
.
init
()
if
err
!=
nil
{
return
nil
,
err
}
return
&
c
,
nil
}
...
...
@@ -316,7 +309,7 @@ func (c *BlobDiskController) DeleteBlobDisk(diskURI string, wasForced bool) erro
// Init tries best effort to ensure that 2 accounts standard/premium were created
// to be used by shared blob disks. This to increase the speed pvc provisioning (in most of cases)
func
(
c
*
BlobDiskController
)
ini
t
()
error
{
func
(
c
*
BlobDiskController
)
InitStorageAccoun
t
()
error
{
if
!
c
.
shouldInit
()
{
return
nil
}
...
...
@@ -543,13 +536,7 @@ func (c *BlobDiskController) getDiskCount(SAName string) (int, error) {
// and we only do that in the controller
func
(
c
*
BlobDiskController
)
shouldInit
()
bool
{
if
os
.
Args
[
0
]
==
"kube-controller-manager"
||
(
os
.
Args
[
0
]
==
"/hyperkube"
&&
os
.
Args
[
1
]
==
"controller-manager"
)
{
swapped
:=
atomic
.
CompareAndSwapInt64
(
&
initFlag
,
0
,
1
)
if
swapped
{
return
true
}
}
return
false
return
atomic
.
CompareAndSwapInt64
(
&
initFlag
,
0
,
1
)
}
func
(
c
*
BlobDiskController
)
getAllStorageAccounts
()
(
map
[
string
]
*
storageAccountState
,
error
)
{
...
...
pkg/volume/azure_dd/azure_dd.go
View file @
bb42103f
...
...
@@ -28,6 +28,8 @@ import (
// interface exposed by the cloud provider implementing Disk functionlity
type
DiskController
interface
{
InitStorageAccount
()
error
CreateBlobDisk
(
dataDiskName
string
,
storageAccountType
storage
.
SkuName
,
sizeGB
int
,
forceStandAlone
bool
)
(
string
,
error
)
DeleteBlobDisk
(
diskUri
string
,
wasForced
bool
)
error
...
...
pkg/volume/azure_dd/azure_provision.go
View file @
bb42103f
...
...
@@ -168,6 +168,9 @@ func (p *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
}
}
}
else
{
if
err
=
diskController
.
InitStorageAccount
();
err
!=
nil
{
return
nil
,
err
}
diskURI
,
err
=
diskController
.
CreateBlobDisk
(
name
,
skuName
,
requestGB
,
forceStandAlone
)
if
err
!=
nil
{
return
nil
,
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