Skip to content

Commit

Permalink
Allow templating in jenkins.url template (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceddaerrix authored Oct 12, 2023
1 parent 1662ed1 commit f60c959
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
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.1
version: 4.7.2
appVersion: 2.414.2
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
4 changes: 2 additions & 2 deletions charts/jenkins/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ Returns the Jenkins URL
{{- else }}
{{- if .Values.controller.ingress.hostName }}
{{- if .Values.controller.ingress.tls }}
{{- default "https" .Values.controller.jenkinsUrlProtocol }}://{{ .Values.controller.ingress.hostName }}{{ default "" .Values.controller.jenkinsUriPrefix }}
{{- default "https" .Values.controller.jenkinsUrlProtocol }}://{{ tpl .Values.controller.ingress.hostName $ }}{{ default "" .Values.controller.jenkinsUriPrefix }}
{{- else }}
{{- default "http" .Values.controller.jenkinsUrlProtocol }}://{{ .Values.controller.ingress.hostName }}{{ default "" .Values.controller.jenkinsUriPrefix }}
{{- default "http" .Values.controller.jenkinsUrlProtocol }}://{{ tpl .Values.controller.ingress.hostName $ }}{{ default "" .Values.controller.jenkinsUriPrefix }}
{{- end }}
{{- else }}
{{- default "http" .Values.controller.jenkinsUrlProtocol }}://{{ template "jenkins.fullname" . }}:{{.Values.controller.servicePort}}{{ default "" .Values.controller.jenkinsUriPrefix }}
Expand Down
26 changes: 26 additions & 0 deletions charts/jenkins/unittests/jenkins-controller-ingress-DRY-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
suite: Controller Ingress - DRY Support
release:
name: my-release
namespace: my-namespace
templates:
- jenkins-controller-ingress.yaml
- jcasc-config.yaml
tests:
- it: controller-ingress
template: jenkins-controller-ingress.yaml
set:
global.jenkinsHostname: "jenkins.example.com"
controller.ingress:
enabled: true
hostName: "{{ .Values.global.jenkinsHostname }}"
resourceRootUrl: "{{ .Values.global.jenkinsHostname }}"
tls:
- hosts:
- "{{ .Values.global.jenkinsHostname }}"
asserts:
- equal:
path: spec.rules[0].host
value: "jenkins.example.com"
- equal:
path: spec.tls[0].hosts[0]
value: "jenkins.example.com"

0 comments on commit f60c959

Please sign in to comment.