Skip to content

Commit

Permalink
Merge pull request #174 from yuyulei/remove-old-status
Browse files Browse the repository at this point in the history
Remove old cleanup status before create new pv
  • Loading branch information
k8s-ci-robot authored Feb 19, 2020
2 parents 8571396 + 1d2faf1 commit 0fe6e99
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 0fe6e99

Please sign in to comment.