Skip to content

Commit 1cb72ab

Browse files
author
Barkha Choithani
committed
added changes as per pr review
1 parent 8652239 commit 1cb72ab

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

charts/templates/statefulset.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,31 @@ spec:
2929
- sh
3030
- '-c'
3131
- |
32-
echo '### Begin init container execution ###'
32+
log () {
33+
local TIMESTAMP=$(date +"%Y-%m-%d %T.%3N")
34+
echo "${TIMESTAMP} $@"
35+
}
36+
log "Info: [initContainer] Begin init container configure-group execution"
3337
if [[ $POD_NAME != *-0 ]]; then
34-
echo "This is not a first host in this cluster, not configuring group."
38+
log "Info: [initContainer] Skipping creation of group $MARKLOGIC_GROUP as $POD_NAME is not the first node in the group."
3539
else
3640
HOST_RESP_CODE=`curl --anyauth -m 20 -s -o /dev/null -w "%{http_code}" -X GET http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/hosts --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
3741
if [[ ${HOST_RESP_CODE} -ne 200 ]]; then
38-
echo "Bootstrap host not found."
42+
log "Error: [initContainer] Bootstrap host $MARKLOGIC_BOOTSTRAP_HOST not found."
3943
else
40-
echo "Configuring group on the MarkLogic cluster."
4144
GROUP_CFG_TEMPLATE='{"group-name":"%s"}'
4245
GROUP_CFG=$(printf "$GROUP_CFG_TEMPLATE" "$MARKLOGIC_GROUP")
4346
GROUP_RESP_CODE=`curl --anyauth -m 20 -s -o /dev/null -w "%{http_code}" -X GET http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups/${MARKLOGIC_GROUP} --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
4447
4548
if [[ ${GROUP_RESP_CODE} -eq 200 ]]; then
46-
echo "Group $MARKLOGIC_GROUP is already configured on the MarkLogic cluster."
49+
log "Info: [initContainer] Skipping creation of group $MARKLOGIC_GROUP as it already exists on the MarkLogic cluster."
4750
else
48-
echo "Group $MARKLOGIC_GROUP does not exist, creating $MARKLOGIC_GROUP on the MarkLogic cluster"
51+
log "Info: [initContainer] Group $MARKLOGIC_GROUP does not exist, creating $MARKLOGIC_GROUP on the MarkLogic cluster."
4952
curl --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD} -m 20 -s -X POST -d "${GROUP_CFG}" -H "Content-type: application/json" http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups
5053
fi
5154
fi
5255
fi
53-
echo '### Init container execution completed ###'
56+
log "Info: [initContainer] Init container execution completed"
5457
env:
5558
- name: MARKLOGIC_GROUP
5659
value: {{ .Values.group.name }}

charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ image:
2424
# Init container image parameters
2525
initContainerImage:
2626
repository: curlimages/curl
27-
tag: latest
27+
tag: 7.85.0
2828
pullPolicy: IfNotPresent
2929

3030
# Configure the imagePullSecret to pull the image from private repository that requires credential

0 commit comments

Comments
 (0)