Describe the bug
When using fullnameOverride, service names and discovery still use the default masterService value instead of respecting fullnameOverride.
The masterService template correctly handles fullnameOverride:
|
{{- define "opensearch.masterService" -}} |
|
{{- if empty .Values.masterService -}} |
|
{{- if empty .Values.fullnameOverride -}} |
|
{{- if empty .Values.nameOverride -}} |
|
{{ .Values.clusterName }}-master |
|
{{- else -}} |
|
{{ .Values.nameOverride }}-master |
|
{{- end -}} |
|
{{- else -}} |
|
{{ .Values.fullnameOverride }} |
|
{{- end -}} |
|
{{- else -}} |
|
{{ .Values.masterService }} |
|
{{- end -}} |
|
{{- end -}} |
However, values.yaml defaults masterService to a non-empty value:
|
masterService: "opensearch-cluster-master" |
Since it's not empty, the if empty .Values.masterService condition is always false and the fullnameOverride logic is never reached.
To Reproduce
helm template opensearch opensearch/opensearch --set fullnameOverride=opensearch | grep -E "kind: Service" -A3 | grep "name:"
Output:
name: opensearch-cluster-master
name: opensearch-cluster-master-headless
The fullnameOverride=opensearch is ignored.
Expected behaviour
Services should be named opensearch and opensearch-headless.
Proposed fix
Change the default masterService in values.yaml from "opensearch-cluster-master" to "", allowing the template to derive it from fullnameOverride when set.
Chart Name
opensearch (version 3.4.0)
Additional context
Related to #92 and PR #185, which fixed the template logic but didn't address the default value.
I'm happy to submit a PR with the fix if this approach is acceptable.
Describe the bug
When using
fullnameOverride, service names and discovery still use the defaultmasterServicevalue instead of respectingfullnameOverride.The
masterServicetemplate correctly handlesfullnameOverride:helm-charts/charts/opensearch/templates/_helpers.tpl
Lines 65 to 79 in faa0693
However,
values.yamldefaultsmasterServiceto a non-empty value:helm-charts/charts/opensearch/values.yaml
Line 12 in faa0693
Since it's not empty, the
if empty .Values.masterServicecondition is always false and thefullnameOverridelogic is never reached.To Reproduce
Output:
The
fullnameOverride=opensearchis ignored.Expected behaviour
Services should be named
opensearchandopensearch-headless.Proposed fix
Change the default
masterServiceinvalues.yamlfrom"opensearch-cluster-master"to"", allowing the template to derive it fromfullnameOverridewhen set.Chart Name
opensearch (version 3.4.0)
Additional context
Related to #92 and PR #185, which fixed the template logic but didn't address the default value.
I'm happy to submit a PR with the fix if this approach is acceptable.