mirror of
https://github.com/truenas/charts.git
synced 2026-06-18 09:37:12 +08:00
make some if statements better
This commit is contained in:
@@ -65,7 +65,7 @@ ports:
|
||||
- port: {{ $port.port }}
|
||||
targetPort: {{ $port.targetPort | default $name }}
|
||||
{{- if $port.protocol -}}
|
||||
{{- if or (eq $port.protocol "HTTP") (eq $port.protocol "HTTPS") (eq $port.protocol "TCP") }}
|
||||
{{- if has $port.protocol (list "HTTP" "HTTPS" "TCP") }}
|
||||
protocol: TCP
|
||||
{{- else }}
|
||||
protocol: {{ $port.protocol }}
|
||||
@@ -79,7 +79,7 @@ ports:
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if and (ne $svcType "ExternalName") (ne $svcType "ExternalIP") }}
|
||||
{{- if not (has $svcType (list "ExternalName" "ExternalIP")) }}
|
||||
selector:
|
||||
{{- with $svcValues.selector }}
|
||||
{{/*TODO: */}}
|
||||
|
||||
@@ -22,7 +22,7 @@ That's why the custom dict is expected.
|
||||
{{- end }}
|
||||
- name: {{ $name | quote }}
|
||||
{{- if not (kindIs "map" $value) -}}
|
||||
{{- if or (kindIs "string" $value) -}} {{/* Single values are parsed as string (eg. int, bool) */}}
|
||||
{{- if kindIs "string" $value -}} {{/* Single values are parsed as string (eg. int, bool) */}}
|
||||
{{- $value = tpl $value $root -}} {{/* Expand Value */}}
|
||||
{{- end }}
|
||||
value: {{ quote $value }}
|
||||
|
||||
@@ -28,7 +28,7 @@ can be dynamically configured via an env var.
|
||||
{{- end }}
|
||||
containerPort: {{ default .port .targetPort }}
|
||||
{{- with .protocol }}
|
||||
{{- if or (eq . "HTTP") (eq . "HTTPS") (eq . "TCP") }}
|
||||
{{- if has . (list "HTTP" "HTTPS" "TCP") }}
|
||||
protocol: TCP
|
||||
{{- else if (eq . "UDP") }}
|
||||
protocol: UDP
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{- define "ix.v1.common.container.termination.messagePolicy" -}}
|
||||
{{- $policy := (tpl .Values.termination.messagePolicy $) -}}
|
||||
{{- with $policy -}}
|
||||
{{- if and (ne . "File") (ne . "FallbackToLogsOnError") }}
|
||||
{{- if not (has . (list "File" "FallbackToLogsOnError")) }}
|
||||
{{- fail "Not valid option for messagePolicy" -}}
|
||||
{{- end }}
|
||||
{{- $policy }}
|
||||
|
||||
@@ -47,7 +47,7 @@ you can specify a size for memory backed volumes.
|
||||
sizeLimit: {{ tpl . $ }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if or (eq $persistence.type "configMap") (eq $persistence.type "secret") }}
|
||||
{{- else if has $persistence.type (list "configMap" "secret") }}
|
||||
{{- $objectName := (required (printf "objectName not set for persistence item %s" (toString $index)) $persistence.objectName) }}
|
||||
{{- $objectName = tpl $objectName $ }}
|
||||
{{- if eq $persistence.type "configMap" }} {{/* configMap */}}
|
||||
|
||||
@@ -18,7 +18,7 @@ spec:
|
||||
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
|
||||
replicas: {{ .Values.controller.replicas }}
|
||||
{{- $strategy := default "Recreate" .Values.controller.strategy }}
|
||||
{{- if and (ne $strategy "Recreate") (ne $strategy "RollingUpdate") }}
|
||||
{{- if not (has $strategy (list "Recreate" "RollingUpdate")) }}
|
||||
{{- fail (printf "Not a valid strategy type for Deployment (%s)" $strategy) }}
|
||||
{{- end }}
|
||||
strategy:
|
||||
|
||||
Reference in New Issue
Block a user