diff --git a/library/common/1.0.0/templates/class/_service.tpl b/library/common/1.0.0/templates/class/_service.tpl index 939311cb..a8d973e6 100644 --- a/library/common/1.0.0/templates/class/_service.tpl +++ b/library/common/1.0.0/templates/class/_service.tpl @@ -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: */}} diff --git a/library/common/1.0.0/templates/lib/container/_env_vars.tpl b/library/common/1.0.0/templates/lib/container/_env_vars.tpl index 12daa1de..6fbec094 100644 --- a/library/common/1.0.0/templates/lib/container/_env_vars.tpl +++ b/library/common/1.0.0/templates/lib/container/_env_vars.tpl @@ -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 }} diff --git a/library/common/1.0.0/templates/lib/container/_ports.tpl b/library/common/1.0.0/templates/lib/container/_ports.tpl index 6e00c83a..00338bdd 100644 --- a/library/common/1.0.0/templates/lib/container/_ports.tpl +++ b/library/common/1.0.0/templates/lib/container/_ports.tpl @@ -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 diff --git a/library/common/1.0.0/templates/lib/container/_termination.tpl b/library/common/1.0.0/templates/lib/container/_termination.tpl index 5e8d8ee1..7cf48810 100644 --- a/library/common/1.0.0/templates/lib/container/_termination.tpl +++ b/library/common/1.0.0/templates/lib/container/_termination.tpl @@ -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 }} diff --git a/library/common/1.0.0/templates/lib/controller/_volumes.tpl b/library/common/1.0.0/templates/lib/controller/_volumes.tpl index ffed0244..ede3f134 100644 --- a/library/common/1.0.0/templates/lib/controller/_volumes.tpl +++ b/library/common/1.0.0/templates/lib/controller/_volumes.tpl @@ -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 */}} diff --git a/library/common/1.0.0/templates/pods/_deployment.tpl b/library/common/1.0.0/templates/pods/_deployment.tpl index a0d80be2..3d7ecab6 100644 --- a/library/common/1.0.0/templates/pods/_deployment.tpl +++ b/library/common/1.0.0/templates/pods/_deployment.tpl @@ -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: