@@ -50,7 +50,6 @@ if [ "${VERSION}" != "default" ]; then
5050fi
5151
5252OUTPUT_PATH_STATUS=" build/elastic-stack-status/${VERSION} "
53- profile=default
5453
5554if [ " ${APM_SERVER_ENABLED} " = true ]; then
5655 OUTPUT_PATH_STATUS=" build/elastic-stack-status/${VERSION} _with_apm_server"
@@ -87,12 +86,6 @@ stack.elastic_subscription: ${ELASTIC_LICENSE}
8786EOF
8887fi
8988
90- if [ -f ~ /.elastic-package/profiles/${profile} /config.yml ]; then
91- echo " --- Show profile used"
92- cat ~ /.elastic-package/profiles/${profile} /config.yml
93- fi
94-
95-
9689mkdir -p " ${OUTPUT_PATH_STATUS} "
9790
9891# Initial status empty
@@ -149,16 +142,22 @@ if [ "${SELF_MONITOR_ENABLED}" = true ]; then
149142 -f " ${ELASTIC_PACKAGE_ELASTICSEARCH_HOST} /metrics-system.*/_search?allow_no_indices=false&size=0"
150143fi
151144
145+ license=$( curl -s -S \
146+ -u " ${ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME} :${ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD} " \
147+ --cacert " ${ELASTIC_PACKAGE_CA_CERT} " \
148+ -f " ${ELASTIC_PACKAGE_ELASTICSEARCH_HOST} /_license" | jq -r ' .license.type' )
149+
152150if [[ " ${ELASTIC_LICENSE} " != " " ]]; then
153- # Check that there is some data in the system indexes.
154- license=$( curl -s -S \
155- -u " ${ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME} :${ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD} " \
156- --cacert " ${ELASTIC_PACKAGE_CA_CERT} " \
157- -f " ${ELASTIC_PACKAGE_ELASTICSEARCH_HOST} /_license" | jq -r ' .license.type' )
158151 if [[ " ${license} " != " ${ELASTIC_LICENSE} " ]]; then
159152 echo " Unexpected license found: ${license} "
160153 exit 1
161154 fi
155+ else
156+ # If not defined, elastic license/subscription must be trial
157+ if [[ " ${license} " != " trial" ]]; then
158+ echo " Unexpected license found: ${license} "
159+ exit 1
160+ fi
162161fi
163162
164163diff -q " ${OUTPUT_PATH_STATUS} /running_no_spaces.txt" " ${OUTPUT_PATH_STATUS} /expected_no_spaces.txt"
0 commit comments