mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 00:45:26 -03:00
no need to recheck fallbackDefaults, we set it from the spawner.
This commit is contained in:
@@ -139,13 +139,9 @@
|
||||
{{- if eq $imageType "Postgres" -}}
|
||||
{{- $imageType = "" -}}
|
||||
{{- end -}}
|
||||
{{- $pgVersion := $rootCtx.Values.global.fallbackDefaults.pgVersion -}}
|
||||
{{- with $objectData.pgVersion -}}
|
||||
{{- $pgVersion = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Format is [postgresCustomNameVersionImage] */}}
|
||||
{{- $imageKey := printf "postgres%s%sImage" $imageType $pgVersion -}}
|
||||
{{- $imageKey := printf "postgres%s%sImage" $imageType $objectData.pgVersion -}}
|
||||
{{- $imageValue := fromJson (include "tc.v1.common.lib.container.imageSelector" (dict "rootCtx" $rootCtx "objectData" (dict "imageSelector" $imageKey))) -}}
|
||||
{{- $formatImage := printf "%s:%s" $imageValue.repository $imageValue.tag -}}
|
||||
|
||||
|
||||
@@ -8,16 +8,15 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (hasKey $objectData "version") -}}
|
||||
{{- if not (kindIs "string" $objectData.pgVersion) -}}
|
||||
{{/* We must ensure that this is a string, as it is used in image selector that require a string */}}
|
||||
{{- fail (printf "CNPG - Expected [pgVersion] to be a string, but got [%s]" (kindOf $objectData.pgVersion)) -}}
|
||||
{{- end -}}
|
||||
{{/* Kinda imposibble to happen, as we explicitly set it to string on the spawner */}}
|
||||
{{- if not (kindIs "string" $objectData.pgVersion) -}}
|
||||
{{/* We must ensure that this is a string, as it is used in image selector that require a string */}}
|
||||
{{- fail (printf "CNPG - Expected [pgVersion] to be a string, but got [%s]" (kindOf $objectData.pgVersion)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $validVersions := (list "15" "16") -}}
|
||||
{{- if not (mustHas $objectData.pgVersion $validVersions) -}}
|
||||
{{- fail (printf "CNPG - Expected [pgVersion] to be one of [%s], but got [%s]" (join ", " $validVersions) $objectData.pgVersion) -}}
|
||||
{{- end -}}
|
||||
{{- $validVersions := (list "15" "16") -}}
|
||||
{{- if not (mustHas $objectData.pgVersion $validVersions) -}}
|
||||
{{- fail (printf "CNPG - Expected [pgVersion] to be one of [%s], but got [%s]" (join ", " $validVersions) $objectData.pgVersion) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if (hasKey $objectData "hibernate") -}}
|
||||
|
||||
Reference in New Issue
Block a user