Skip to content

Commit

Permalink
Remove old cleanup status before create new pv
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyulei committed Feb 18, 2020
1 parent 8571396 commit 1d2faf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ func (d *Discoverer) discoverVolumesAtPath(class string, config common.MountConf
continue
}

// remove old cleanup status
_, _, err = d.CleanupTracker.RemoveStatus(pvName, usejob)
if err != nil {
klog.Errorf("expected status exists and fail to remove cleanup status for pv %s", pvName)
continue
}

mountOptions, err := d.getMountOptionsFromStorageClass(class)
if err != nil {
discoErrors = append(discoErrors, fmt.Errorf("failed to get mount options from storage class %s: %v", class, err))
Expand Down

0 comments on commit 1d2faf1

Please sign in to comment.