diff --git a/library/common/1.0.0/templates/class/_service.tpl b/library/common/1.0.0/templates/class/_service.tpl index 49d9445ad6..c32446f67c 100644 --- a/library/common/1.0.0/templates/class/_service.tpl +++ b/library/common/1.0.0/templates/class/_service.tpl @@ -23,7 +23,7 @@ objectData: The service data, that will be used to render the Service object. {{/* External Name / External IP does not rely on any pod values */}} {{- if not (mustHas $svcType $specialTypes) -}} {{/* Get Pod Values based on the selector (or the absence of it) */}} - {{- $podValues = fromJson (include "ix.v1.common.lib.service.getSelectedPodValues" (dict "rootCtx" $rootCtx "objectData" $objectData)) -}} + {{- $podValues = fromJson (include "ix.v1.common.lib.helpers.getSelectedPodValues" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Service")) -}} {{- if $podValues -}} {{/* Get Pod hostNetwork configuration */}} diff --git a/library/common/1.0.0/templates/lib/service/_getSelectedPod.tpl b/library/common/1.0.0/templates/helpers/_getSelectedPod.tpl similarity index 82% rename from library/common/1.0.0/templates/lib/service/_getSelectedPod.tpl rename to library/common/1.0.0/templates/helpers/_getSelectedPod.tpl index f616b1f453..886b134610 100644 --- a/library/common/1.0.0/templates/lib/service/_getSelectedPod.tpl +++ b/library/common/1.0.0/templates/helpers/_getSelectedPod.tpl @@ -1,24 +1,25 @@ {{/* Service - Get Selected Pod */}} {{/* Call this template: -{{ include "ix.v1.common.lib.service.getSelectedPodValues" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} +{{ include "ix.v1.common.lib.helpers.getSelectedPodValues" (dict "rootCtx" $rootCtx "objectData" $objectData) -}} objectData: The object data of the service rootCtx: The root context of the chart. */}} -{{- define "ix.v1.common.lib.service.getSelectedPodValues" -}} +{{- define "ix.v1.common.lib.helpers.getSelectedPodValues" -}} {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData -}} + {{- $caller := .caller -}} {{- $podValues := dict -}} {{- with $objectData.targetSelector -}} {{- $podValues = mustDeepCopy (get $rootCtx.Values.workload .) -}} {{- if not $podValues -}} - {{- fail (printf "Service - Selected pod [%s] is not defined" .) -}} + {{- fail (printf "%s - Selected pod [%s] is not defined" $caller .) -}} {{- end -}} {{- if not $podValues.enabled -}} - {{- fail (printf "Service - Selected pod [%s] is not enabled" .) -}} + {{- fail (printf "%s - Selected pod [%s] is not enabled" $caller .) -}} {{- end -}} {{/* While we know the shortName from targetSelector, let's set it explicitly