From 30c5b405dcdce8cdad92b67e22e545adf2472f2f Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Fri, 18 Feb 2022 10:18:35 +0000 Subject: [PATCH] Update provision tree script in k8s to use createtree (#2676) This tool replaces the manual instructions that involved the REST API. --- .../deployment/kubernetes/provision_tree.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/examples/deployment/kubernetes/provision_tree.sh b/examples/deployment/kubernetes/provision_tree.sh index 4f4c804fe9..3083a61bd6 100755 --- a/examples/deployment/kubernetes/provision_tree.sh +++ b/examples/deployment/kubernetes/provision_tree.sh @@ -14,29 +14,18 @@ fi # Set up tunnel: PORT=35791 -export LOG_URL="http://127.0.0.1:${PORT}" +export LOG_RPC="http://127.0.0.1:${PORT}" -echo kubectl port-forward service/trillian-log-service ${PORT}:8091 -kubectl port-forward service/trillian-log-service ${PORT}:8091 & +echo kubectl port-forward service/trillian-log-service ${PORT}:8090 +kubectl port-forward service/trillian-log-service ${PORT}:8090 & trap "kill %1" 0 1 2 3 4 6 9 15 sleep 3 echo "Creating tree..." -# TODO(al): use cmd/createtree instead. -TREE=$(curl -sb -X POST ${LOG_URL}/v1beta1/trees -d '{ "tree":{ "tree_state":"ACTIVE", "tree_type":"LOG", "hash_strategy":"RFC6962_SHA256", "signature_algorithm":"ECDSA", "max_root_duration":"0", "hash_algorithm":"SHA256" }, "key_spec":{ "ecdsa_params":{ "curve":"P256" } } }') - -echo $TREE - -TREEID=$(echo ${TREE} | jq -r .tree_id) +TREEID=$(go run github.com/google/trillian/cmd/createtree --admin_server=${LOG_RPC}) echo "Created tree ${TREEID}:" -echo ${TREE} | jq - -echo "Initialising tree ${TREEID}:" -STH=$(curl -s -X POST ${LOG_URL}/v1beta1/logs/${TREEID}:init) -echo "Created STH:" -echo ${STH} | jq # stop port-forwarding kill %1