diff --git a/charts/celestia-node/Chart.yaml b/charts/celestia-node/Chart.yaml index 3367805..8c5e5b3 100644 --- a/charts/celestia-node/Chart.yaml +++ b/charts/celestia-node/Chart.yaml @@ -21,4 +21,4 @@ maintainers: name: celestia-node sources: - https://github.com/celestiaorg/celestia-node -version: 0.1.3 +version: 0.1.4 diff --git a/charts/celestia-node/templates/NOTES.txt b/charts/celestia-node/templates/NOTES.txt index 8c9c171..4bcd238 100644 --- a/charts/celestia-node/templates/NOTES.txt +++ b/charts/celestia-node/templates/NOTES.txt @@ -28,5 +28,9 @@ In order to replicate the container startup scripts execute this command: {{- end }} -{{- include "common.warnings.rollingTag" .Values.node.image }} -{{- include "node.validateValues" . }} +{{- "\n" -}} +{{- include "common.warnings.rollingTag" .Values.node.image -}} +{{- "\n" -}} +{{- include "node.deprecationWarnings" . -}} +{{- "\n" -}} +{{- include "node.validateValues" . -}} diff --git a/charts/celestia-node/templates/_helpers.tpl b/charts/celestia-node/templates/_helpers.tpl index 7b95dd9..111fae3 100644 --- a/charts/celestia-node/templates/_helpers.tpl +++ b/charts/celestia-node/templates/_helpers.tpl @@ -42,16 +42,18 @@ Generate the args for the node container based on the nodeType setting */}} {{- define "node.containerArgs" -}} {{- if .Values.node.args -}} - {{- .Values.node.args -}} + {{- .Values.node.args | toYaml -}} {{- else -}} {{- $nodeType := .Values.node.settings.nodeType | default "bridge" -}} - {{- $args := list $nodeType -}} - {{- $args := append $args "start" -}} + {{- $args := list (printf "%s" $nodeType) -}} + {{- $args := append $args (printf "start") -}} {{- $args := append $args (printf "--node.store=$(CELESTIA_HOME)") -}} {{- if .Values.node.extraArgs -}} - {{- $args := append $args .Values.node.extraArgs -}} + {{- range .Values.node.extraArgs -}} + {{- $args = append $args (printf "%s" .) -}} + {{- end -}} {{- end -}} - {{- $args -}} + {{- $args | toYaml -}} {{- end -}} {{- end -}} @@ -64,17 +66,34 @@ Node type is not set. Must be one of 'bridge', 'full', or 'light'. {{- else if and (ne .Values.node.settings.nodeType "bridge") (ne .Values.node.settings.nodeType "full") (ne .Values.node.settings.nodeType "light") -}} Invalid node type: {{ .Values.node.settings.nodeType }}. Must be one of 'bridge', 'full', or 'light'. {{- else if (hasKey .Values.node "args") -}} -DEPRECATION WARNING: The use of node.args is deprecated. Please configure container args using node.settings.nodeType and node.extraArgs. - {{- if not (eq .Values.node.settings.nodeType (first .Values.node.args)) -}} - The nodeType value ({{ .Values.node.settings.nodeType }}) does not match the first argument in args ({{ first .Values.node.args }}). + {{- if .Values.node.args -}} + {{- if not (eq .Values.node.settings.nodeType (first .Values.node.args)) -}} + The nodeType value ({{ .Values.node.settings.nodeType }}) does not match the first argument in args ({{ first .Values.node.args }}). + {{- end -}} {{- end -}} {{- end -}} {{- end -}} +{{/* +Compile all deprecation warnings into a single message. +*/}} +{{- define "node.deprecationWarnings" -}} +{{- $warnings := list -}} +{{- if .Values.node.args -}} + DEPRECATION WARNING: The use of node.args is deprecated. Please configure container args using node.settings.nodeType and node.extraArgs. +{{- end -}} +{{- $warnings := without $warnings "" -}} +{{- $warning := join "\n" $warnings -}} + +{{- if $warning -}} +{{- $warning -}} +{{- end -}} +{{- end -}} + # TODO: add validations for values # Remember to add the validation message to NOTES.txt at the end ({{- include "node.validateValues" . }}) {{/* -Compile all warnings into a single message and fail the deployment if there are any. +Compile all validation messages into a single message and fail the deployment if there are any. */}} {{- define "node.validateValues" -}} {{- $messages := list -}} diff --git a/charts/celestia-node/templates/statefulset.yaml b/charts/celestia-node/templates/statefulset.yaml index 94b2a96..efb9000 100644 --- a/charts/celestia-node/templates/statefulset.yaml +++ b/charts/celestia-node/templates/statefulset.yaml @@ -163,7 +163,7 @@ spec: {{- if .Values.diagnosticMode.enabled }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} {{- else }} - args: {{ include "node.containerArgs" . | toYaml | nindent 12 }} + args: {{ include "node.containerArgs" . | nindent 12 }} {{- end }} env: - name: CELESTIA_HOME