File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ const (
117117 // StackAPIVersion is the API version profile to set for ARM clients. See:
118118 // https://learn.microsoft.com/en-us/azure-stack/user/azure-stack-profiles-azure-resource-manager-versions?view=azs-2408#overview-of-the-2020-09-01-hybrid-profile
119119 StackAPIVersionProfile = "2020-06-01"
120+
121+ // StackDiskAPIVersionProfile is the API Version to set for the disk client.
122+ // API Version Profile "2020-06-01" is not supported for disks.
123+ StackDiskAPIVersionProfile = "2018-06-01"
120124)
121125
122126var (
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package disks
1818
1919import (
2020 "context"
21+ "strings"
2122 "time"
2223
2324 "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
@@ -38,6 +39,9 @@ type azureClient struct {
3839// newClient creates a new disks client from an authorizer.
3940func newClient (auth azure.Authorizer , apiCallTimeout time.Duration ) (* azureClient , error ) {
4041 opts , err := azure .ARMClientOptions (auth .CloudEnvironment (), auth .BaseURI ())
42+ if strings .EqualFold (auth .CloudEnvironment (), azure .StackCloudName ) {
43+ opts .APIVersion = azure .StackDiskAPIVersionProfile
44+ }
4145 if err != nil {
4246 return nil , errors .Wrap (err , "failed to create disks client options" )
4347 }
You can’t perform that action at this time.
0 commit comments