diff --git a/ceph-client/templates/bin/_helm-tests.sh.tpl b/ceph-client/templates/bin/_helm-tests.sh.tpl index 5f15eea46..0f749f1c0 100755 --- a/ceph-client/templates/bin/_helm-tests.sh.tpl +++ b/ceph-client/templates/bin/_helm-tests.sh.tpl @@ -265,7 +265,8 @@ function pool_failuredomain_validation() { } function pg_validation() { - inactive_pgs=(`ceph --cluster ${CLUSTER} pg ls | tail -n +2 | grep -v "active+"|awk '{ print $1 }'`) + ceph pg ls + inactive_pgs=(`ceph --cluster ${CLUSTER} pg ls -f json-pretty | grep '"pgid":\|"state":' | grep -v "active" | grep -B1 '"state":' | awk -F "\"" '/pgid/{print $4}'`) if [ ${#inactive_pgs[*]} -gt 0 ];then echo "There are few incomplete pgs in the cluster" echo ${inactive_pgs[*]} @@ -290,7 +291,7 @@ OSD_POOLS_DETAILS=$(ceph osd pool ls detail -f json-pretty) OSD_CRUSH_RULE_DUMP=$(ceph osd crush rule dump -f json-pretty) PG_STAT=$(ceph pg stat -f json-pretty) - +ceph -s pg_validation pool_validation pool_failuredomain_validation diff --git a/ceph-client/templates/pod-helm-tests.yaml b/ceph-client/templates/pod-helm-tests.yaml index 951a22cb8..f9117d8e9 100644 --- a/ceph-client/templates/pod-helm-tests.yaml +++ b/ceph-client/templates/pod-helm-tests.yaml @@ -40,6 +40,8 @@ spec: {{ tuple $envAll $envAll.Values.pod.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} {{ dict "envAll" $envAll "application" "test" "container" "test" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }} env: + - name: CLUSTER + value: "ceph" - name: CEPH_DEPLOYMENT_NAMESPACE value: {{ .Release.Namespace }} - name: REQUIRED_PERCENT_OF_OSDS