Skip to content

Commit

Permalink
Add checksum for config-init-script into statefullset annotations (#932)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Jacomb <[email protected]>
  • Loading branch information
remyj38 and timja authored Oct 19, 2023
1 parent b972ab8 commit 78d1d7f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 4 additions & 1 deletion charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
The changelog 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.

## 4.7.4

Add the config-init-script checksum into the controller statefullset pod annotations to trigger restart of the pod in case of updated init scripts.

## 4.7.3

Update Jenkins image and appVersion to jenkins lts release version 2.414.3


## 4.7.1

Changes in 4.7.0 were reverted.
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: v2
name: jenkins
home: https://jenkins.io/
version: 4.7.3
version: 4.7.4
appVersion: 2.414.3
description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project.
sources:
Expand Down
3 changes: 3 additions & 0 deletions charts/jenkins/templates/jenkins-controller-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ spec:
{{- end}}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
{{- if .Values.controller.initScripts }}
checksum/config-init-scripts: {{ include (print $.Template.BasePath "/config-init-scripts.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.controller.podAnnotations }}
{{ tpl (toYaml .Values.controller.podAnnotations | indent 8) . }}
{{- end }}
Expand Down
14 changes: 14 additions & 0 deletions charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ release:
templates:
- jenkins-controller-statefulset.yaml
- config.yaml
- config-init-scripts.yaml
tests:
- it: default values
template: jenkins-controller-statefulset.yaml
Expand Down Expand Up @@ -832,3 +833,16 @@ tests:
content:
name: "CASC_JENKINS_CONFIG"
value: "/var/jenkins_home/casc_configs"

- it: test checksum for config-init-script
template: jenkins-controller-statefulset.yaml
set:
controller:
initScripts:
test: |-
This is a test script
asserts:
- isSubset:
path: spec.template.metadata.annotations
content:
checksum/config-init-scripts: 2ee2c03a600a50a55cf62cbed3f1d558d5322eda7544b4047beeb4df66e8ec11

0 comments on commit 78d1d7f

Please sign in to comment.