[ceph-client] Handle multiple mon versions in the pool job

The mon version check in the rbd-pool job can cause the script to
error and abort if there are multiple mon versions present in the
Ceph cluster. This change chooses the lowest-numbered major version
from the available mon versions when performing the version check
since the check is performed in order to determine the right way to
parse JSON output from a mon query.

Change-Id: I51cc6d1de0034affdc0cc616298c2d2cd3476dbb
This commit is contained in:
Stephen Taylor 2022-06-14 13:35:36 -06:00
parent fce7ca38ae
commit d2c8de85c9
3 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Ceph Client
name: ceph-client
version: 0.1.34
version: 0.1.35
home: https://github.com/ceph/ceph-client
...

View File

@ -49,7 +49,7 @@ function wait_for_pgs () {
pgs_ready=0
query='map({state: .state}) | group_by(.state) | map({state: .[0].state, count: length}) | .[] | select(.state | contains("active") or contains("premerge") | not)'
if [[ $(ceph mon versions | awk '/version/{print $3}' | cut -d. -f1) -ge 14 ]]; then
if [[ $(ceph mon versions | awk '/version/{print $3}' | sort -n | head -n 1 | cut -d. -f1) -ge 14 ]]; then
query=".pg_stats | ${query}"
fi

View File

@ -35,4 +35,5 @@ ceph-client:
- 0.1.32 Simplify test rules for ceph-mgr deployment
- 0.1.33 More robust naming of clusterrole-checkdns
- 0.1.34 Migrated CronJob resource to batch/v1 API version
- 0.1.35 Handle multiple mon versions in the pool job
...