From dbeb87e210165431f4439734fb8cae24c44983b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20K=C4=99ska?= <372403+keskad@users.noreply.github.com> Date: Wed, 22 May 2024 08:52:23 +0200 Subject: [PATCH] fix/feat: Allow to use JSON configuration in Helm Chart to mitigate #46 issue in a simplest way at this moment --- .../templates/defaultconfig.cm.yaml | 9 +++++++++ .../templates/deployment.yaml | 10 ++++++++++ charts/pipelines-feedback-common/values.yaml | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 charts/pipelines-feedback-common/templates/defaultconfig.cm.yaml diff --git a/charts/pipelines-feedback-common/templates/defaultconfig.cm.yaml b/charts/pipelines-feedback-common/templates/defaultconfig.cm.yaml new file mode 100644 index 0000000..97f80fd --- /dev/null +++ b/charts/pipelines-feedback-common/templates/defaultconfig.cm.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "app.fullname" . }}-default-config + labels: + {{- include "app.labels" . | nindent 6 }} +data: + pipelines-feedback.json: | + {{ toJson $.Values.controller.defaultConfig }} diff --git a/charts/pipelines-feedback-common/templates/deployment.yaml b/charts/pipelines-feedback-common/templates/deployment.yaml index c5fe933..06325f8 100644 --- a/charts/pipelines-feedback-common/templates/deployment.yaml +++ b/charts/pipelines-feedback-common/templates/deployment.yaml @@ -96,6 +96,11 @@ spec: {{- end }} resources: {{- toYaml .Values.controller.deployment.resources | nindent 20 }} + + volumeMounts: + - name: config + mountPath: /etc/pipelines-feedback/pipelines-feedback.json + subPath: pipelines-feedback.json {{- with .Values.controller.deployment.nodeSelector }} nodeSelector: {{- toYaml . | nindent 14 }} @@ -108,3 +113,8 @@ spec: tolerations: {{- toYaml . | nindent 14 }} {{- end }} + volumes: + - name: config + configMap: + name: {{ include "app.fullname" . }}-default-config + diff --git a/charts/pipelines-feedback-common/values.yaml b/charts/pipelines-feedback-common/values.yaml index b3c5ee0..65110b9 100644 --- a/charts/pipelines-feedback-common/values.yaml +++ b/charts/pipelines-feedback-common/values.yaml @@ -65,6 +65,16 @@ controller: name: "" env: REDIS_HOST: "redis:6379" + CONFIG_PATH: "/etc/pipelines-feedback/pipelines-feedback.json" + + # -- Default config lets you append globally same configuration you have in PFConfigs. PFConfigs takes precedence. In order to change default config controller needs to be restarted + defaultConfig: + logs-enabled: "true" + # jxscm.git-kind: "gitlab" + # jxscm.git-server: "http://some-git-host" + # jxscm.token: "glpat-xxx" + # jxscm.git-user: "__token__" + # dashboard-url: "https://console-openshift-console.apps.my-host.org/k8s/ns/{{ .namespace }}/tekton.dev~v1beta1~PipelineRun/{{ .name }}" # -------- # Security