[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
This commit is contained in:
Stephen Taylor 2021-06-22 06:58:48 -06:00
parent 196592ded6
commit 62f5cab770
3 changed files with 3 additions and 1 deletions

View File

@ -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
...

View File

@ -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

View File

@ -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
...