Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(charts): geth flags #1957

Merged
merged 3 commits into from
Feb 17, 2025
Merged

fix(charts): geth flags #1957

merged 3 commits into from
Feb 17, 2025

Conversation

quasystaty1
Copy link
Contributor

Summary

changes to how flags condition is evaluated and used.

Background

Our current evm-rollup charts has a bug, the condition which helps configuring geth flags is not being evaluated and always acts as true. This PR changes the condition templating.

Changes

  • conditions are now being templated based on the key value. Also makes sure this value is true if the condition exists.

Testing

  • locally running smoke test against a cluster
  • using the helm command for templating: helm template my-chart ./charts/evm-stack -f ./dev/values/rollup/dev.yaml

Changelogs

No updates required.

@quasystaty1 quasystaty1 requested a review from a team as a code owner February 10, 2025 13:18
@github-actions github-actions bot added the cd label Feb 10, 2025
@@ -174,13 +174,13 @@ config:
- name: history.state
value: "{{- if .Values.config.geth.archiveNode -}} 0 {{- else -}} 540000 {{- end }}"
- name: metrics
condition: .Values.metrics.enabled
condition: "{{- if .Values.metrics.enabled -}} true {{- else -}} false {{- end }}"
Copy link
Member

Choose a reason for hiding this comment

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

Based on testing I believe this works fine

condition : "{{ .Values.metrics.enabled }}"

Comment on lines 70 to 74
{{- if hasKey $arg "condition" }}
{{- if eq (tpl $arg.condition $) "true" }}
- --{{ $arg.name }}{{ if $arg.value }}={{ tpl $arg.value $ }}{{ end }}
{{- end }}
{{- else }}
Copy link
Member

Choose a reason for hiding this comment

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

We can probably keep this duplication to a minimum, can do same in the exec script?

If there is no condition set or the condition evaluates to true

Suggested change
{{- if hasKey $arg "condition" }}
{{- if eq (tpl $arg.condition $) "true" }}
- --{{ $arg.name }}{{ if $arg.value }}={{ tpl $arg.value $ }}{{ end }}
{{- end }}
{{- else }}
{{- $noCondition := not (hasKey $arg "condition") }}
{{- if or ($noCondition) (eq (tpl $arg.condition $) "true") }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated both statefulset and exec script with the new format, tested with and without metrics enabled using:
helm template my-chart ./charts/evm-stack -f ./dev/values/rollup/dev.yaml

@quasystaty1 quasystaty1 force-pushed the quasystaty1/charts/geth-flags branch from a2f0cc9 to c24fcde Compare February 12, 2025 11:33
@quasystaty1 quasystaty1 force-pushed the quasystaty1/charts/geth-flags branch from 14b8aa8 to 81c3147 Compare February 17, 2025 15:07
@quasystaty1 quasystaty1 added this pull request to the merge queue Feb 17, 2025
Merged via the queue into main with commit 1407332 Feb 17, 2025
47 checks passed
@quasystaty1 quasystaty1 deleted the quasystaty1/charts/geth-flags branch February 17, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants