Skip to content

Commit

Permalink
fix(*): add searches and options for None policy (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhizhen authored Feb 4, 2021
1 parent c1e3767 commit b545acd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
18 changes: 14 additions & 4 deletions templates/1.0.0/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@
{{- define "podspec" -}}
{{- $controller := index . 0 -}}
{{- $name := index . 1 -}}
{{- $namespace := index . 2 -}}

{{- with $controller.pod }}
restartPolicy: {{ .restart | quote }}
dnsPolicy: {{ .dns | quote }}
{{- if eq .dns "None" }}
dnsConfig:
nameservers:
{{- range .nameservers }}
- {{ . }}
{{- end }}
nameservers:
{{- range .nameservers }}
- {{ . }}
{{- end }}
searches:
- {{ $namespace }}.svc.cluster.local
- svc.cluster.local
- cluster.local
options:
- name: ndots
value: "5"
{{- end }}
hostname: {{ .hostname | quote }}
subdomain: {{ .subdomain | quote }}
terminationGracePeriodSeconds: {{ .termination }}
Expand Down
2 changes: 1 addition & 1 deletion templates/1.0.0/templates/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
annotations:
{{- include "annotations" $controller.pod | indent 12 }}
spec:
{{- include "podspec" (list $controller $controllerName) | indent 10 }}
{{- include "podspec" (list $controller $controllerName $g.Release.Namespace) | indent 10 }}
{{- end }}
---

Expand Down
2 changes: 1 addition & 1 deletion templates/1.0.0/templates/daemonsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
annotations:
{{- include "annotations" $controller.pod | indent 8 }}
spec:
{{- include "podspec" (list $controller $controllerName) | indent 6 }}
{{- include "podspec" (list $controller $controllerName $g.Release.Namespace) | indent 6 }}
{{- end }}
---

Expand Down
2 changes: 1 addition & 1 deletion templates/1.0.0/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
annotations:
{{- include "annotations" $controller.pod | indent 8 }}
spec:
{{- include "podspec" (list $controller $controllerName) | indent 6 }}
{{- include "podspec" (list $controller $controllerName $g.Release.Namespace) | indent 6 }}
{{- end }}
---

Expand Down
2 changes: 1 addition & 1 deletion templates/1.0.0/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
annotations:
{{- include "annotations" $controller.pod | indent 8 }}
spec:
{{- include "podspec" (list $controller $controllerName) | indent 6 }}
{{- include "podspec" (list $controller $controllerName $g.Release.Namespace) | indent 6 }}
{{- end }}
---

Expand Down
2 changes: 1 addition & 1 deletion templates/1.0.0/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
annotations:
{{- include "annotations" $controller.pod | indent 8 }}
spec:
{{- include "podspec" (list $controller $controllerName) | indent 6 }}
{{- include "podspec" (list $controller $controllerName $g.Release.Namespace) | indent 6 }}
volumeClaimTemplates:
{{- include "dedicated" (list $g $controllerName $controller.volumes) | indent 2 }}
---
Expand Down

0 comments on commit b545acd

Please sign in to comment.