Skip to content

Commit 9a22f3f

Browse files
committed
Set curl credentials for require_valid_user, as well
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.
1 parent 45a9d75 commit 9a22f3f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

couchdb/templates/clustersetup.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ data:
1515
BASE_URL=http://{{ template "couchdb.fullname" . }}:5984
1616
set -x
1717
18+
touch /tmp/curl.cf
19+
{{ if or .Values.couchdbConfig.chttpd.require_valid_user (not .Values.allowAdminParty) }}
20+
echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf
21+
{{ end }}
22+
1823
echo "Waiting for CouchDB service to start..."
19-
until curl --silent -max-time 5 --head --fail "${BASE_URL}/_up"; do
24+
until curl --silent --max-time 5 --head --fail "${BASE_URL}/_up" -K /tmp/curl.cf; do
2025
printf "%s: CouchDB not up yet. Will try again\n" "$(date)"
2126
sleep 2
2227
done
2328
2429
echo "Initializing cluster"
25-
touch /tmp/curl.cf
26-
{{ if not .Values.allowAdminParty }}
27-
echo "-u $(cat /tmp/admin-password/adminUsername):$(cat /tmp/admin-password/adminPassword)" >> /tmp/curl.cf
28-
{{ end }}
2930
curl -silent "${BASE_URL}/_cluster_setup" \
3031
-H "Content-Type: application/json" \
3132
-d '{"action": "finish_cluster"}' \

0 commit comments

Comments
 (0)