@@ -32,6 +32,7 @@ import (
32
32
"k8s.io/klog/v2"
33
33
"k8s.io/mount-utils"
34
34
35
+ azureconsts "sigs.k8s.io/azuredisk-csi-driver/pkg/azureconstants"
35
36
"sigs.k8s.io/azuredisk-csi-driver/pkg/azureutils"
36
37
csicommon "sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common"
37
38
"sigs.k8s.io/azuredisk-csi-driver/pkg/mounter"
@@ -40,6 +41,7 @@ import (
40
41
azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache"
41
42
consts "sigs.k8s.io/cloud-provider-azure/pkg/consts"
42
43
"sigs.k8s.io/cloud-provider-azure/pkg/provider"
44
+ azure "sigs.k8s.io/cloud-provider-azure/pkg/provider"
43
45
)
44
46
45
47
// DriverOptions defines driver parameters specified in driver deployment
@@ -71,7 +73,7 @@ type DriverCore struct {
71
73
cloudConfigSecretNamespace string
72
74
customUserAgent string
73
75
userAgentSuffix string
74
- cloud * provider .Cloud
76
+ cloud * azure .Cloud
75
77
mounter * mount.SafeFormatAndMount
76
78
deviceHelper * optimization.SafeDeviceHelper
77
79
nodeInfo * optimization.NodeInfo
@@ -184,9 +186,9 @@ func (d *Driver) Run(endpoint, kubeconfig string, disableAVSetNodes, testingMock
184
186
}
185
187
186
188
func (d * Driver ) isGetDiskThrottled () bool {
187
- cache , err := d .getDiskThrottlingCache .Get (azureutils .ThrottlingKey , azcache .CacheReadTypeDefault )
189
+ cache , err := d .getDiskThrottlingCache .Get (azureconsts .ThrottlingKey , azcache .CacheReadTypeDefault )
188
190
if err != nil {
189
- klog .Warningf ("getDiskThrottlingCache(%s) return with error: %s" , azureutils .ThrottlingKey , err )
191
+ klog .Warningf ("getDiskThrottlingCache(%s) return with error: %s" , azureconsts .ThrottlingKey , err )
190
192
return false
191
193
}
192
194
return cache != nil
@@ -210,9 +212,9 @@ func (d *Driver) checkDiskExists(ctx context.Context, diskURI string) (*compute.
210
212
211
213
disk , rerr := d .cloud .DisksClient .Get (ctx , resourceGroup , diskName )
212
214
if rerr != nil {
213
- if strings .Contains (rerr .RawError .Error (), azureutils .RateLimited ) {
215
+ if strings .Contains (rerr .RawError .Error (), azureconsts .RateLimited ) {
214
216
klog .Warningf ("checkDiskExists(%s) is throttled with error: %v" , diskURI , rerr .Error ())
215
- d .getDiskThrottlingCache .Set (azureutils .ThrottlingKey , "" )
217
+ d .getDiskThrottlingCache .Set (azureconsts .ThrottlingKey , "" )
216
218
return nil , nil
217
219
}
218
220
return nil , rerr .Error ()
@@ -235,9 +237,9 @@ func (d *Driver) checkDiskCapacity(ctx context.Context, resourceGroup, diskName
235
237
return false , status .Errorf (codes .AlreadyExists , "the request volume already exists, but its capacity(%v) is different from (%v)" , * disk .DiskProperties .DiskSizeGB , requestGiB )
236
238
}
237
239
} else {
238
- if strings .Contains (rerr .RawError .Error (), azureutils .RateLimited ) {
240
+ if strings .Contains (rerr .RawError .Error (), azureconsts .RateLimited ) {
239
241
klog .Warningf ("checkDiskCapacity(%s, %s) is throttled with error: %v" , resourceGroup , diskName , rerr .Error ())
240
- d .getDiskThrottlingCache .Set (azureutils .ThrottlingKey , "" )
242
+ d .getDiskThrottlingCache .Set (azureconsts .ThrottlingKey , "" )
241
243
}
242
244
}
243
245
return true , nil
0 commit comments