Skip to content

Commit

Permalink
Merge pull request #168 from arangodb/bugfix/pv-deleted-to-soon
Browse files Browse the repository at this point in the history
Prevent deleting the PV when the PVC has already been attached to it
  • Loading branch information
ewoutp authored Jun 8, 2018
2 parents d12ad72 + 60ed954 commit a373283
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/storage/pv_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func (ls *LocalStorage) bindClaimToVolume(claim v1.PersistentVolumeClaim, volume

// Check claim. If already bound, bail out
if !pvcNeedsVolume(*updated) {
if updated.Spec.VolumeName == volumeName {
log.Info().Msg("PersistentVolumeClaim already bound to PersistentVolume")
return nil
}
return maskAny(fmt.Errorf("PersistentVolumeClaim '%s' no longer needs a volume", claim.GetName()))
}

Expand Down

0 comments on commit a373283

Please sign in to comment.