mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Automatic merge from submit-queue (batch tested with PRs 41597, 42185, 42075, 42178, 41705) force rbd image unlock if the image is not used **What this PR does / why we need it**: Ceph RBD image could be locked if the host that holds the lock is down. In such case, the image cannot be used by other Pods. The fix is to detect the orphaned locks and force unlock. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #31790 **Special notes for your reviewer**: Note, previously, RBD volume plugin maps the image, mount it, and create a lock on the image. Since the proposed fix uses `rbd status` output to determine if the image is being used, the sequence has to change to: rbd lock checking (through `rbd lock list`), mapping check (through `rbd status`), forced unlock if necessary (through `rbd lock rm`), image lock, image mapping, and mount. **Release note**: ```release-note force unlock rbd image if the image is not used ```