From e5dbb653b63b3a82a3e75c888bdcea120b0cde12 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 28 Sep 2023 17:22:35 +0200 Subject: [PATCH] fix(jenkinsio) ensure default values are valid. Closes #658. Signed-off-by: Damien Duportal --- charts/jenkinsio/Chart.yaml | 2 +- charts/jenkinsio/tests/custom_values.yaml | 30 +++++++++++++++++++ .../jenkinsio/tests/defaults_values_test.yaml | 27 +++++++++++++++++ charts/jenkinsio/values.yaml | 4 ++- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 charts/jenkinsio/tests/custom_values.yaml create mode 100644 charts/jenkinsio/tests/defaults_values_test.yaml diff --git a/charts/jenkinsio/Chart.yaml b/charts/jenkinsio/Chart.yaml index 5975fd52c..ccdc217b1 100644 --- a/charts/jenkinsio/Chart.yaml +++ b/charts/jenkinsio/Chart.yaml @@ -4,4 +4,4 @@ maintainers: - name: timja - name: dduportal name: jenkinsio -version: 0.6.0 +version: 0.6.1 diff --git a/charts/jenkinsio/tests/custom_values.yaml b/charts/jenkinsio/tests/custom_values.yaml new file mode 100644 index 000000000..46ed08623 --- /dev/null +++ b/charts/jenkinsio/tests/custom_values.yaml @@ -0,0 +1,30 @@ +suite: Test with custom values +# templates: +# - deployment.yaml +# - ingress.yaml +# - nginx-configmap.yaml # Direct dependency of deployment.yaml +tests: +# - it: should create an ingress when ingress.enabled is true +# set: +# ingress: +# enabled: true +# template: ingress.yaml +# asserts: +# - hasDocuments: +# count: 1 +# - it: should mount the html volume when htmlVolume is set +# template: deployment.yaml +# set: +# htmlVolume: +# hostPath: /host +# asserts: +# - hasDocuments: +# count: 1 +# - isKind: +# of: Deployment +# - equal: +# path: spec.template.spec.volumes[0].name +# value: html +# - equal: +# path: spec.template.spec.volumes[0].hostPath +# value: /host diff --git a/charts/jenkinsio/tests/defaults_values_test.yaml b/charts/jenkinsio/tests/defaults_values_test.yaml new file mode 100644 index 000000000..f2efcd983 --- /dev/null +++ b/charts/jenkinsio/tests/defaults_values_test.yaml @@ -0,0 +1,27 @@ +suite: Test with default values +templates: + - deployment.yaml + - zh-deployment.yaml + - zh-configmap.yaml + - nginx-configmap.yaml +tests: + - it: should create a deployment for jenkins.io with default values + template: deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio + - it: should create a deployment for zh.jenkins.io with default values + template: zh-deployment.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-jenkinsio-zh diff --git a/charts/jenkinsio/values.yaml b/charts/jenkinsio/values.yaml index ed7c161a4..82fc6480c 100644 --- a/charts/jenkinsio/values.yaml +++ b/charts/jenkinsio/values.yaml @@ -35,7 +35,7 @@ ingress: # - secretName: plugins-tls # hosts: # - plugins.jenkins.io -resources: +resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -50,5 +50,7 @@ nodeSelector: {} tolerations: [] affinity: {} htmlVolume: + emptyDir: {} zhHtmlVolume: + emptyDir: {} forceJenkinsIoHost: false