Skip to content

feat: add configurable init containers#11

Merged
roderik merged 4 commits intomainfrom
feat/init-containers-config
Sep 17, 2025
Merged

feat: add configurable init containers#11
roderik merged 4 commits intomainfrom
feat/init-containers-config

Conversation

@roderik
Copy link
Copy Markdown
Member

@roderik roderik commented Sep 17, 2025

Summary

  • allow bootstrapper and node pods to define init containers through values with tpl support
  • expand values annotations and helm-docs output to cover new keys
  • document helm-docs expectations in AGENTS.md

Testing

  • bun run typecheck
  • bun run check
  • bun run test
  • bun run check:fix
  • bun run docs:helm

Summary by Sourcery

Add support for configurable init containers in the network-bootstrapper and network-nodes Helm charts, including templating for shared, validator, and RPC pods, and update documentation accordingly.

New Features:

  • Allow defining initContainers via chart values for both bootstrapper and node pods, with separate shared, validator, and RPC configurations and tpl support

Enhancements:

  • Introduce a helper template to render initContainers in statefulsets and jobs
  • Update Helm chart values and README files to include initContainers keys for bootstrapper, validator, and RPC pods

Documentation:

  • Extend AGENTS.md with instructions for regenerating Helm chart documentation using helm-docs
  • Add initContainers sections to network-bootstrapper and network-nodes README files

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @roderik, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the flexibility of the Helm charts for network bootstrapper and network nodes by enabling the configuration of init containers. This allows users to specify tasks that must complete successfully before the main application containers start, facilitating complex initialization logic directly within the Helm chart values. The changes also include updates to documentation generation to reflect these new configurable options.

Highlights

  • Configurable Init Containers: Introduced the ability to define init containers for both bootstrapper and node pods using Helm values, supporting tpl for dynamic configuration.
  • Enhanced Helm Documentation: Expanded values annotations and helm-docs output to cover the new initContainers keys, ensuring comprehensive documentation.
  • Documentation Guidelines: Added specific guidelines to AGENTS.md on how to maintain helm-docs format and use compatible comment blocks for values.yaml entries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the qa:running QA workflow is currently running label Sep 17, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 17, 2025

To view in Slack, search for: 1758126237.278809

@github-actions github-actions Bot added the status:ready-for-review Pull request is ready for review label Sep 17, 2025
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Please bump the chart versions in Chart.yaml for both network-nodes and network-bootstrapper to reflect this new feature.
  • Consider refactoring the inline initContainers logic in the bootstrapper job template to reuse the shared nodes.renderInitContainers helper for consistency and DRYness.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Please bump the chart versions in Chart.yaml for both network-nodes and network-bootstrapper to reflect this new feature.
- Consider refactoring the inline initContainers logic in the bootstrapper job template to reuse the shared `nodes.renderInitContainers` helper for consistency and DRYness.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions github-actions Bot added qa:success QA workflow passed successfully and removed qa:running QA workflow is currently running labels Sep 17, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable feature by allowing configurable init containers for both the bootstrapper and node pods. The implementation is flexible, supporting both YAML lists and raw strings for defining containers, and includes helpful documentation and examples in the values.yaml files. The use of a shared helper template for rendering init containers in the network-nodes chart is a good practice.

I've found one high-severity issue in the new helper template (_helpers.tpl) where the combination of indentation and whitespace control could lead to incorrect YAML rendering. I've provided a suggestion to make the template more robust and idiomatic.

Overall, this is a great addition, and with the suggested fix, it will be ready for merging.

Comment on lines +68 to +79
{{- define "nodes.renderInitContainers" -}}
{{- $ctx := .context -}}
{{- $containers := .containers -}}
{{- $indent := .indent | default 2 -}}
{{- if $containers }}
{{- if kindIs "string" $containers -}}
{{ tpl $containers $ctx | nindent $indent }}
{{- else -}}
{{ tpl (toYaml $containers) $ctx | nindent $indent }}
{{- end -}}
{{- end -}}
{{- end }}
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.

high

The combination of indentation within the define block and aggressive whitespace stripping ({{- ... -}}) is fragile and can lead to unexpected template rendering issues or parsing errors. It's safer and more idiomatic to remove the indentation for the logic inside the define block and rely on whitespace control to manage the flow. This makes the template easier to read and less prone to errors when it's modified in the future.

{{- define "nodes.renderInitContainers" -}}
{{- $ctx := .context -}}
{{- $containers := .containers -}}
{{- $indent := .indent | default 2 -}}
{{- if $containers -}}
{{- if kindIs "string" $containers -}}
{{ tpl $containers $ctx | nindent $indent }}
{{- else -}}
{{ tpl (toYaml $containers) $ctx | nindent $indent }}
{{- end -}}
{{- end -}}
{{- end -}}

@github-actions github-actions Bot added qa:running QA workflow is currently running qa:success QA workflow passed successfully and removed qa:success QA workflow passed successfully qa:running QA workflow is currently running labels Sep 17, 2025
@github-actions github-actions Bot added qa:running QA workflow is currently running qa:success QA workflow passed successfully feat New feature and removed qa:success QA workflow passed successfully qa:running QA workflow is currently running labels Sep 17, 2025
@github-actions github-actions Bot added qa:running QA workflow is currently running qa:success QA workflow passed successfully and removed qa:success QA workflow passed successfully qa:running QA workflow is currently running labels Sep 17, 2025
@roderik roderik merged commit a50f165 into main Sep 17, 2025
7 checks passed
@roderik roderik deleted the feat/init-containers-config branch September 17, 2025 16:57
@github-actions github-actions Bot added status:merged Pull request has been merged and removed status:ready-for-review Pull request is ready for review labels Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature qa:success QA workflow passed successfully status:merged Pull request has been merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant