You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2018/07/31 17:51:40 UTC

[incubator-openwhisk-deploy-kube] branch master updated: Fix for #266 and #267 (#268)

This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new da76889  Fix for #266 and #267 (#268)
da76889 is described below

commit da768898f0a06e0cbcb19a144c60942fba17429a
Author: Carlos Duque <cd...@gmail.com>
AuthorDate: Tue Jul 31 18:51:38 2018 +0100

    Fix for #266 and #267 (#268)
    
    * fixed readiness probe for couch db issue: #266
    * fixed invoker init.sh parameter needs uniqueName issue: #267
---
 helm/openwhisk/templates/_helpers.tpl   | 4 ++++
 helm/openwhisk/templates/_readiness.tpl | 2 +-
 helm/openwhisk/templates/invoker.yaml   | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/helm/openwhisk/templates/_helpers.tpl b/helm/openwhisk/templates/_helpers.tpl
index cabd9c1..e326187 100644
--- a/helm/openwhisk/templates/_helpers.tpl
+++ b/helm/openwhisk/templates/_helpers.tpl
@@ -20,6 +20,10 @@
 {{- end -}}
 {{- end -}}
 
+{{- define "db_authentication" -}}
+{{ .Values.db.auth.username }}:{{ .Values.db.auth.password }}
+{{- end -}}
+
 {{/* hostname for kafka */}}
 {{- define "kafka_host" -}}
 {{- if .Values.kafka.external -}}
diff --git a/helm/openwhisk/templates/_readiness.tpl b/helm/openwhisk/templates/_readiness.tpl
index 94291de..6e2029b 100644
--- a/helm/openwhisk/templates/_readiness.tpl
+++ b/helm/openwhisk/templates/_readiness.tpl
@@ -12,7 +12,7 @@
   env:
   - name: "READINESS_URL"
     value: {{ .Values.db.protocol }}://{{ include "db_host" . }}:{{ .Values.db.port }}/{{ .Values.db.activationsTable }}
-  command: ["sh", "-c", "result=1; until [ $result -eq 0 ]; do echo verifying CouchDB readiness; wget -T 5 --spider $READINESS_URL; result=$?; sleep 1; done;"]
+  command: ["sh", "-c", "result=1; until [ $result -eq 0 ]; do echo verifying CouchDB readiness; wget -T 5 --spider $READINESS_URL --header=\"Authorization: Basic {{ include "db_authentication" . | b64enc }}\"; result=$?; sleep 1; done;"]
 {{- end -}}
 {{- end -}}
 
diff --git a/helm/openwhisk/templates/invoker.yaml b/helm/openwhisk/templates/invoker.yaml
index 9a196cf..9eddb2b 100644
--- a/helm/openwhisk/templates/invoker.yaml
+++ b/helm/openwhisk/templates/invoker.yaml
@@ -55,7 +55,7 @@ spec:
       - name: {{ .Values.invoker.name | quote }}
         imagePullPolicy: {{ .Values.invoker.imagePullPolicy | quote }}
         image: {{ .Values.invoker.image | quote }}
-        command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /init.sh"]
+        command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) && /init.sh --uniqueName $COMPONENT_NAME"]
         env:
           - name: "PORT"
             value: {{ .Values.invoker.port | quote }}