From 1d58b69e6b5d6570aaf1987cf8871f4f331a18c6 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 11 Nov 2020 17:20:21 -0300 Subject: [PATCH] Fixed issue with boolean values in Rancher 2.5 --- charts/edemocracia/v0.4.0/questions.yaml | 15 +++----------- .../v0.4.0/templates/audiencias-pvc.yaml | 2 +- .../templates/audienciasweb-deployment.yaml | 2 +- .../templates/audienciasweb-service.yaml | 2 +- .../audienciasworker-deployment.yaml | 2 +- .../templates/discourse-assets-pvc.yaml | 2 +- .../v0.4.0/templates/discourse-cache-pvc.yaml | 2 +- .../templates/discourse-deployment.yaml | 2 +- .../v0.4.0/templates/discourse-img-pvc.yaml | 2 +- .../v0.4.0/templates/discourse-js-pvc.yaml | 2 +- .../v0.4.0/templates/discourse-service.yaml | 2 +- .../templates/edemocracia-deployment.yaml | 20 +++++++++++++++---- .../v0.4.0/templates/nginx-deployment.yaml | 12 +++++------ .../templates/wikilegis-deployment.yaml | 2 +- .../v0.4.0/templates/wikilegis-pvc.yaml | 2 +- .../v0.4.0/templates/wikilegis-service.yaml | 2 +- charts/edemocracia/v0.4.0/values.yaml | 6 +++--- 17 files changed, 41 insertions(+), 38 deletions(-) diff --git a/charts/edemocracia/v0.4.0/questions.yaml b/charts/edemocracia/v0.4.0/questions.yaml index 720bdf2..261148e 100644 --- a/charts/edemocracia/v0.4.0/questions.yaml +++ b/charts/edemocracia/v0.4.0/questions.yaml @@ -164,28 +164,19 @@ questions: default: "True" description: "Habilitar o discourse (Expressão)?" label: "Usar o Discourse?" - type: enum + type: boolean group: Avançado - options: - - "True" - - "False" - variable: wikilegis.enabled default: "True" description: "Habilitar o Wikilegis?" label: "Usar o Wikilegis?" - type: enum + type: boolean group: Avançado - options: - - "True" - - "False" - variable: audiencias.enabled default: "True" description: "Habilitar o Audiências Interativas?" label: "Usar o Audiências?" - type: enum + type: boolean group: Avançado - options: - - "True" - - "False" diff --git a/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml b/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml index 5eb8601..ae75435 100644 --- a/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/audiencias-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.audiencias.enabled "True" }} +{{- if .Values.audiencias.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml index 21dd852..4aeb4f5 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasweb-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.audiencias.enabled "True" }} +{{- if .Values.audiencias.enabled }} {{- $edemoUrl := .Values.edemocracia.hostname -}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml b/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml index eef1179..4208451 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasweb-service.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.audiencias.enabled "True" }} +{{- if .Values.audiencias.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml b/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml index 33c14c7..a96754d 100644 --- a/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/audienciasworker-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.audiencias.enabled "True" }} +{{- if .Values.audiencias.enabled }} {{- $edemoUrl := .Values.edemocracia.hostname -}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/edemocracia/v0.4.0/templates/discourse-assets-pvc.yaml b/charts/edemocracia/v0.4.0/templates/discourse-assets-pvc.yaml index f7c18dd..c69d340 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-assets-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-assets-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/discourse-cache-pvc.yaml b/charts/edemocracia/v0.4.0/templates/discourse-cache-pvc.yaml index 0c241bc..875ca03 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-cache-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-cache-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml b/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml index adfe332..a2adb6a 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} {{- $edemoUrl := .Values.edemocracia.hostname -}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/edemocracia/v0.4.0/templates/discourse-img-pvc.yaml b/charts/edemocracia/v0.4.0/templates/discourse-img-pvc.yaml index a7bd749..64568f2 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-img-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-img-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/discourse-js-pvc.yaml b/charts/edemocracia/v0.4.0/templates/discourse-js-pvc.yaml index c56dc42..8d15966 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-js-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-js-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/discourse-service.yaml b/charts/edemocracia/v0.4.0/templates/discourse-service.yaml index 7d139a3..c0c96f0 100644 --- a/charts/edemocracia/v0.4.0/templates/discourse-service.yaml +++ b/charts/edemocracia/v0.4.0/templates/discourse-service.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.discourse.enabled "True" }} +{{- if .Values.discourse.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml b/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml index a44f5b8..3aae7fe 100644 --- a/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/edemocracia-deployment.yaml @@ -52,7 +52,11 @@ spec: - name: AUDIENCIAS_API_KEY value: {{ .Values.edemocracia.apikey | quote }} - name: AUDIENCIAS_ENABLED - value: {{ .Values.audiencias.enabled | quote }} + {{- if .Values.audiencias.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} - name: AUDIENCIAS_UPSTREAM value: http://audienciasweb:8000/audiencias - name: DATABASE_ENGINE @@ -72,12 +76,16 @@ spec: - name: DEFAULT_FROM_EMAIL value: '"Portal e-Democracia" <{{ .Values.edemocracia.admin.email }}>' - name: DISCOURSE_ENABLED - value: {{ .Values.discourse.enabled | quote }} + {{- if .Values.discourse.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} - name: DISCOURSE_SSO_SECRET value: {{ .Values.discourse.sso.secret | quote }} # Workaround for a bug in runserver-production script, which does not check for DISCOURSE_ENABLED variable - name: DISCOURSE_UPSTREAM - {{- if eq .Values.discourse.enabled "True" }} + {{- if .Values.discourse.enabled }} value: http://discourse:8080/expressao {{- else }} value: "--version" @@ -123,7 +131,11 @@ spec: - name: WIKILEGIS_API_URL value: /api/v1/ - name: WIKILEGIS_ENABLED - value: {{ .Values.wikilegis.enabled | quote }} + {{- if .Values.wikilegis.enabled }} + value: "True" + {{- else }} + value: "False" + {{- end }} - name: WIKILEGIS_UPSTREAM value: http://wikilegis:8000 resources: diff --git a/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml b/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml index f3e682b..6899f86 100644 --- a/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/nginx-deployment.yaml @@ -49,15 +49,15 @@ spec: volumeMounts: - mountPath: /var/labhacker/edemocracia/src/public/ name: {{ include "edemocracia.fullname" . }}-edemocracia - {{- if eq .Values.wikilegis.enabled "True" }} + {{- if .Values.wikilegis.enabled }} - mountPath: /var/labhacker/wikilegis/wikilegis/public/ name: {{ include "edemocracia.fullname" . }}-wikilegis {{- end }} - {{- if eq .Values.audiencias.enabled "True" }} + {{- if .Values.audiencias.enabled }} - mountPath: /var/labhacker/audiencias/public/ name: {{ include "edemocracia.fullname" . }}-audiencias {{- end }} - {{- if eq .Values.discourse.enabled "True" }} + {{- if .Values.discourse.enabled }} - mountPath: /var/www/discourse/public/assets/ name: {{ include "edemocracia.fullname" . }}-discourse-assets - mountPath: /var/www/discourse/public/javascripts/ @@ -73,17 +73,17 @@ spec: - name: {{ include "edemocracia.fullname" . }}-edemocracia persistentVolumeClaim: claimName: {{ include "edemocracia.fullname" . }}-edemocracia - {{- if eq .Values.wikilegis.enabled "True" }} + {{- if .Values.wikilegis.enabled }} - name: {{ include "edemocracia.fullname" . }}-wikilegis persistentVolumeClaim: claimName: {{ include "edemocracia.fullname" . }}-wikilegis {{- end }} - {{- if eq .Values.audiencias.enabled "True" }} + {{- if .Values.audiencias.enabled }} - name: {{ include "edemocracia.fullname" . }}-audiencias persistentVolumeClaim: claimName: {{ include "edemocracia.fullname" . }}-audiencias {{- end }} - {{- if eq .Values.discourse.enabled "True" }} + {{- if .Values.discourse.enabled }} - name: {{ include "edemocracia.fullname" . }}-discourse-assets persistentVolumeClaim: claimName: {{ include "edemocracia.fullname" . }}-discourse-assets diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml index 526cad5..da96d04 100644 --- a/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml +++ b/charts/edemocracia/v0.4.0/templates/wikilegis-deployment.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.wikilegis.enabled "True" }} +{{- if .Values.wikilegis.enabled }} {{- $edemoUrl := .Values.edemocracia.hostname -}} apiVersion: apps/v1 kind: Deployment diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml index cbb7e6b..00b8660 100644 --- a/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml +++ b/charts/edemocracia/v0.4.0/templates/wikilegis-pvc.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.wikilegis.enabled "True" }} +{{- if .Values.wikilegis.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml b/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml index 68a4a0a..793fd2c 100644 --- a/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml +++ b/charts/edemocracia/v0.4.0/templates/wikilegis-service.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.wikilegis.enabled "True" }} +{{- if .Values.wikilegis.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/charts/edemocracia/v0.4.0/values.yaml b/charts/edemocracia/v0.4.0/values.yaml index 3b01cea..53f7641 100644 --- a/charts/edemocracia/v0.4.0/values.yaml +++ b/charts/edemocracia/v0.4.0/values.yaml @@ -19,7 +19,7 @@ nginx: memory: 10Mi discourse: - enabled: "True" + enabled: true image: repository: labhackercd/discourse-docker tag: 2.0.20180703 @@ -42,7 +42,7 @@ discourse: memory: 650Mi wikilegis: - enabled: "True" + enabled: true image: repository: labhackercd/wikilegis tag: 2.3.0 @@ -105,7 +105,7 @@ edemocracia: memory: 800Mi audiencias: - enabled: "True" + enabled: true image: repository: labhackercd/audiencias-publicas tag: 3.3.1