Skip to content

Commit

Permalink
Mount always ref/secrets. (helm#23137)
Browse files Browse the repository at this point in the history
The `ref/secrets` is mounted only when `master.enableXmlConfig == true`.
This is bug. The `ref/secrets` must be always mounted. Just because

`master.secretsFilesSecret` and `master.enableXmlConfig` are unrelated, as well as:

./templates/config.yaml has unconditional:

  apply_config.sh: |-
    echo "applying Jenkins configuration"
    mkdir -p {{ .Values.master.jenkinsRef }}/secrets/;

This mkdir will fail in UID != 0.
We need to mount always secrets.

Signed-off-by: Andrei Stepanov <[email protected]>
Signed-off-by: Adrien Loiseau <[email protected]>
  • Loading branch information
Andrei-Stepanov authored and li-adrienloiseau committed Jul 29, 2020
1 parent c4102d7 commit e67af28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions stable/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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.3.1

Always mount {{ .Values.master.jenkinsRef }}/secrets/ directory. Previous it
was mounted only when `master.enableXmlConfig` was enabled.

## 2.3.0

Add an option to specify pod based on labels that can connect to master if NetworkPolicy is enabled
Expand Down
2 changes: 1 addition & 1 deletion stable/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.3.0
version: 2.3.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
Expand Down
6 changes: 3 additions & 3 deletions stable/jenkins/templates/jenkins-master-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ spec:
name: jenkins-jobs
readOnly: true
{{- end }}
{{- end }}
- mountPath: {{ .Values.master.jenkinsRef }}/secrets/
name: secrets-dir
{{- end }}
{{- if .Values.master.secretsFilesSecret }}
- mountPath: /var/jenkins_secrets
name: jenkins-secrets
Expand Down Expand Up @@ -287,10 +287,10 @@ spec:
name: jenkins-jobs
readOnly: true
{{- end }}
{{- end }}
- mountPath: {{ .Values.master.jenkinsRef }}/secrets/
name: secrets-dir
readOnly: false
{{- end }}
{{- if or .Values.master.secretsFilesSecret }}
- mountPath: /var/jenkins_secrets
name: jenkins-secrets
Expand Down Expand Up @@ -369,9 +369,9 @@ spec:
configMap:
name: {{ template "jenkins.fullname" . }}-jobs
{{- end }}
{{- end }}
- name: secrets-dir
emptyDir: {}
{{- end }}
{{- if .Values.master.secretsFilesSecret }}
- name: jenkins-secrets
secret:
Expand Down

0 comments on commit e67af28

Please sign in to comment.