ScaleIO Volume Plugin - volume attribute updates

This commit introduces the following updates and fixes:
- Enable scaleIO volume multip-mapping based on accessMode
- No longer uses "default" as default values for storagepool & protection domain
- validates capacity when capacity is zero
- Better naming for PV and volume
- make mount ro when accessModes contains ROM
This commit is contained in:
Vladimir Vivien
2017-06-26 12:27:31 -04:00
parent 11f8047735
commit fda99bd78e
9 changed files with 202 additions and 58 deletions

View File

@@ -68,11 +68,13 @@ var (
nsSep = "%"
sdcRootPath = "/opt/emc/scaleio/sdc/bin"
secretNotFoundErr = errors.New("secret not found")
configMapNotFoundErr = errors.New("configMap not found")
gatewayNotProvidedErr = errors.New("gateway not provided")
secretRefNotProvidedErr = errors.New("secret ref not provided")
systemNotProvidedErr = errors.New("secret not provided")
secretNotFoundErr = errors.New("secret not found")
configMapNotFoundErr = errors.New("configMap not found")
gatewayNotProvidedErr = errors.New("ScaleIO gateway not provided")
secretRefNotProvidedErr = errors.New("secret ref not provided")
systemNotProvidedErr = errors.New("ScaleIO system not provided")
storagePoolNotProvidedErr = errors.New("ScaleIO storage pool not provided")
protectionDomainNotProvidedErr = errors.New("ScaleIO protection domain not provided")
)
// mapScaleIOVolumeSource maps attributes from a ScaleIOVolumeSource to config
@@ -107,6 +109,12 @@ func validateConfigs(config map[string]string) error {
if config[confKey.system] == "" {
return systemNotProvidedErr
}
if config[confKey.storagePool] == "" {
return storagePoolNotProvidedErr
}
if config[confKey.protectionDomain] == "" {
return protectionDomainNotProvidedErr
}
return nil
}
@@ -119,8 +127,6 @@ func applyConfigDefaults(config map[string]string) {
b = false
}
config[confKey.sslEnabled] = strconv.FormatBool(b)
config[confKey.protectionDomain] = defaultString(config[confKey.protectionDomain], "default")
config[confKey.storagePool] = defaultString(config[confKey.storagePool], "default")
config[confKey.storageMode] = defaultString(config[confKey.storageMode], "ThinProvisioned")
config[confKey.fsType] = defaultString(config[confKey.fsType], "xfs")
b, err = strconv.ParseBool(config[confKey.readOnly])