Skip to content

Commit

Permalink
fix: java_ops issue with quoted values (#141)
Browse files Browse the repository at this point in the history
Fix issues with quoted values like : `-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"`

Signed-off-by: Julien Bouyoud <[email protected]>
  • Loading branch information
jBouyoud authored Nov 21, 2020
1 parent 94ef3f8 commit 599f3cb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The change log until v1.5.7 was auto-generated based on git commits.
Those entries include a reference to the git commit to be able to get more details.

## 2.18.2

Fix: `master.javaOpts` issue with quoted values

## 2.18.1

Recommend installing plugins in custom image
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
home: https://jenkins.io/
version: 2.18.1
version: 2.18.2
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
Expand Down
6 changes: 4 additions & 2 deletions charts/jenkins/templates/jenkins-master-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: JAVA_OPTS
value: {{- if .Values.master.sidecars.configAutoReload.enabled }} -Dcasc.reload.token=$(POD_NAME) {{- end }} {{ default "" .Values.master.javaOpts }}
value: >-
{{ if .Values.master.sidecars.configAutoReload.enabled }} -Dcasc.reload.token=$(POD_NAME) {{ end }}{{ default "" .Values.master.javaOpts }}
- name: JENKINS_OPTS
value: "{{ if .Values.master.jenkinsUriPrefix }}--prefix={{ .Values.master.jenkinsUriPrefix }} {{ end }}{{ default "" .Values.master.jenkinsOpts}}"
value: >-
{{ if .Values.master.jenkinsUriPrefix }}--prefix={{ .Values.master.jenkinsUriPrefix }} {{ end }}{{ default "" .Values.master.jenkinsOpts }}
- name: JENKINS_SLAVE_AGENT_PORT
value: "{{ .Values.master.slaveListenerPort }}"
{{- if .Values.master.useSecurity }}
Expand Down
25 changes: 23 additions & 2 deletions charts/jenkins/tests/jenkins-master-deployment-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tests:
fieldRef:
fieldPath: metadata.name
- name: JAVA_OPTS
value: -Dcasc.reload.token=$(POD_NAME)
value: "-Dcasc.reload.token=$(POD_NAME) "
- name: JENKINS_OPTS
value: ""
- name: JENKINS_SLAVE_AGENT_PORT
Expand Down Expand Up @@ -319,7 +319,8 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: JAVA_OPTS
value: "-Dcasc.reload.token=$(POD_NAME) -Dio.jenkins.plugins.kubernetes.disableNoDelayProvisioning=true"
value: >-
-Dcasc.reload.token=$(POD_NAME) -Dio.jenkins.plugins.kubernetes.disableNoDelayProvisioning=true
- it: disable helm.sh label
set:
renderHelmLabels: false
Expand All @@ -331,3 +332,23 @@ tests:
app.kubernetes.io/instance: my-release
app.kubernetes.io/managed-by: Tiller
app.kubernetes.io/name: jenkins
- it: java & jenkins opts with quotes
set:
master:
javaOpts: >-
-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"
jenkinsOpts: >-
-Dtest="custom: 'true'"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: JAVA_OPTS
value: >-
-Dcasc.reload.token=$(POD_NAME) -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';"
- contains:
path: spec.template.spec.containers[0].env
content:
name: JENKINS_OPTS
value: >-
-Dtest="custom: 'true'"

0 comments on commit 599f3cb

Please sign in to comment.