@@ -107,7 +107,7 @@ const (
107
107
betaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
108
108
)
109
109
110
- //GetVolumeConfig creates a new VolumeConfig struct by
110
+ // GetVolumeConfig creates a new VolumeConfig struct by
111
111
// parsing and merging the configuration provided in the PVC
112
112
// annotation - cas.openebs.io/config with the
113
113
// default configuration of the provisioner.
@@ -177,7 +177,7 @@ func (p *Provisioner) GetVolumeConfig(pvName string, pvc *v1.PersistentVolumeCla
177
177
return c , nil
178
178
}
179
179
180
- //GetNFSServerTypeFromConfig returns the NFSServerType value configured
180
+ // GetNFSServerTypeFromConfig returns the NFSServerType value configured
181
181
// in StorageClass. Default is kernel
182
182
func (c * VolumeConfig ) GetNFSServerTypeFromConfig () string {
183
183
serverType := c .getValue (KeyPVNFSServerType )
@@ -187,7 +187,7 @@ func (c *VolumeConfig) GetNFSServerTypeFromConfig() string {
187
187
return serverType
188
188
}
189
189
190
- //GetBackendStorageClassFromConfig returns the Storage Class
190
+ // GetBackendStorageClassFromConfig returns the Storage Class
191
191
// value configured in StorageClass. Default is ""
192
192
func (c * VolumeConfig ) GetBackendStorageClassFromConfig () string {
193
193
backingSC := c .getValue (KeyPVBackendStorageClass )
@@ -241,14 +241,16 @@ func (c *VolumeConfig) GetNFServerGraceTime() (int, error) {
241
241
// StorageClass if specified
242
242
// -----------------------------------------------------
243
243
// NOTE: This feature has been deprecated
244
- // Alternative: Use FilePermission 'cas.openebs.io/config' annotation
245
- // key on the backend volume PVC. Sample FilePermissions
246
- // for FSGID-like configuration --
247
244
//
248
- // name: FilePermissions
249
- // data:
250
- // GID: <group-ID>
251
- // mode: "g+s"
245
+ // Alternative: Use FilePermission 'cas.openebs.io/config' annotation
246
+ // key on the backend volume PVC. Sample FilePermissions
247
+ // for FSGID-like configuration --
248
+ //
249
+ // name: FilePermissions
250
+ // data:
251
+ // GID: <group-ID>
252
+ // mode: "g+s"
253
+ //
252
254
// -----------------------------------------------------
253
255
func (c * VolumeConfig ) GetFSGroupID () (* int64 , error ) {
254
256
fsGroupIDStr := c .getValue (FSGroupID )
@@ -371,18 +373,21 @@ func (c *VolumeConfig) getResourceList(key string) (v1.ResourceList, error) {
371
373
return resourceList , nil
372
374
}
373
375
374
- //getValue is a utility function to extract the value
376
+ // getValue is a utility function to extract the value
375
377
// of the `key` from the ConfigMap object - which is
376
378
// map[string]interface{map[string][string]}
377
379
// Example:
378
- // {
379
- // key1: {
380
- // value: value1
381
- // enabled: true
382
- // }
383
- // }
380
+ //
381
+ // {
382
+ // key1: {
383
+ // value: value1
384
+ // enabled: true
385
+ // }
386
+ // }
387
+ //
384
388
// In the above example, if `key1` is passed as input,
385
- // `value1` will be returned.
389
+ //
390
+ // `value1` will be returned.
386
391
func (c * VolumeConfig ) getValue (key string ) string {
387
392
if configObj , ok := util .GetNestedField (c .options , key ).(map [string ]string ); ok {
388
393
if val , p := configObj [string (mconfig .ValuePTP )]; p {
@@ -392,20 +397,23 @@ func (c *VolumeConfig) getValue(key string) string {
392
397
return ""
393
398
}
394
399
395
- //getData is a utility function to extract the value
400
+ // getData is a utility function to extract the value
396
401
// of the `key` from the ConfigMap object - which is
397
402
// map[string]interface{map[string]interface{map[string]string}}
398
403
// Example:
399
- // {
400
- // key1: {
401
- // value: value1
402
- // data: {
403
- // dataKey1: dataValue1
404
- // }
405
- // }
406
- // }
404
+ //
405
+ // {
406
+ // key1: {
407
+ // value: value1
408
+ // data: {
409
+ // dataKey1: dataValue1
410
+ // }
411
+ // }
412
+ // }
413
+ //
407
414
// In the above example, if `key1` and `dataKey1` are passed as input,
408
- // `dataValue1` will be returned.
415
+ //
416
+ // `dataValue1` will be returned.
409
417
func (c * VolumeConfig ) getData (key string , dataKey string ) string {
410
418
if configData , ok := util .GetNestedField (c .configData , key ).(map [string ]string ); ok {
411
419
if val , p := configData [dataKey ]; p {
@@ -449,11 +457,11 @@ func hookConfigFileExist() (bool, error) {
449
457
450
458
// initializeHook read the hook config file and update the given hook variable
451
459
// return value:
452
- // - nil
453
- // - If hook config file doesn't exists
454
- // - If hook config file is parsed and given hook variable is updated
455
- // - error
456
- // - If hook config is invalid
460
+ // - nil
461
+ // - If hook config file doesn't exists
462
+ // - If hook config file is parsed and given hook variable is updated
463
+ // - error
464
+ // - If hook config is invalid
457
465
func initializeHook (hook * * nfshook.Hook ) error {
458
466
hookFileExists , err := hookConfigFileExist ()
459
467
if err != nil {
0 commit comments