Skip to content

Commit 1261584

Browse files
authored
benchmarks: clean up infra logs (elastic#15198)
The response from curl could contain secrets for the test ephimeral cluster. There is no need to display it unless an error occurred, when we may need it for debugging purposes.
1 parent 2d205c5 commit 1261584

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

testing/infra/terraform/modules/ec_deployment/scripts/enable_features.tftpl

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ echo $${POLICY} | jq '.item' | \
2323
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_storage_limit = {"value":"${tail_sampling_storage_limit}","type":"text"}' |\
2424
jq 'select(.inputs[].policy_template == "apmserver").inputs[].vars.tail_sampling_enabled = {type: "bool", value: ${enable_tail_sampling}}' > policy.json
2525

26-
# Update the policy
27-
curl -s -H 'content-type: application/json' -H 'kbn-xsrf: true' -X PUT -k [email protected] -u $${KIBANA_AUTH} $${KIBANA_ENDPOINT}
26+
# Update the policy, hide output to prevent secret leakage.
27+
if ! curl -s -o response.txt -H 'content-type: application/json' -H 'kbn-xsrf: true' -X PUT -k [email protected] -u $${KIBANA_AUTH} $${KIBANA_ENDPOINT}; then
28+
# If command failed print output to aid troubleshooting.
29+
cat response.txt
30+
fi
2831

2932
rm -f policy.json

0 commit comments

Comments
 (0)