Skip to content

Commit 7eda5c7

Browse files
pengzhoumlPeng Zhou
andauthored
MLE-11803 bug fix for PreStop hook when HTTPS turned on (#180)
Co-authored-by: Peng Zhou <[email protected]>
1 parent 67a15d7 commit 7eda5c7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

charts/templates/statefulset.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,19 @@ spec:
532532
533533
my_host=$(hostname -f)
534534
535+
HTTP_PROTOCOL="http"
536+
HTTPS_OPTION=""
537+
if [[ "$MARKLOGIC_JOIN_TLS_ENABLED" == "true" ]]; then
538+
HTTP_PROTOCOL="https"
539+
HTTPS_OPTION="-k"
540+
fi
535541
log "Info: [prestop] MarkLogic Pod Hostname: "$my_host
536-
537542
for ((i = 0; i < 5; i = i + 1)); do
538543
res_code=$(curl --anyauth --user $MARKLOGIC_ADMIN_USERNAME:$MARKLOGIC_ADMIN_PASSWORD \
539544
-o /dev/null -m 10 -s -w %{http_code} \
540-
-i -X POST --data "state=shutdown&failover=true" \
545+
-i -X POST ${HTTPS_OPTION} --data "state=shutdown&failover=true" \
541546
-H "Content-type: application/x-www-form-urlencoded" \
542-
http://localhost:8002/manage/v2/hosts/$my_host?format=json)
547+
${HTTP_PROTOCOL}://localhost:8002/manage/v2/hosts/$my_host?format=json)
543548
544549
if [[ ${res_code} -eq 202 ]]; then
545550
log "Info: [prestop] Host shut down response code: "$res_code

0 commit comments

Comments
 (0)