[Update] ES helm-test script updated

This ps removes the test_api_object_creation function as the api_objects map is now more
dynamic with ability to create, delete etc.
This function throws error when it does a GET on the objects that first
needs to be created(PUT).
This function is no longer relevant with the updated create-templates
job which is more robust.

Change-Id: I9f37c86ae9ca4bf32c417880926b6a3c3e78cb8a
This commit is contained in:
Pai, Radhika (rp592h) 2021-04-20 10:31:01 -05:00
parent e3142120cb
commit ed8c3fac88
3 changed files with 2 additions and 28 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v7.6.2 appVersion: v7.6.2
description: OpenStack-Helm ElasticSearch description: OpenStack-Helm ElasticSearch
name: elasticsearch name: elasticsearch
version: 0.2.3 version: 0.2.4
home: https://www.elastic.co/ home: https://www.elastic.co/
sources: sources:
- https://github.com/elastic/elasticsearch - https://github.com/elastic/elasticsearch

View File

@ -36,32 +36,6 @@ function create_test_index () {
fi fi
} }
{{ if not (empty .Values.conf.api_objects) }}
function test_api_object_creation () {
NUM_ERRORS=0
{{ range $object, $config := .Values.conf.api_objects }}
error=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
-XGET "${ELASTICSEARCH_ENDPOINT}/{{ $config.endpoint }}" | jq -r '.error')
if [ $error == "null" ]; then
echo "PASS: {{ $object }} is verified."
else
echo "FAIL: Error for {{ $object }}: $(echo $error | jq -r)"
NUM_ERRORS=$(($NUM_ERRORS+1))
fi
{{ end }}
if [ $NUM_ERRORS -gt 0 ]; then
echo "FAIL: Some API Objects were not created!"
exit 1
else
echo "PASS: API Objects are verified!"
fi
}
{{ end }}
{{ if .Values.conf.elasticsearch.snapshots.enabled }} {{ if .Values.conf.elasticsearch.snapshots.enabled }}
function check_snapshot_repositories_verified () { function check_snapshot_repositories_verified () {
repositories=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ repositories=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
@ -92,7 +66,6 @@ function remove_test_index () {
remove_test_index || true remove_test_index || true
create_test_index create_test_index
remove_test_index remove_test_index
test_api_object_creation
{{ if .Values.conf.elasticsearch.snapshots.enabled }} {{ if .Values.conf.elasticsearch.snapshots.enabled }}
check_snapshot_repositories_verified check_snapshot_repositories_verified
{{ end }} {{ end }}

View File

@ -13,4 +13,5 @@ elasticsearch:
- 0.2.1 Make templates job more robust & allow overrides - 0.2.1 Make templates job more robust & allow overrides
- 0.2.2 Update the ES curator config to {} - 0.2.2 Update the ES curator config to {}
- 0.2.3 Add configurable backoffLimit to templates job - 0.2.3 Add configurable backoffLimit to templates job
- 0.2.4 Update helm-test script
... ...