From 62f5cab7707d128eb90cbe0a5651cac6b85ce0b8 Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Tue, 22 Jun 2021 06:58:48 -0600 Subject: [PATCH] [ceph-rgw] Fix a bug in placement target deletion for new targets A deployment that specifies a placement target with "delete: true" should delete that placement target if it exists. For a clean deployment the expectation is that the placement target should be created and immediately deleted; however, the check for existence happens before its creation and the delete doesn't execute as a result. This change adds a recheck for existence immediately after creation to remedy that. Change-Id: I26f7fa79c5c851070e94af758d0a0438aa7efa52 --- ceph-rgw/Chart.yaml | 2 +- ceph-rgw/templates/bin/_create-rgw-placement-targets.sh.tpl | 1 + releasenotes/notes/ceph-rgw.yaml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ceph-rgw/Chart.yaml b/ceph-rgw/Chart.yaml index 25c022d4ed..ede3cce8cf 100644 --- a/ceph-rgw/Chart.yaml +++ b/ceph-rgw/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph RadosGW name: ceph-rgw -version: 0.1.9 +version: 0.1.10 home: https://github.com/ceph/ceph ... diff --git a/ceph-rgw/templates/bin/_create-rgw-placement-targets.sh.tpl b/ceph-rgw/templates/bin/_create-rgw-placement-targets.sh.tpl index 50d5ff4f3b..0fb7af807f 100644 --- a/ceph-rgw/templates/bin/_create-rgw-placement-targets.sh.tpl +++ b/ceph-rgw/templates/bin/_create-rgw-placement-targets.sh.tpl @@ -55,6 +55,7 @@ RGW_PLACEMENT_TARGET_EXISTS=$(radosgw-admin zonegroup placement get --placement- if [[ -z "$RGW_PLACEMENT_TARGET_EXISTS" ]]; then create_rgw_placement_target "$RGW_ZONEGROUP" "$RGW_PLACEMENT_TARGET" add_rgw_zone_placement "$RGW_ZONE" "$RGW_PLACEMENT_TARGET" "$RGW_PLACEMENT_TARGET_DATA_POOL" "$RGW_PLACEMENT_TARGET_INDEX_POOL" "$RGW_PLACEMENT_TARGET_DATA_EXTRA_POOL" + RGW_PLACEMENT_TARGET_EXISTS=$(radosgw-admin zonegroup placement get --placement-id "$RGW_PLACEMENT_TARGET" 2>/dev/null || true) fi if [[ -n "$RGW_PLACEMENT_TARGET_EXISTS" ]] && [[ "true" == "$RGW_DELETE_PLACEMENT_TARGET" ]]; then diff --git a/releasenotes/notes/ceph-rgw.yaml b/releasenotes/notes/ceph-rgw.yaml index c4b428fb41..95e6ebe9e6 100644 --- a/releasenotes/notes/ceph-rgw.yaml +++ b/releasenotes/notes/ceph-rgw.yaml @@ -10,4 +10,5 @@ ceph-rgw: - 0.1.7 Use ca cert for helm tests - 0.1.8 Add placement target delete support to RGW - 0.1.9 Use full image ref for docker official images + - 0.1.10 Fix a bug in placement target deletion for new targets ...