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 @@ -116,6 +116,10 @@ const (
116116	// StackAPIVersionProfile is the API version profile to set for ARM clients. See: 
117117	// 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 
118118	StackAPIVersionProfile  =  "2020-06-01" 
119+ 
120+ 	// StackDiskAPIVersionProfile is the API Version to set for the disk client. 
121+ 	// API Version Profile "2020-06-01" is not supported for disks. 
122+ 	StackDiskAPIVersionProfile  =  "2018-06-01" 
119123)
120124
121125var  (
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 ())
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