Skip to content

Commit a373283

Browse files
authored
Merge pull request #168 from arangodb/bugfix/pv-deleted-to-soon
Prevent deleting the PV when the PVC has already been attached to it
2 parents d12ad72 + 60ed954 commit a373283

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/storage/pv_creator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ func (ls *LocalStorage) bindClaimToVolume(claim v1.PersistentVolumeClaim, volume
315315

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

0 commit comments

Comments
 (0)