Skip to content

Commit 449ad51

Browse files
authoredSep 3, 2021
feat: Add support for adding pvc labels (jenkinsci#451)
This change adds support for specifying additional labels for the Jenkins home pvc. Tests added Changelog updated and version bumped README.md and VALUES_SUMMARY.md updated. Signed-off-by: Gavin Williams <[email protected]>
1 parent 604d7eb commit 449ad51

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed
 

‎charts/jenkins/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ 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+
## 3.5.15
16+
Add support for adding labels to the Jenkins home Persistent Volume Claim (pvc)
17+
1518
## 3.5.14
1619

1720
* Updated versions of default plugins

‎charts/jenkins/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: jenkins
33
home: https://jenkins.io/
4-
version: 3.5.14
4+
version: 3.5.15
55
appVersion: 2.303.1
66
description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project.
77
sources:

‎charts/jenkins/VALUES_SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
334334
| `persistence.existingClaim` | Provide the name of a PVC | `nil` |
335335
| `persistence.storageClass` | Storage class for the PVC | `nil` |
336336
| `persistence.annotations` | Annotations for the PVC | `{}` |
337+
| `persistence.labels` | Labels for the PVC | `{}` |
337338
| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` |
338339
| `persistence.size` | The size of the PVC | `8Gi` |
339340
| `persistence.subPath` | SubPath for jenkins-home mount | `nil` |

‎charts/jenkins/templates/home-pvc.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ metadata:
1717
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
1818
"app.kubernetes.io/instance": "{{ .Release.Name }}"
1919
"app.kubernetes.io/component": "{{ .Values.controller.componentName }}"
20+
{{- if .Values.persistence.labels }}
21+
{{ toYaml .Values.persistence.labels | indent 4 }}
22+
{{- end }}
2023
spec:
2124
accessModes:
2225
- {{ .Values.persistence.accessMode | quote }}

‎charts/jenkins/unittests/home-pvc-test.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,19 @@ tests:
7676
app.kubernetes.io/instance: my-release
7777
app.kubernetes.io/managed-by: Helm
7878
app.kubernetes.io/name: jenkins
79+
80+
- it: add label
81+
set:
82+
renderHelmLabels: false
83+
persistence:
84+
labels:
85+
test-label: test-value
86+
asserts:
87+
- equal:
88+
path: metadata.labels
89+
value:
90+
app.kubernetes.io/component: jenkins-controller
91+
app.kubernetes.io/instance: my-release
92+
app.kubernetes.io/managed-by: Helm
93+
app.kubernetes.io/name: jenkins
94+
test-label: test-value

‎charts/jenkins/values.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ persistence:
738738
##
739739
storageClass:
740740
annotations: {}
741+
labels: {}
741742
accessMode: "ReadWriteOnce"
742743
size: "8Gi"
743744
volumes:

0 commit comments

Comments
 (0)
Please sign in to comment.