Skip to content

Commit 0823cae

Browse files
committed
LN: configure "color" based on namespace
1 parent 782e9e4 commit 0823cae

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

resources/charts/bitcoincore/charts/lnd/templates/_helpers.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,12 @@ Create the name of the service account to use
7676
{{- default "default" .Values.serviceAccount.name }}
7777
{{- end }}
7878
{{- end }}
79+
80+
{{/*
81+
Create a hex-encoded RGB color derived from the namespace
82+
*/}}
83+
{{- define "namespace.color" -}}
84+
{{- $hash := sha256sum .Release.Namespace -}}
85+
{{- printf "#%s" (substr 0 6 $hash) -}}
86+
{{- end -}}
87+

resources/charts/bitcoincore/charts/lnd/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ data:
1616
bitcoind.zmqpubrawblock=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQBlockPort }}
1717
bitcoind.zmqpubrawtx=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQTxPort }}
1818
alias={{ include "lnd.fullname" . }}.{{ .Release.Namespace }}
19+
color={{ include "namespace.color" . }}
1920
externalhosts={{ include "lnd.fullname" . }}
2021
tlsextradomain={{ include "lnd.fullname" . }}
2122
tls.cert: |

0 commit comments

Comments
 (0)