From e5855f22154bc6098ca7e305efa34c84222f51d0 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 1 Dec 2022 19:49:10 +0200 Subject: [PATCH] use replace hardcoded deafultservicetype --- library/common/1.0.0/templates/class/_service.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/common/1.0.0/templates/class/_service.tpl b/library/common/1.0.0/templates/class/_service.tpl index abb9009dab..f679bbeb91 100644 --- a/library/common/1.0.0/templates/class/_service.tpl +++ b/library/common/1.0.0/templates/class/_service.tpl @@ -3,14 +3,14 @@ {{- define "ix.v1.common.class.service" -}} {{- $svcValues := .svc -}} {{- $root := .root -}} - + {{- $defaultServiceType := $root.Values.global.ixChartContext.defaultServiceType -}} {{- $svcName := include "ix.v1.common.names.fullname" $root -}} {{- if and (hasKey $svcValues "nameOverride") $svcValues.nameOverride -}} {{- $svcName = (printf "%v-%v" $svcName $svcValues.nameOverride) -}} {{- end -}} - {{- $svcType := $svcValues.type | default "ClusterIP" -}} + {{- $svcType := $svcValues.type | default $defaultServiceType -}} {{- if $root.Values.hostNetwork -}} {{- $svcType = "ClusterIP" -}} {{/* When hostNetwork is enabled, force ClusterIP as service type */}} {{- end -}}