Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions resources/charts/bitcoincore/charts/lnd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ Create a hex-encoded RGB color derived from the namespace
{{- printf "#%s" (substr 0 6 $hash) -}}
{{- end -}}

{{/*
Data to init wallet with root key if lnd >= v0.16.0-beta
*/}}
{{- define "lnd.initwalletData" -}}
{{- $tag := .Values.image.tag -}}
{{- $supportsRootKey := semverCompare ">=0.16.0-beta" $tag -}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be great if you could add a 0.15.5 node in one of the tests so we can see this work in CI

{{- if $supportsRootKey -}}
"{\"macaroon_root_key\":\"{{ .Values.macaroonRootKey }}\", \"wallet_password\":\"AAAAAAAAAAA=\", \"cipher_seed_mnemonic\": $PHRASE}"
{{- else -}}
"{\"wallet_password\":\"AAAAAAAAAAA=\", \"cipher_seed_mnemonic\": $PHRASE}"
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion resources/charts/bitcoincore/charts/lnd/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:

PHRASE=$(cat /tmp/genseed.json | grep -o '\[[^]]*\]')

until curl --fail --insecure https://localhost:8080/v1/initwallet --data "{\"macaroon_root_key\":\"{{ .Values.macaroonRootKey }}\", \"wallet_password\":\"AAAAAAAAAAA=\", \"cipher_seed_mnemonic\": $PHRASE}"; do
until curl --fail --insecure https://localhost:8080/v1/initwallet --data {{ include "lnd.initwalletData" . }}; do
sleep 5
done
resources:
Expand Down
Loading