Skip to content

Commit 599f3cb

Browse files
authored
fix: java_ops issue with quoted values (#141)
Fix issues with quoted values like : `-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"` Signed-off-by: Julien Bouyoud <[email protected]>
1 parent 94ef3f8 commit 599f3cb

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

charts/jenkins/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
1212
The change log until v1.5.7 was auto-generated based on git commits.
1313
Those entries include a reference to the git commit to be able to get more details.
1414

15+
## 2.18.2
16+
17+
Fix: `master.javaOpts` issue with quoted values
18+
1519
## 2.18.1
1620

1721
Recommend installing plugins in custom image

charts/jenkins/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: jenkins
33
home: https://jenkins.io/
4-
version: 2.18.1
4+
version: 2.18.2
55
appVersion: lts
66
description: Open source continuous integration server. It supports multiple SCM tools
77
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based

charts/jenkins/templates/jenkins-master-deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,11 @@ spec:
185185
fieldRef:
186186
fieldPath: metadata.name
187187
- name: JAVA_OPTS
188-
value: {{- if .Values.master.sidecars.configAutoReload.enabled }} -Dcasc.reload.token=$(POD_NAME) {{- end }} {{ default "" .Values.master.javaOpts }}
188+
value: >-
189+
{{ if .Values.master.sidecars.configAutoReload.enabled }} -Dcasc.reload.token=$(POD_NAME) {{ end }}{{ default "" .Values.master.javaOpts }}
189190
- name: JENKINS_OPTS
190-
value: "{{ if .Values.master.jenkinsUriPrefix }}--prefix={{ .Values.master.jenkinsUriPrefix }} {{ end }}{{ default "" .Values.master.jenkinsOpts}}"
191+
value: >-
192+
{{ if .Values.master.jenkinsUriPrefix }}--prefix={{ .Values.master.jenkinsUriPrefix }} {{ end }}{{ default "" .Values.master.jenkinsOpts }}
191193
- name: JENKINS_SLAVE_AGENT_PORT
192194
value: "{{ .Values.master.slaveListenerPort }}"
193195
{{- if .Values.master.useSecurity }}

charts/jenkins/tests/jenkins-master-deployment-test.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ tests:
6363
fieldRef:
6464
fieldPath: metadata.name
6565
- name: JAVA_OPTS
66-
value: -Dcasc.reload.token=$(POD_NAME)
66+
value: "-Dcasc.reload.token=$(POD_NAME) "
6767
- name: JENKINS_OPTS
6868
value: ""
6969
- name: JENKINS_SLAVE_AGENT_PORT
@@ -319,7 +319,8 @@ tests:
319319
path: spec.template.spec.containers[0].env
320320
content:
321321
name: JAVA_OPTS
322-
value: "-Dcasc.reload.token=$(POD_NAME) -Dio.jenkins.plugins.kubernetes.disableNoDelayProvisioning=true"
322+
value: >-
323+
-Dcasc.reload.token=$(POD_NAME) -Dio.jenkins.plugins.kubernetes.disableNoDelayProvisioning=true
323324
- it: disable helm.sh label
324325
set:
325326
renderHelmLabels: false
@@ -331,3 +332,23 @@ tests:
331332
app.kubernetes.io/instance: my-release
332333
app.kubernetes.io/managed-by: Tiller
333334
app.kubernetes.io/name: jenkins
335+
- it: java & jenkins opts with quotes
336+
set:
337+
master:
338+
javaOpts: >-
339+
-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"
340+
jenkinsOpts: >-
341+
-Dtest="custom: 'true'"
342+
asserts:
343+
- contains:
344+
path: spec.template.spec.containers[0].env
345+
content:
346+
name: JAVA_OPTS
347+
value: >-
348+
-Dcasc.reload.token=$(POD_NAME) -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"
349+
- contains:
350+
path: spec.template.spec.containers[0].env
351+
content:
352+
name: JENKINS_OPTS
353+
value: >-
354+
-Dtest="custom: 'true'"

0 commit comments

Comments
 (0)