[stable/jenkins] Only render authorizationStrategy and securityRealm if set (#22678)

* [stable/jenkins] Only render authorizationStrategy and securityRealm when values are set.

This allows people to unset bothe values in case that they don't want
those without having to disable XML configuation.

One use case for this if these fields need more templating than what is
allowed within values.yaml. In that case one could supply a config map
which is annotated with the correct label, so that JCasC / the sidecar
container picks it up, but that is not part of the chart.

Signed-off-by: Torsten Walter <torsten.walter@syncier.com>

* remove empty newlines

Signed-off-by: Torsten Walter <torsten.walter@syncier.com>
This commit is contained in:
Torsten Walter
2020-06-06 05:27:45 -07:00
committed by GitHub
parent 3d996d6a8d
commit dce09489ab
4 changed files with 13 additions and 7 deletions
+4
View File
@@ -5,6 +5,10 @@ numbering uses [semantic versioning](http://semver.org).
NOTE: The change log until version 1.5.7 is auto generated based on git commits. Those include a reference to the git commit to be able to get more details.
## 2.0.1
Only render authorizationStrategy and securityRealm when values are set.
## 2.0.0 Configuration as Code now default + container does not run as root anymore
The README contains more details for this update.
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
home: https://jenkins.io/
version: 2.0.0
version: 2.0.1
appVersion: lts
description: Open source continuous integration server. It supports multiple SCM tools
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based
+4 -2
View File
@@ -74,11 +74,11 @@ Returns configuration as code default config
jenkins:
{{- if eq .Values.master.enableXmlConfig false }}
{{- $configScripts := toYaml .Values.master.JCasC.configScripts }}
{{- if not (contains "authorizationStrategy:" $configScripts) }}
{{- if and (.Values.master.JCasC.authorizationStrategy) (not (contains "authorizationStrategy:" $configScripts)) }}
authorizationStrategy:
{{- tpl .Values.master.JCasC.authorizationStrategy . | nindent 4 }}
{{- end }}
{{- if not (contains "securityRealm:" $configScripts) }}
{{- if and (.Values.master.JCasC.securityRealm) (not (contains "securityRealm:" $configScripts)) }}
securityRealm:
{{- tpl .Values.master.JCasC.securityRealm . | nindent 4 }}
{{- end }}
@@ -171,7 +171,9 @@ Returns kubernetes pod template configuration as code
- name: "{{ .Values.agent.sideContainerName }}"
alwaysPullImage: {{ .Values.agent.alwaysPullImage }}
args: "{{ .Values.agent.args | replace "$" "^$" }}"
{{- if .Values.agent.command }}
command: {{ .Values.agent.command }}
{{- end }}
envVars:
- containerEnvVar:
key: "JENKINS_URL"
@@ -17,16 +17,16 @@ metadata:
{{ toYaml .Values.master.serviceAnnotations | indent 4 }}
{{- end }}
spec:
{{if (and (eq .Values.master.serviceType "ClusterIP") (not (empty .Values.master.clusterIP)))}}
{{- if (and (eq .Values.master.serviceType "ClusterIP") (not (empty .Values.master.clusterIP))) }}
clusterIP: {{.Values.master.clusterIP}}
{{end}}
{{- end }}
ports:
- port: {{.Values.master.servicePort}}
name: http
targetPort: {{ .Values.master.targetPort }}
{{if (and (eq .Values.master.serviceType "NodePort") (not (empty .Values.master.nodePort)))}}
{{- if (and (eq .Values.master.serviceType "NodePort") (not (empty .Values.master.nodePort))) }}
nodePort: {{.Values.master.nodePort}}
{{end}}
{{- end }}
{{- range $index, $port := .Values.master.extraPorts }}
- port: {{ $port.port }}
name: {{ $port.name }}