Skip to content

Commit

Permalink
Use consistent whitespace in template placeholders (helm#1437)
Browse files Browse the repository at this point in the history
Use consistent whitespace in template placeholders
  • Loading branch information
fhemberger authored and unguiculus committed Jul 9, 2017
1 parent d66484b commit cf13f6a
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion charts/jenkins/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{- else if contains "LoadBalancer" .Values.Master.ServiceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
echo http://$SERVICE_IP:{{ .Values.Master.ServicePort }}/login

{{- else if contains "ClusterIP" .Values.Master.ServiceType }}
Expand Down
16 changes: 8 additions & 8 deletions charts/jenkins/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data:
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<disabledAdministrativeMonitors/>
<version>{{.Values.Master.ImageTag}}</version>
<version>{{ .Values.Master.ImageTag }}</version>
<numExecutors>0</numExecutors>
<mode>NORMAL</mode>
<useSecurity>{{ .Values.Master.UseSecurity }}</useSecurity>
Expand All @@ -35,7 +35,7 @@ data:
<name>default</name>
<instanceCap>2147483647</instanceCap>
<idleMinutes>0</idleMinutes>
<label>{{.Release.Name}}-{{.Values.Agent.Component}}</label>
<label>{{ .Release.Name }}-{{ .Values.Agent.Component }}</label>
<nodeSelector></nodeSelector>
<volumes>
{{- range $index, $volume := .Values.Agent.volumes }}
Expand All @@ -60,10 +60,10 @@ data:
<command></command>
<args>${computer.jnlpmac} ${computer.name}</args>
<ttyEnabled>false</ttyEnabled>
<resourceRequestCpu>{{.Values.Agent.Cpu}}</resourceRequestCpu>
<resourceRequestMemory>{{.Values.Agent.Memory}}</resourceRequestMemory>
<resourceLimitCpu>{{.Values.Agent.Cpu}}</resourceLimitCpu>
<resourceLimitMemory>{{.Values.Agent.Memory}}</resourceLimitMemory>
<resourceRequestCpu>{{ .Values.Agent.Cpu }}</resourceRequestCpu>
<resourceRequestMemory>{{ .Values.Agent.Memory }}</resourceRequestMemory>
<resourceLimitCpu>{{ .Values.Agent.Cpu }}</resourceLimitCpu>
<resourceLimitMemory>{{ .Values.Agent.Memory }}</resourceLimitMemory>
<envVars/>
</org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
</containers>
Expand All @@ -77,7 +77,7 @@ data:
<serverUrl>https://kubernetes.default</serverUrl>
<skipTlsVerify>false</skipTlsVerify>
<namespace>{{ .Release.Namespace }}</namespace>
<jenkinsUrl>http://{{ template "fullname" . }}:{{.Values.Master.ServicePort}}</jenkinsUrl>
<jenkinsUrl>http://{{ template "fullname" . }}:{{ .Values.Master.ServicePort }}</jenkinsUrl>
<jenkinsTunnel>{{ template "fullname" . }}-agent:50000</jenkinsTunnel>
<containerCap>10</containerCap>
<retentionTimeout>5</retentionTimeout>
Expand Down Expand Up @@ -137,7 +137,7 @@ data:
{{- end }}
{{- range $key, $val := .Values.Master.InitScripts }}
init{{ $key }}.groovy: |-
{{ $val | indent 4}}
{{ $val | indent 4 }}
{{- end }}
plugins.txt: |-
{{- if .Values.Master.InstallPlugins }}
Expand Down
12 changes: 6 additions & 6 deletions charts/jenkins/templates/jenkins-agent-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{template "fullname" . }}-agent
name: {{ template "fullname" . }}-agent
labels:
app: {{ template "fullname" . }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
spec:
ports:
- port: {{.Values.Master.SlaveListenerPort}}
targetPort: {{.Values.Master.SlaveListenerPort}}
- port: {{ .Values.Master.SlaveListenerPort }}
targetPort: {{ .Values.Master.SlaveListenerPort }}
name: slavelistener
selector:
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
type: ClusterIP
36 changes: 18 additions & 18 deletions charts/jenkins/templates/jenkins-master-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
component: "{{.Release.Name}}-{{.Values.Master.Name}}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Release.Name }}-{{ .Values.Master.Name }}"
spec:
replicas: 1
strategy:
type: RollingUpdate
selector:
matchLabels:
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
template:
metadata:
labels:
app: {{ template "fullname" . }}
heritage: {{.Release.Service | quote }}
release: {{.Release.Name | quote }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
annotations:
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
pod.alpha.kubernetes.io/init-containers: '[
{
"name": "copy-default-config",
"image": "{{.Values.Master.Image}}:{{.Values.Master.ImageTag}}",
"imagePullPolicy": "{{.Values.Master.ImagePullPolicy}}",
"image": "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}",
"imagePullPolicy": "{{ .Values.Master.ImagePullPolicy }}",
"command": [ "sh", "/var/jenkins_config/apply_config.sh" ],
"volumeMounts": [
{
Expand Down Expand Up @@ -63,14 +63,14 @@ spec:
runAsUser: 0
containers:
- name: {{ template "fullname" . }}
image: "{{.Values.Master.Image}}:{{.Values.Master.ImageTag}}"
imagePullPolicy: "{{.Values.Master.ImagePullPolicy}}"
image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}"
imagePullPolicy: "{{ .Values.Master.ImagePullPolicy }}"
{{- if .Values.Master.UseSecurity }}
args: [ "--argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)", "--argumentsRealm.roles.$(ADMIN_USER)=admin"]
{{- end }}
env:
- name: JAVA_OPTS
value: "{{ default "" .Values.Master.JavaOpts}}"
value: "{{ default "" .Values.Master.JavaOpts }}"
{{- if .Values.Master.UseSecurity }}
- name: ADMIN_PASSWORD
valueFrom:
Expand All @@ -84,18 +84,18 @@ spec:
key: jenkins-admin-user
{{- end }}
ports:
- containerPort: {{.Values.Master.ContainerPort}}
- containerPort: {{ .Values.Master.ContainerPort }}
name: http
- containerPort: {{.Values.Master.SlaveListenerPort}}
- containerPort: {{ .Values.Master.SlaveListenerPort }}
name: slavelistener
{{- if .Values.Master.JMXPort }}
- containerPort: {{ .Values.Master.JMXPort }}
name: jmx
{{- end }}
resources:
requests:
cpu: "{{.Values.Master.Cpu}}"
memory: "{{.Values.Master.Memory}}"
cpu: "{{ .Values.Master.Cpu }}"
memory: "{{ .Values.Master.Memory }}"
volumeMounts:
{{- if .Values.Persistence.mounts }}
{{ toYaml .Values.Persistence.mounts | indent 12 }}
Expand Down
14 changes: 7 additions & 7 deletions charts/jenkins/templates/jenkins-master-networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
kind: NetworkPolicy
apiVersion: {{ .Values.NetworkPolicy.ApiVersion }}
metadata:
name: "{{.Release.Name}}-{{.Values.Master.Component}}"
name: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
spec:
podSelector:
matchLabels:
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
component: "{{ .Release.Name }}-{{ .Values.Master.Component }}"
ingress:
# Allow web access to the UI
- ports:
- port: {{.Values.Master.ContainerPort}}
- port: {{ .Values.Master.ContainerPort }}
# Allow inbound connections from slave
- from:
- podSelector:
matchLabels:
"jenkins/{{.Release.Name}}-{{.Values.Agent.Component}}": "true"
"jenkins/{{ .Release.Name }}-{{ .Values.Agent.Component }}": "true"
ports:
- port: {{.Values.Master.SlaveListenerPort}}
- port: {{ .Values.Master.SlaveListenerPort }}
{{- if .Values.Agent.Enabled }}
---
kind: NetworkPolicy
apiVersion: {{ .Values.NetworkPolicy.ApiVersion }}
metadata:
name: "{{.Release.Name}}-{{.Values.Agent.Component}}"
name: "{{ .Release.Name }}-{{ .Values.Agent.Component }}"
spec:
podSelector:
matchLabels:
# DefaultDeny
"jenkins/{{.Release.Name}}-{{.Values.Agent.Component}}": "true"
"jenkins/{{ .Release.Name }}-{{ .Values.Agent.Component }}": "true"
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/jenkins/templates/jenkins-master-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
component: "{{.Release.Name}}-{{.Values.Master.Component}}"
{{- if .Values.Master.ServiceAnnotations }}
annotations:
{{ toYaml .Values.Master.ServiceAnnotations | indent 4}}
{{ toYaml .Values.Master.ServiceAnnotations | indent 4 }}
{{- end }}
spec:
ports:
Expand Down
6 changes: 3 additions & 3 deletions charts/jenkins/templates/jenkins-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{.Release.Name}}-ui-test-{{ randAlphaNum 5 | lower }}"
name: "{{ .Release.Name }}-ui-test-{{ randAlphaNum 5 | lower }}"
annotations:
"helm.sh/hook": test-success
"pod.beta.kubernetes.io/init-containers": '[
Expand All @@ -28,8 +28,8 @@ spec:
{{ toYaml .Values.Master.Tolerations | indent 4 }}
{{- end }}
containers:
- name: {{.Release.Name}}-ui-test
image: {{.Values.Master.Image}}:{{.Values.Master.ImageTag}}
- name: {{ .Release.Name }}-ui-test
image: {{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}
command: ["/tools/bats/bats", "-t", "/tests/run.sh"]
volumeMounts:
- mountPath: /tests
Expand Down
4 changes: 2 additions & 2 deletions charts/jenkins/templates/test-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ metadata:
data:
run.sh: |-
@test "Testing Jenkins UI is accessible" {
curl --retry 12 --retry-delay 10 {{.Release.Name}}-jenkins:8080/login
}
curl --retry 12 --retry-delay 10 {{ .Release.Name }}-jenkins:8080/login
}

0 comments on commit cf13f6a

Please sign in to comment.