code: func getVolumeID(pv *v1.PersistentVolume, volumeName string) (string, error) {
  	volumeID := ""
  
  	// Get volID from pvspec if available, else fill it from volumename.
  	if pv != nil {
  		if pv.Annotations[heketiVolIDAnn] != "" {
  			volumeID = pv.Annotations[heketiVolIDAnn]
  		} else {
  			volumeID = dstrings.TrimPrefix(volumeName, volPrefix)
  		}
  	} else {
  		return volumeID, fmt.Errorf("provided PV spec is nil")
  	}
  	if volumeID == "" {
  		return volumeID, fmt.Errorf("volume ID is empty")
  	}
  	return volumeID, nil
  }
docs: // getVolumeID returns volumeID from the PV or volumename.