osd: close the encrypted disk after cleanup is done

Once we are done cleaning up the content of the encrypted osd, let's
close the main LUKS device.
This avoids having dm devices on the system after the cleanup.

Closes: https://github.com/rook/rook/issues/10181
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 6ef491d9fc)
This commit is contained in:
Sébastien Han committed 2022-05-04 09:13:45 +02:00
1 parent 827abfa913
commit e1e89d5df2
7 files changed
+118 -58

No files matched your search

@@ -207,6 +207,17 @@ jobs:
- name: check-ownerreferences
run: tests/scripts/github-action-helper.sh check_ownerreferences
- name: teardown cluster with cleanup policy
run: |
kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}'
kubectl -n rook-ceph delete cephcluster rook-ceph
kubectl -n rook-ceph logs deploy/rook-ceph-operator
tests/scripts/github-action-helper.sh wait_for_cleanup_pod
lsblk
BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)
sudo head --bytes=60 ${BLOCK}1
sudo head --bytes=60 ${BLOCK}2
- name: collect common logs
if: always()
uses: ./.github/workflows/collect-logs
@@ -363,6 +374,17 @@ jobs:
kubectl -n rook-ceph delete deploy/rook-ceph-osd-0
tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2
- name: teardown cluster with cleanup policy
run: |
kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}'
kubectl -n rook-ceph delete cephcluster rook-ceph
kubectl -n rook-ceph logs deploy/rook-ceph-operator
tests/scripts/github-action-helper.sh wait_for_cleanup_pod
BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)
sudo head --bytes=60 ${BLOCK}1
sudo head --bytes=60 ${BLOCK}2
sudo lsblk
- name: collect common logs
if: always()
uses: ./.github/workflows/collect-logs