From 1a0ca47b510955c9d9b8fa1c68582851bff52cfe Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Mon, 30 Mar 2020 09:27:49 -0500 Subject: [PATCH] [ceph-client] update helm tests logic for pg autoscaler This is to update helm tests logic depends on pg autoscaler enabled or not. Change-Id: I14e86c9f14260bff10f098caaa96709550372ee3 --- ceph-client/templates/bin/_helm-tests.sh.tpl | 8 +++++++- ceph-client/templates/pod-helm-tests.yaml | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ceph-client/templates/bin/_helm-tests.sh.tpl b/ceph-client/templates/bin/_helm-tests.sh.tpl index aa887aba9..b79e277d1 100755 --- a/ceph-client/templates/bin/_helm-tests.sh.tpl +++ b/ceph-client/templates/bin/_helm-tests.sh.tpl @@ -158,9 +158,15 @@ function pool_validation() { crush_rule=$(echo ${pool_obj} | jq -r .crush_rule) name=$(echo ${pool_obj} | jq -r .pool_name) pg_autoscale_mode=$(echo ${pool_obj} | jq -r .pg_autoscale_mode) + if [[ "${ENABLE_AUTOSCALER}" == "true" ]]; then + if [[ "${pg_autoscale_mode}" != "on" ]]; then + echo "pg autoscaler not enabled on ${name} pool" + exit 1 + fi + fi if [[ $(ceph tell mon.* version | egrep -q "nautilus"; echo $?) -eq 0 ]]; then if [ "x${size}" != "x${RBD}" ] || [ "x${min_size}" != "x${EXPECTED_POOLMINSIZE}" ] \ - || [ "${pg_autoscale_mode}" != "on" ] || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then + || [ "x${crush_rule}" != "x${expectedCrushRuleId}" ]; then echo "Pool ${name} has incorrect parameters!!! Size=${size}, Min_Size=${min_size}, Rule=${crush_rule}, PG_Autoscale_Mode=${pg_autoscale_mode}" exit 1 else diff --git a/ceph-client/templates/pod-helm-tests.yaml b/ceph-client/templates/pod-helm-tests.yaml index 6a3af7ad9..703f210b1 100644 --- a/ceph-client/templates/pod-helm-tests.yaml +++ b/ceph-client/templates/pod-helm-tests.yaml @@ -51,6 +51,8 @@ spec: value: {{ .Values.conf.pool.default.crush_rule | default "replicated_rule" | quote }} - name: MGR_COUNT value: {{ .Values.pod.replicas.mgr | default "1" | quote }} + - name: ENABLE_AUTOSCALER + value: {{ .Values.conf.features.pg_autoscaler | quote }} {{- range $pool := .Values.conf.pool.spec -}} {{- with $pool }} - name: {{ .name | upper | replace "." "_" }}