mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #96829 from songjiaxun/azuredisk_api_version
fix: change disk client API version for Azure Stack
This commit is contained in:
commit
c1f36fa6f2
@ -22,6 +22,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
|
||||
@ -57,7 +58,11 @@ type Client struct {
|
||||
func New(config *azclients.ClientConfig) *Client {
|
||||
baseURI := config.ResourceManagerEndpoint
|
||||
authorizer := config.Authorizer
|
||||
armClient := armclient.New(authorizer, baseURI, config.UserAgent, APIVersion, config.Location, config.Backoff)
|
||||
apiVersion := APIVersion
|
||||
if strings.EqualFold(config.CloudName, AzureStackCloudName) {
|
||||
apiVersion = AzureStackCloudAPIVersion
|
||||
}
|
||||
armClient := armclient.New(authorizer, baseURI, config.UserAgent, apiVersion, config.Location, config.Backoff)
|
||||
rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig)
|
||||
|
||||
klog.V(2).Infof("Azure DisksClient (read ops) using rate limit config: QPS=%g, bucket=%d",
|
||||
|
@ -28,6 +28,10 @@ import (
|
||||
const (
|
||||
// APIVersion is the API version for compute.
|
||||
APIVersion = "2019-11-01"
|
||||
// AzureStackCloudAPIVersion is the API version for Azure Stack
|
||||
AzureStackCloudAPIVersion = "2019-07-01"
|
||||
// AzureStackCloudName is the cloud name of Azure Stack
|
||||
AzureStackCloudName = "AZURESTACKCLOUD"
|
||||
)
|
||||
|
||||
// Interface is the client interface for Disks.
|
||||
|
Loading…
Reference in New Issue
Block a user