aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/aai/components/aai-traversal/templates/_helpers.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/aai/components/aai-traversal/templates/_helpers.tpl')
-rw-r--r--kubernetes/aai/components/aai-traversal/templates/_helpers.tpl21
1 files changed, 21 insertions, 0 deletions
diff --git a/kubernetes/aai/components/aai-traversal/templates/_helpers.tpl b/kubernetes/aai/components/aai-traversal/templates/_helpers.tpl
new file mode 100644
index 0000000000..003be58409
--- /dev/null
+++ b/kubernetes/aai/components/aai-traversal/templates/_helpers.tpl
@@ -0,0 +1,21 @@
+{{- define "aai.waitForSchemaCreation" -}}
+- name: wait-for-schema-creation
+ image: "{{ include "repositoryGenerator.image.curl" . }}"
+ imagePullPolicy: IfNotPresent
+ command: ["/bin/sh", "-c"]
+ args:
+ - |
+ URL="{{ required "URL is required" (.Values.schemaInitCheckURL | default "http://aai-graphadmin:8449/isSchemaInitialized") }}"
+ AUTH="{{ printf "%s:%s" (index .Values.global.config.basic.auth.users 0).username (index .Values.global.config.basic.auth.users 0).password }}"
+ while true; do
+ RESPONSE=$(curl -u $AUTH -s $URL)
+ if [ "$RESPONSE" = "true" ]; then
+ echo "Request successful. Schema is initialized."
+ exit 0
+ else
+ echo "Request unsuccessful. Schema is not yet initialized. Retrying in 3 seconds..."
+ sleep 3
+ fi
+ done
+ {{ include "common.containerSecurityContext" . | indent 2 | trim }}
+{{- end -}}