Skip to content

Commit

Permalink
chore: Revise the default NATS Server address logic
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Bergius <[email protected]>
  • Loading branch information
joonas committed Sep 19, 2024
1 parent 5719f0e commit bccf3b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/wadm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "0.2.6"
version: "0.3.0"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
9 changes: 9 additions & 0 deletions charts/wadm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ app.kubernetes.io/name: {{ include "wadm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "wadm.nats.server" -}}
- name: WADM_NATS_SERVER
{{- if .Values.wadm.config.nats.server }}
value: {{ .Values.wadm.config.nats.server | quote }}
{{- else }}
value: nats-headless.{{ .Release.Namespace }}.svc.cluster.local
{{- end }}
{{- end }}

{{- define "wadm.nats.auth" -}}
{{- if .Values.wadm.config.nats.creds.secretName -}}
- name: WADM_NATS_CREDS_FILE
Expand Down
3 changes: 1 addition & 2 deletions charts/wadm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ spec:
image: "{{ .Values.wadm.image.repository }}:{{ .Values.wadm.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.wadm.image.pullPolicy }}
env:
- name: WADM_NATS_SERVER
value: {{ .Values.wadm.config.nats.server | quote }}
{{- include "wadm.nats.server" . | nindent 12 }}
{{- include "wadm.nats.auth" . | nindent 12 }}
{{- if .Values.wadm.config.nats.tlsCaFile }}
- name: WADM_NATS_TLS_CA_FILE
Expand Down
2 changes: 1 addition & 1 deletion charts/wadm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wadm:
hostId: ""
logLevel: ""
nats:
server: "127.0.0.1:4222"
server: ""
jetstreamDomain: ""
tlsCaFile: ""
creds:
Expand Down

0 comments on commit bccf3b3

Please sign in to comment.