mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
|
"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 {
|
func New(config *azclients.ClientConfig) *Client {
|
||||||
baseURI := config.ResourceManagerEndpoint
|
baseURI := config.ResourceManagerEndpoint
|
||||||
authorizer := config.Authorizer
|
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)
|
rateLimiterReader, rateLimiterWriter := azclients.NewRateLimiter(config.RateLimitConfig)
|
||||||
|
|
||||||
klog.V(2).Infof("Azure DisksClient (read ops) using rate limit config: QPS=%g, bucket=%d",
|
klog.V(2).Infof("Azure DisksClient (read ops) using rate limit config: QPS=%g, bucket=%d",
|
||||||
|
@ -28,6 +28,10 @@ import (
|
|||||||
const (
|
const (
|
||||||
// APIVersion is the API version for compute.
|
// APIVersion is the API version for compute.
|
||||||
APIVersion = "2019-11-01"
|
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.
|
// Interface is the client interface for Disks.
|
||||||
|
Loading…
Reference in New Issue
Block a user