[CEPH] Add missing ceph cluster name for helm tests

This is to export the ceph cluster name as environment variable
since its getting referred by scripts.
also to fix the query to get inactive pgs.

Change-Id: I1db5cfbd594c0cc6d54f748f22af5856d9594922
This commit is contained in:
Chinasubbareddy Mallavarapu 2020-08-14 13:22:42 -05:00
parent 4557f6fbe8
commit 4214e85a77
2 changed files with 5 additions and 2 deletions

View File

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

View File

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