Skip to content

Commit

Permalink
Set curl credentials for require_valid_user, as well
Browse files Browse the repository at this point in the history
This does mean that we now send credentials for the /_up endpoint even when
require_valid_user is not set, but this should not hurt anything.
  • Loading branch information
flimzy committed Sep 22, 2020
1 parent 45a9d75 commit 9a22f3f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions couchdb/templates/clustersetup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ data:
BASE_URL=http://{{ template "couchdb.fullname" . }}:5984
set -x
touch /tmp/curl.cf
{{ if or .Values.couchdbConfig.chttpd.require_valid_user (not .Values.allowAdminParty) }}
echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf
{{ end }}
echo "Waiting for CouchDB service to start..."
until curl --silent -max-time 5 --head --fail "${BASE_URL}/_up"; do
until curl --silent --max-time 5 --head --fail "${BASE_URL}/_up" -K /tmp/curl.cf; do
printf "%s: CouchDB not up yet. Will try again\n" "$(date)"
sleep 2
done
echo "Initializing cluster"
touch /tmp/curl.cf
{{ if not .Values.allowAdminParty }}
echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf
{{ end }}
curl -silent "${BASE_URL}/_cluster_setup" \
-H "Content-Type: application/json" \
-d '{"action": "finish_cluster"}' \
Expand Down

0 comments on commit 9a22f3f

Please sign in to comment.