From 0dbfdce871c5949fed7a4fbc62099544651ee6ff Mon Sep 17 00:00:00 2001 From: Simon Wydooghe Date: Sat, 21 Sep 2019 01:15:25 +0200 Subject: [PATCH] [stable/jenkins] Make Jenkins master UI test optional (#16752) * [stable/jenkins] Make Jenkins master UI test optional The UI test makes it difficult to do an idempotent deployment check because the randomly named UI test Pod will always want to deploy a new pod. For those that don't need the UI test but prefer an idempotent deploy, allowing disabling the UI test seems like a good idea to me. This commit does the following: - Allow disabling the master UI test (skip test Pod + ConfigMap) - Bump chart version to 1.5.10 Signed-off-by: Simon Wydooghe * [stable/jenkins] Make Jenkins master UI test optional Tweak README description + unnest test.enabled Signed-off-by: Simon Wydooghe * [stable/jenkins] Change variable name to master.enableTest Signed-off-by: Simon Wydooghe --- stable/jenkins/Chart.yaml | 2 +- stable/jenkins/README.md | 1 + stable/jenkins/templates/tests/jenkins-test.yaml | 2 ++ stable/jenkins/templates/tests/test-config.yaml | 2 ++ stable/jenkins/values.yaml | 3 +++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index 663eee9088..020746cb03 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: jenkins home: https://jenkins.io/ -version: 1.7.2 +version: 1.7.3 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 e626f40e34..d9f54e43be 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -164,6 +164,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `master.prometheus.alertingrules` | Array of prometheus alerting rules | `[]` | | `master.prometheus.alertingRulesAdditionalLabels` | Additional labels to add to the prometheus rule object | `{}` | | `master.priorityClassName` | The name of a `priorityClass` to apply to the master pod | Not set | +| `master.testEnabled` | Can be used to disable rendering test resources when using helm template | `true` | | `networkPolicy.enabled` | Enable creation of NetworkPolicy resources. | `false` | | `networkPolicy.apiVersion` | NetworkPolicy ApiVersion | `networking.k8s.io/v1` | | `rbac.create` | Whether RBAC resources are created | `true` | diff --git a/stable/jenkins/templates/tests/jenkins-test.yaml b/stable/jenkins/templates/tests/jenkins-test.yaml index 51e79c6186..edf884bbe7 100644 --- a/stable/jenkins/templates/tests/jenkins-test.yaml +++ b/stable/jenkins/templates/tests/jenkins-test.yaml @@ -1,3 +1,4 @@ +{{- if .Values.master.testEnabled }} apiVersion: v1 kind: Pod metadata: @@ -48,3 +49,4 @@ spec: - name: tools emptyDir: {} restartPolicy: Never +{{- end }} diff --git a/stable/jenkins/templates/tests/test-config.yaml b/stable/jenkins/templates/tests/test-config.yaml index 8774da572d..509de7dedd 100644 --- a/stable/jenkins/templates/tests/test-config.yaml +++ b/stable/jenkins/templates/tests/test-config.yaml @@ -1,3 +1,4 @@ +{{- if .Values.master.testEnabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -8,3 +9,4 @@ data: @test "Testing Jenkins UI is accessible" { curl --retry 48 --retry-delay 10 {{ template "jenkins.fullname" . }}:{{ .Values.master.servicePort }}{{ default "" .Values.master.jenkinsUriPrefix }}/login } +{{- end }} diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index aa904980c4..732c9a45ab 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -353,6 +353,9 @@ master: # The `groups` root object is added by default, simply add the rule entries alertingrules: [] + # Can be used to disable rendering master test resources when using helm template + testEnabled: true + agent: enabled: true image: "jenkins/jnlp-slave"