From d3f9c9823942f3eb7a6b36de5abedb9a9899c41c Mon Sep 17 00:00:00 2001 From: Semih Buyukgungor Date: Thu, 4 Jan 2024 13:28:34 +0300 Subject: [PATCH] [CN-1109] Make the discovery plugin service-name config nil-aware (#414) --- stable/hazelcast-enterprise/templates/_helpers.tpl | 9 ++++++--- stable/hazelcast/templates/_helpers.tpl | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/stable/hazelcast-enterprise/templates/_helpers.tpl b/stable/hazelcast-enterprise/templates/_helpers.tpl index 5a360d32..edcb31ae 100644 --- a/stable/hazelcast-enterprise/templates/_helpers.tpl +++ b/stable/hazelcast-enterprise/templates/_helpers.tpl @@ -57,9 +57,12 @@ Create the name of the service to use Create the config of the service-name to use */}} {{- define "hazelcast.serviceNameConfig" -}} -{{- if or (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-dns") - (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-label-name") - (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "pod-label-name") -}} +{{- if and ((((((.Values.hazelcast).yaml).hazelcast).network).join).kubernetes) + (or + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-dns") + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-label-name") + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "pod-label-name") + ) -}} {{ default "" }} {{- else -}} {{ template "hazelcast.serviceName" .}} diff --git a/stable/hazelcast/templates/_helpers.tpl b/stable/hazelcast/templates/_helpers.tpl index 5a360d32..edcb31ae 100644 --- a/stable/hazelcast/templates/_helpers.tpl +++ b/stable/hazelcast/templates/_helpers.tpl @@ -57,9 +57,12 @@ Create the name of the service to use Create the config of the service-name to use */}} {{- define "hazelcast.serviceNameConfig" -}} -{{- if or (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-dns") - (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-label-name") - (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "pod-label-name") -}} +{{- if and ((((((.Values.hazelcast).yaml).hazelcast).network).join).kubernetes) + (or + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-dns") + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "service-label-name") + (index .Values.hazelcast.yaml.hazelcast.network.join.kubernetes "pod-label-name") + ) -}} {{ default "" }} {{- else -}} {{ template "hazelcast.serviceName" .}}