Merge pull request #58626 from humblec/correct-ann

Automatic merge from submit-queue (batch tested with PRs 58626, 58791). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use correct pv annotation to fetch volume ID.

Fix , Issue #58627
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
pull/6/head
Kubernetes Submit Queue 2018-01-25 14:06:34 -08:00 committed by GitHub
commit 48c5e90d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1085,8 +1085,8 @@ func getVolumeID(pv *v1.PersistentVolume, volumeName string) (string, error) {
// Get volID from pvspec if available, else fill it from volumename.
if pv != nil {
if pv.Annotations["VolID"] != "" {
volumeID = pv.Annotations["VolID"]
if pv.Annotations[heketiVolIDAnn] != "" {
volumeID = pv.Annotations[heketiVolIDAnn]
} else {
volumeID = dstrings.TrimPrefix(volumeName, volPrefix)
}