code: func mapVolumeSpec(config map[string]string, spec *volume.Spec) {
  
  	if source, err := getScaleIOPersistentVolumeSourceFromSpec(spec); err == nil {
  		config[confKey.gateway] = source.Gateway
  		config[confKey.system] = source.System
  		config[confKey.volumeName] = source.VolumeName
  		config[confKey.sslEnabled] = strconv.FormatBool(source.SSLEnabled)
  		config[confKey.protectionDomain] = source.ProtectionDomain
  		config[confKey.storagePool] = source.StoragePool
  		config[confKey.storageMode] = source.StorageMode
  		config[confKey.fsType] = source.FSType
  		config[confKey.readOnly] = strconv.FormatBool(source.ReadOnly)
  	}
  
  	if source, err := getScaleIOVolumeSourceFromSpec(spec); err == nil {
  		config[confKey.gateway] = source.Gateway
  		config[confKey.system] = source.System
  		config[confKey.volumeName] = source.VolumeName
  		config[confKey.sslEnabled] = strconv.FormatBool(source.SSLEnabled)
  		config[confKey.protectionDomain] = source.ProtectionDomain
  		config[confKey.storagePool] = source.StoragePool
  		config[confKey.storageMode] = source.StorageMode
  		config[confKey.fsType] = source.FSType
  		config[confKey.readOnly] = strconv.FormatBool(source.ReadOnly)
  	}
  
  	//optionals
  	applyConfigDefaults(config)
  }
docs: // mapVolumeSpec maps attributes from either ScaleIOVolumeSource  or ScaleIOPersistentVolumeSource to config