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
2de487c9
Unverified
Commit
2de487c9
authored
Feb 17, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74182 from andyzhangx/azuredisk-snapshot-client
add azure disk snapshot client in azure cloud provider
parents
07a5488b
3b37dc56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
azure.go
pkg/cloudprovider/providers/azure/azure.go
+3
-0
azure_client.go
pkg/cloudprovider/providers/azure/azure_client.go
+12
-0
No files found.
pkg/cloudprovider/providers/azure/azure.go
View file @
2de487c9
...
@@ -38,6 +38,7 @@ import (
...
@@ -38,6 +38,7 @@ import (
cloudprovider
"k8s.io/cloud-provider"
cloudprovider
"k8s.io/cloud-provider"
"k8s.io/kubernetes/pkg/cloudprovider/providers/azure/auth"
"k8s.io/kubernetes/pkg/cloudprovider/providers/azure/auth"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/azure"
"k8s.io/klog"
"k8s.io/klog"
...
@@ -170,6 +171,7 @@ type Cloud struct {
...
@@ -170,6 +171,7 @@ type Cloud struct {
VirtualMachinesClient
VirtualMachinesClient
VirtualMachinesClient
VirtualMachinesClient
StorageAccountClient
StorageAccountClient
StorageAccountClient
StorageAccountClient
DisksClient
DisksClient
DisksClient
DisksClient
SnapshotsClient
*
compute
.
SnapshotsClient
FileClient
FileClient
FileClient
FileClient
resourceRequestBackoff
wait
.
Backoff
resourceRequestBackoff
wait
.
Backoff
metadata
*
InstanceMetadataService
metadata
*
InstanceMetadataService
...
@@ -344,6 +346,7 @@ func NewCloud(configReader io.Reader) (cloudprovider.Interface, error) {
...
@@ -344,6 +346,7 @@ func NewCloud(configReader io.Reader) (cloudprovider.Interface, error) {
resourceRequestBackoff
:
resourceRequestBackoff
,
resourceRequestBackoff
:
resourceRequestBackoff
,
DisksClient
:
newAzDisksClient
(
azClientConfig
),
DisksClient
:
newAzDisksClient
(
azClientConfig
),
SnapshotsClient
:
newSnapshotsClient
(
azClientConfig
),
RoutesClient
:
newAzRoutesClient
(
azClientConfig
),
RoutesClient
:
newAzRoutesClient
(
azClientConfig
),
SubnetsClient
:
newAzSubnetsClient
(
azClientConfig
),
SubnetsClient
:
newAzSubnetsClient
(
azClientConfig
),
InterfacesClient
:
newAzInterfacesClient
(
azClientConfig
),
InterfacesClient
:
newAzInterfacesClient
(
azClientConfig
),
...
...
pkg/cloudprovider/providers/azure/azure_client.go
View file @
2de487c9
...
@@ -1385,6 +1385,18 @@ func (az *azDisksClient) Get(ctx context.Context, resourceGroupName string, disk
...
@@ -1385,6 +1385,18 @@ func (az *azDisksClient) Get(ctx context.Context, resourceGroupName string, disk
return
return
}
}
func
newSnapshotsClient
(
config
*
azClientConfig
)
*
compute
.
SnapshotsClient
{
snapshotsClient
:=
compute
.
NewSnapshotsClientWithBaseURI
(
config
.
resourceManagerEndpoint
,
config
.
subscriptionID
)
snapshotsClient
.
Authorizer
=
autorest
.
NewBearerAuthorizer
(
config
.
servicePrincipalToken
)
snapshotsClient
.
PollingDelay
=
5
*
time
.
Second
if
config
.
ShouldOmitCloudProviderBackoff
{
snapshotsClient
.
RetryAttempts
=
config
.
CloudProviderBackoffRetries
snapshotsClient
.
RetryDuration
=
time
.
Duration
(
config
.
CloudProviderBackoffDuration
)
*
time
.
Second
}
configureUserAgent
(
&
snapshotsClient
.
Client
)
return
&
snapshotsClient
}
// azVirtualMachineSizesClient implements VirtualMachineSizesClient.
// azVirtualMachineSizesClient implements VirtualMachineSizesClient.
type
azVirtualMachineSizesClient
struct
{
type
azVirtualMachineSizesClient
struct
{
client
compute
.
VirtualMachineSizesClient
client
compute
.
VirtualMachineSizesClient
...
...
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