@@ -153,22 +153,15 @@ var (
153
153
type DriverOptions struct {
154
154
NodeID string
155
155
DriverName string
156
- CloudConfigSecretName string
157
- CloudConfigSecretNamespace string
158
- CustomUserAgent string
159
- UserAgentSuffix string
160
156
BlobfuseProxyEndpoint string
161
157
EnableBlobfuseProxy bool
162
158
BlobfuseProxyConnTimout int
163
159
EnableBlobMockMount bool
164
- AllowEmptyCloudConfig bool
165
160
AllowInlineVolumeKeyAccessWithIdentity bool
166
161
EnableGetVolumeStats bool
167
162
AppendTimeStampInCacheDir bool
168
163
AppendMountErrorHelpLink bool
169
164
MountPermissions uint64
170
- KubeAPIQPS float64
171
- KubeAPIBurst int
172
165
EnableAznfsMount bool
173
166
VolStatsCacheExpireInMinutes int
174
167
SasTokenExpirationMinutes int
@@ -178,24 +171,17 @@ type DriverOptions struct {
178
171
type Driver struct {
179
172
csicommon.CSIDriver
180
173
181
- cloud * azure.Cloud
182
- cloudConfigSecretName string
183
- cloudConfigSecretNamespace string
184
- customUserAgent string
185
- userAgentSuffix string
186
- blobfuseProxyEndpoint string
174
+ cloud * azure.Cloud
175
+ blobfuseProxyEndpoint string
187
176
// enableBlobMockMount is only for testing, DO NOT set as true in non-testing scenario
188
177
enableBlobMockMount bool
189
178
enableBlobfuseProxy bool
190
- allowEmptyCloudConfig bool
191
179
enableGetVolumeStats bool
192
180
allowInlineVolumeKeyAccessWithIdentity bool
193
181
appendTimeStampInCacheDir bool
194
182
appendMountErrorHelpLink bool
195
183
blobfuseProxyConnTimout int
196
184
mountPermissions uint64
197
- kubeAPIQPS float64
198
- kubeAPIBurst int
199
185
enableAznfsMount bool
200
186
mounter * mount.SafeFormatAndMount
201
187
volLockMap * util.LockMap
@@ -220,26 +206,19 @@ type Driver struct {
220
206
221
207
// NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version &
222
208
// does not support optional driver plugin info manifest field. Refer to CSI spec for more details.
223
- func NewDriver (options * DriverOptions ) * Driver {
209
+ func NewDriver (options * DriverOptions , cloud * azure. Cloud ) * Driver {
224
210
d := Driver {
225
211
volLockMap : util .NewLockMap (),
226
212
subnetLockMap : util .NewLockMap (),
227
213
volumeLocks : newVolumeLocks (),
228
- cloudConfigSecretName : options .CloudConfigSecretName ,
229
- cloudConfigSecretNamespace : options .CloudConfigSecretNamespace ,
230
- customUserAgent : options .CustomUserAgent ,
231
- userAgentSuffix : options .UserAgentSuffix ,
232
214
blobfuseProxyEndpoint : options .BlobfuseProxyEndpoint ,
233
215
enableBlobfuseProxy : options .EnableBlobfuseProxy ,
234
216
allowInlineVolumeKeyAccessWithIdentity : options .AllowInlineVolumeKeyAccessWithIdentity ,
235
217
blobfuseProxyConnTimout : options .BlobfuseProxyConnTimout ,
236
218
enableBlobMockMount : options .EnableBlobMockMount ,
237
- allowEmptyCloudConfig : options .AllowEmptyCloudConfig ,
238
219
enableGetVolumeStats : options .EnableGetVolumeStats ,
239
220
appendMountErrorHelpLink : options .AppendMountErrorHelpLink ,
240
221
mountPermissions : options .MountPermissions ,
241
- kubeAPIQPS : options .KubeAPIQPS ,
242
- kubeAPIBurst : options .KubeAPIBurst ,
243
222
enableAznfsMount : options .EnableAznfsMount ,
244
223
sasTokenExpirationMinutes : options .SasTokenExpirationMinutes ,
245
224
azcopy : & util.Azcopy {},
@@ -263,25 +242,7 @@ func NewDriver(options *DriverOptions) *Driver {
263
242
if d .volStatsCache , err = azcache .NewTimedCache (time .Duration (options .VolStatsCacheExpireInMinutes )* time .Minute , getter , false ); err != nil {
264
243
klog .Fatalf ("%v" , err )
265
244
}
266
- return & d
267
- }
268
-
269
- // Run driver initialization
270
- func (d * Driver ) Run (endpoint , kubeconfig string , testBool bool ) {
271
- versionMeta , err := GetVersionYAML (d .Name )
272
- if err != nil {
273
- klog .Fatalf ("%v" , err )
274
- }
275
- klog .Infof ("\n DRIVER INFORMATION:\n -------------------\n %s\n \n Streaming logs below:" , versionMeta )
276
-
277
- userAgent := GetUserAgent (d .Name , d .customUserAgent , d .userAgentSuffix )
278
- klog .V (2 ).Infof ("driver userAgent: %s" , userAgent )
279
- d .cloud , err = getCloudProvider (kubeconfig , d .NodeID , d .cloudConfigSecretName , d .cloudConfigSecretNamespace , userAgent , d .allowEmptyCloudConfig , d .kubeAPIQPS , d .kubeAPIBurst )
280
- if err != nil {
281
- klog .Fatalf ("failed to get Azure Cloud Provider, error: %v" , err )
282
- }
283
- klog .V (2 ).Infof ("cloud: %s, location: %s, rg: %s, VnetName: %s, VnetResourceGroup: %s, SubnetName: %s" , d .cloud .Cloud , d .cloud .Location , d .cloud .ResourceGroup , d .cloud .VnetName , d .cloud .VnetResourceGroup , d .cloud .SubnetName )
284
-
245
+ d .cloud = cloud
285
246
d .mounter = & mount.SafeFormatAndMount {
286
247
Interface : mount .New ("" ),
287
248
Exec : utilexec .New (),
@@ -316,6 +277,17 @@ func (d *Driver) Run(endpoint, kubeconfig string, testBool bool) {
316
277
}
317
278
d .AddNodeServiceCapabilities (nodeCap )
318
279
280
+ return & d
281
+ }
282
+
283
+ // Run driver initialization
284
+ func (d * Driver ) Run (endpoint string , testBool bool ) {
285
+ versionMeta , err := GetVersionYAML (d .Name )
286
+ if err != nil {
287
+ klog .Fatalf ("%v" , err )
288
+ }
289
+ klog .Infof ("\n DRIVER INFORMATION:\n -------------------\n %s\n \n Streaming logs below:" , versionMeta )
290
+
319
291
s := csicommon .NewNonBlockingGRPCServer ()
320
292
// Driver d act as IdentityServer, ControllerServer and NodeServer
321
293
s .Start (endpoint , d , d , d , testBool )
0 commit comments