| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 1 | {{- $root := . }} |
| 2 | {{- if .Values.controller.sidecars.configAutoReload.enabled }} |
| 3 | {{- range $key, $val := .Values.controller.JCasC.configScripts }} |
| 4 | {{- if $val }} |
| 5 | --- |
| 6 | apiVersion: v1 |
| 7 | kind: ConfigMap |
| 8 | metadata: |
| 9 | name: {{ template "jenkins.casc.configName" (list (printf "config-%s" $key) $ )}} |
| 10 | namespace: {{ template "jenkins.namespace" $root }} |
| 11 | labels: |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 12 | {{- include "jenkins.labels" $root | nindent 4 }} |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 13 | {{ template "jenkins.fullname" $root }}-jenkins-config: "true" |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 14 | {{- if $root.Values.controller.JCasC.configMapAnnotations }} |
| 15 | annotations: |
| 16 | {{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }} |
| 17 | {{- end }} |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 18 | data: |
| 19 | {{ $key }}.yaml: |- |
| 20 | {{ tpl $val $| indent 4 }} |
| 21 | {{- end }} |
| 22 | {{- end }} |
| 23 | {{- if .Values.controller.JCasC.defaultConfig }} |
| 24 | --- |
| 25 | apiVersion: v1 |
| 26 | kind: ConfigMap |
| 27 | metadata: |
| 28 | name: {{ template "jenkins.casc.configName" (list "jcasc-config" $ )}} |
| 29 | namespace: {{ template "jenkins.namespace" $root }} |
| 30 | labels: |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 31 | {{- include "jenkins.labels" $root | nindent 4 }} |
| 32 | {{ template "jenkins.fullname" $root }}-jenkins-config: "true" |
| 33 | {{- if $root.Values.controller.JCasC.configMapAnnotations }} |
| 34 | annotations: |
| 35 | {{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }} |
| 36 | {{- end }} |
| 37 | data: |
| 38 | jcasc-default-config.yaml: |- |
| 39 | {{- include "jenkins.casc.defaults" . | nindent 4 }} |
| 40 | {{- end}} |
| 41 | {{- $configScripts := toYaml .Values.controller.JCasC.configScripts }} |
| 42 | {{- if and .Values.controller.JCasC.securityRealm (not (contains "securityRealm:" $configScripts)) (not .Values.controller.JCasC.defaultConfig) }} |
| 43 | --- |
| 44 | apiVersion: v1 |
| 45 | kind: ConfigMap |
| 46 | metadata: |
| 47 | name: {{ template "jenkins.casc.configName" (list "config-securityrealm" $ )}} |
| 48 | namespace: {{ template "jenkins.namespace" $root }} |
| 49 | labels: |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 50 | "app.kubernetes.io/name": {{ template "jenkins.name" $root}} |
| 51 | {{- if .Values.renderHelmLabels }} |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 52 | "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}" |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 53 | {{- end }} |
| 54 | "app.kubernetes.io/managed-by": "{{ $.Release.Service }}" |
| 55 | "app.kubernetes.io/instance": "{{ $.Release.Name }}" |
| 56 | "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}" |
| 57 | {{ template "jenkins.fullname" $root }}-jenkins-config: "true" |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 58 | {{- if $root.Values.controller.JCasC.configMapAnnotations }} |
| 59 | annotations: |
| 60 | {{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }} |
| 61 | {{- end }} |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 62 | data: |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 63 | securityrealm.yaml: |- |
| 64 | jenkins: |
| 65 | securityRealm: |
| 66 | {{- tpl .Values.controller.JCasC.securityRealm . | nindent 8 }} |
| 67 | {{- end }} |
| 68 | {{- if and .Values.controller.JCasC.authorizationStrategy (not (contains "authorizationStrategy:" $configScripts)) (not .Values.controller.JCasC.defaultConfig) }} |
| 69 | --- |
| 70 | apiVersion: v1 |
| 71 | kind: ConfigMap |
| 72 | metadata: |
| 73 | name: {{ template "jenkins.casc.configName" (list "config-authorizationstrategy" $ )}} |
| 74 | namespace: {{ template "jenkins.namespace" $root }} |
| 75 | labels: |
| 76 | "app.kubernetes.io/name": {{ template "jenkins.name" $root}} |
| 77 | {{- if .Values.renderHelmLabels }} |
| 78 | "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version | replace "+" "_" }}" |
| 79 | {{- end }} |
| 80 | "app.kubernetes.io/managed-by": "{{ $.Release.Service }}" |
| 81 | "app.kubernetes.io/instance": "{{ $.Release.Name }}" |
| 82 | "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}" |
| 83 | {{ template "jenkins.fullname" $root }}-jenkins-config: "true" |
| 84 | {{- if $root.Values.controller.JCasC.configMapAnnotations }} |
| 85 | annotations: |
| 86 | {{ toYaml $root.Values.controller.JCasC.configMapAnnotations | indent 4 }} |
| 87 | {{- end }} |
| 88 | data: |
| 89 | authorizationstrategy.yaml: |- |
| 90 | jenkins: |
| 91 | authorizationStrategy: |
| 92 | {{- tpl .Values.controller.JCasC.authorizationStrategy . | nindent 8 }} |
| 93 | {{- end }} |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 94 | {{- end }} |