From 501335b764e4aecbec60955eff6995eb627757e0 Mon Sep 17 00:00:00 2001 From: William Hutson Date: Sun, 17 Mar 2019 12:10:54 -0400 Subject: [PATCH] Jenkins OverwriteConfig setting also overwrites init scripts (#9468) * Jenkins OverwriteConfig setting also overwrites init scripts Signed-off-by: William Hutson * fixed indentation Signed-off-by: William Hutson --- stable/jenkins/Chart.yaml | 2 +- stable/jenkins/README.md | 2 +- stable/jenkins/templates/config.yaml | 3 +++ stable/jenkins/values.yaml | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index d3ae97db63..6ebdcff4f4 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,6 +1,6 @@ name: jenkins home: https://jenkins.io/ -version: 0.34.1 +version: 0.35.0 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 diff --git a/stable/jenkins/README.md b/stable/jenkins/README.md index 51cc41c47e..5dc26b0247 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -72,7 +72,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `Master.LoadBalancerIP` | Optional fixed external IP | Not set | | `Master.JMXPort` | Open a port, for JMX stats | Not set | | `Master.ExtraPorts` | Open extra ports, for other uses | Not set | -| `Master.OverwriteConfig` | Replace config w/ ConfigMap on boot | `false` | +| `Master.OverwriteConfig` | Replace init scripts and config w/ ConfigMap on boot | `false` | | `Master.ingress.enabled` | Enables ingress | `false` | | `Master.ingress.hostName` | Ingress host name | Not set | | `Master.ingress.annotations` | Ingress annotations | `{}` | diff --git a/stable/jenkins/templates/config.yaml b/stable/jenkins/templates/config.yaml index bbefca5b8f..05e319f823 100644 --- a/stable/jenkins/templates/config.yaml +++ b/stable/jenkins/templates/config.yaml @@ -258,6 +258,9 @@ data: {{- end }} {{- if .Values.Master.InitScripts }} mkdir -p /var/jenkins_home/init.groovy.d/; + {{- if .Values.Master.OverwriteConfig }} + rm -f /var/jenkins_home/init.groovy.d/*.groovy + {{- end }} yes n | cp -i /var/jenkins_config/*.groovy /var/jenkins_home/init.groovy.d/; {{- end }} {{- if .Values.Master.JCasC.enabled }} diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index 3c7ad43f1e..fe6eaba4ac 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -246,6 +246,7 @@ Master: # By default, the configMap is only used to set the initial config the first time # that the chart is installed. Setting `OverwriteConfig` to `true` will overwrite # the jenkins config with the contents of the configMap every time the pod starts. + # This will also overwrite all init scripts OverwriteConfig: false ingress: