diff --git a/library/common-test/tests/volumeClaimTemplate/metadata_test.yaml b/library/common-test/tests/volumeClaimTemplate/metadata_test.yaml index 80d1d0ea..65fdfcf6 100644 --- a/library/common-test/tests/volumeClaimTemplate/metadata_test.yaml +++ b/library/common-test/tests/volumeClaimTemplate/metadata_test.yaml @@ -7,16 +7,12 @@ tests: - it: should pass with vct created with labels and annotations set: label1: label1 - label2: global_label2 annotation1: annotation1 - annotation2: global_annotation2 global: labels: g_label1: global_label1 - g_label2: "{{ .Values.label2 }}" annotations: g_annotation1: global_annotation1 - g_annotation2: "{{ .Values.annotation2 }}" volumeClaimTemplates: my-volume1: enabled: true @@ -45,19 +41,9 @@ tests: value: annotation1: annotation1 annotation2: annotation2 - g_annotation1: global_annotation1 - g_annotation2: global_annotation2 - documentIndex: *statefulSetDoc equal: path: spec.volumeClaimTemplates[0].metadata.labels value: - app: common-test-1.0.0 - release: RELEASE-NAME - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: *appVer - g_label1: global_label1 - g_label2: global_label2 label1: label1 label2: label2 diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 0febfab5..f5e27e9c 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.2.20 +version: 12.2.21 diff --git a/library/common/templates/class/_service.tpl b/library/common/templates/class/_service.tpl index 1f43013e..9ae02cab 100644 --- a/library/common/templates/class/_service.tpl +++ b/library/common/templates/class/_service.tpl @@ -28,6 +28,10 @@ objectData: The service data, that will be used to render the Service object. {{- if $podValues -}} {{/* Get Pod hostNetwork configuration */}} {{- $hostNetwork = include "tc.v1.common.lib.pod.hostNetwork" (dict "rootCtx" $rootCtx "objectData" $podValues) -}} + {{/* When hostNetwork is set on the pod, force ClusterIP, so services wont try to bind the same ports on the host */}} + {{- if or (and (kindIs "bool" $hostNetwork) $hostNetwork) (and (kindIs "string" $hostNetwork) (eq $hostNetwork "true")) -}} + {{- $svcType = "ClusterIP" -}} + {{- end -}} {{- end -}} {{- range $portName, $port := $objectData.ports -}} @@ -42,11 +46,6 @@ objectData: The service data, that will be used to render the Service object. {{- end -}} {{- end -}} - {{/* When hostNetwork is set on the pod, force ClusterIP, so services wont try to bind the same ports on the host */}} - {{- if or (and (kindIs "bool" $hostNetwork) $hostNetwork) (and (kindIs "string" $hostNetwork) (eq $hostNetwork "true")) -}} - {{- $svcType = "ClusterIP" -}} - {{- end -}} - {{/* When hostPort is defined, force ClusterIP aswell */}} {{- if $hasHostPort -}} {{- $svcType = "ClusterIP" -}}