feat(api7): add extraInitContainers support to dashboard and dp_manager deployments#287
Conversation
…ortal and dp_manager deployments
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds optional extraInitContainers configuration to three API7 Helm components. Three deployment templates now conditionally render init containers when the corresponding configuration values are provided, enabling users to inject custom initialization logic at deployment time. ChangesInit Container Configuration Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds extraInitContainers support to the api7 Helm chart so dashboard, dp_manager, and developer_portal pods can run user-defined initialization containers before the main application container.
Changes:
- Adds
extraInitContainers: []defaults for dashboard, dp_manager, and developer_portal. - Renders optional
initContainersblocks in the three deployment templates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
charts/api7/values.yaml |
Adds default values for component-specific extra init containers. |
charts/api7/templates/dashboard-deploy.yaml |
Adds dashboard init container rendering. |
charts/api7/templates/dp-manager-deploy.yaml |
Adds dp_manager init container rendering. |
charts/api7/templates/developer-portal-deploy.yaml |
Adds developer_portal init container rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
charts/api7/templates/developer-portal-deploy.yaml (1)
50-53: ⚡ Quick winConsider using
tplvalues.renderfor consistency with other extra fields.*The new
extraInitContainersusestoYamldirectly, while the existingextraVolumes(line 43) andextraVolumeMounts(line 95) use theapi7ee3.tplvalues.renderhelper. The helper likely supports Go template evaluation within values, enabling dynamic configurations.For consistency and to provide the same flexibility to users, consider using the same rendering pattern.
♻️ Proposed fix for consistency
{{- if .Values.developer_portal.extraInitContainers }} initContainers: - {{- toYaml .Values.developer_portal.extraInitContainers | nindent 8 }} + {{- include "api7ee3.tplvalues.render" (dict "value" .Values.developer_portal.extraInitContainers "context" $) | nindent 8 }} {{- end }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/api7/templates/developer-portal-deploy.yaml` around lines 50 - 53, The initContainers block is rendering .Values.developer_portal.extraInitContainers with toYaml directly; change it to use the same helper as other extra* fields by passing .Values.developer_portal.extraInitContainers through api7ee3.tplvalues.render before converting/indenting so template expressions in values are evaluated consistently (update the usage around initContainers and reference the api7ee3.tplvalues.render helper and developer_portal.extraInitContainers symbol when making the change).charts/api7/templates/dp-manager-deploy.yaml (1)
49-52: ⚡ Quick winConsider using
tplvalues.renderfor consistency with other extra fields.*The new
extraInitContainersusestoYamldirectly, while the existingextraVolumes(line 46) andextraVolumeMounts(line 92) use theapi7ee3.tplvalues.renderhelper. The helper likely supports Go template evaluation within values, enabling dynamic configurations.For consistency and to provide the same flexibility to users, consider using the same rendering pattern.
♻️ Proposed fix for consistency
{{- if .Values.dp_manager.extraInitContainers }} initContainers: - {{- toYaml .Values.dp_manager.extraInitContainers | nindent 8 }} + {{- include "api7ee3.tplvalues.render" (dict "value" .Values.dp_manager.extraInitContainers "context" $) | nindent 8 }} {{- end }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/api7/templates/dp-manager-deploy.yaml` around lines 49 - 52, Replace the direct toYaml rendering of extraInitContainers with the same template-evaluation helper used by other extra* fields: call api7ee3.tplvalues.render on .Values.dp_manager.extraInitContainers (so template expressions in values are evaluated), then pass the result through toYaml and nindent 8 as before; update the block that references extraInitContainers to use api7ee3.tplvalues.render .Values.dp_manager.extraInitContainers | toYaml | nindent 8 so it matches the pattern used by extraVolumes/extraVolumeMounts.charts/api7/templates/dashboard-deploy.yaml (1)
54-57: ⚡ Quick winConsider using
tplvalues.renderfor consistency with other extra fields.*The new
extraInitContainersusestoYamldirectly, while the existingextraVolumes(line 42) andextraVolumeMounts(line 101) use theapi7ee3.tplvalues.renderhelper. The helper likely supports Go template evaluation within values, enabling dynamic configurations (e.g., referencing other values or using conditionals).For consistency and to provide the same flexibility to users, consider using the same rendering pattern.
♻️ Proposed fix for consistency
{{- if .Values.dashboard.extraInitContainers }} initContainers: - {{- toYaml .Values.dashboard.extraInitContainers | nindent 8 }} + {{- include "api7ee3.tplvalues.render" (dict "value" .Values.dashboard.extraInitContainers "context" $) | nindent 8 }} {{- end }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@charts/api7/templates/dashboard-deploy.yaml` around lines 54 - 57, The extraInitContainers block currently uses toYaml directly; update it to pass .Values.dashboard.extraInitContainers through the api7ee3.tplvalues.render helper (the same used by extraVolumes and extraVolumeMounts) before converting to YAML so template expressions in values are evaluated; specifically, call api7ee3.tplvalues.render on extraInitContainers and then pipe the result to toYaml | nindent 8, preserving the surrounding if check and nindent formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@charts/api7/templates/dp-manager-deploy.yaml`:
- Around line 46-48: The dp-manager deployment template incorrectly references
dashboard values; update the conditional and include calls that use
.Values.dashboard.extraVolumes and .Values.dashboard.extraVolumeMounts to
instead use .Values.dp_manager.extraVolumes and
.Values.dp_manager.extraVolumeMounts (i.e., change the dict "value" argument
passed to the include "api7ee3.tplvalues.render" and any direct
.Values.dashboard.* usages inside the dp-manager-deploy.yaml to
.Values.dp_manager.*) so dp-manager reads its own extraVolumes and
extraVolumeMounts configuration; ensure both occurrences (the extraVolumes
conditional/include block and the extraVolumeMounts block) are updated.
---
Nitpick comments:
In `@charts/api7/templates/dashboard-deploy.yaml`:
- Around line 54-57: The extraInitContainers block currently uses toYaml
directly; update it to pass .Values.dashboard.extraInitContainers through the
api7ee3.tplvalues.render helper (the same used by extraVolumes and
extraVolumeMounts) before converting to YAML so template expressions in values
are evaluated; specifically, call api7ee3.tplvalues.render on
extraInitContainers and then pipe the result to toYaml | nindent 8, preserving
the surrounding if check and nindent formatting.
In `@charts/api7/templates/developer-portal-deploy.yaml`:
- Around line 50-53: The initContainers block is rendering
.Values.developer_portal.extraInitContainers with toYaml directly; change it to
use the same helper as other extra* fields by passing
.Values.developer_portal.extraInitContainers through api7ee3.tplvalues.render
before converting/indenting so template expressions in values are evaluated
consistently (update the usage around initContainers and reference the
api7ee3.tplvalues.render helper and developer_portal.extraInitContainers symbol
when making the change).
In `@charts/api7/templates/dp-manager-deploy.yaml`:
- Around line 49-52: Replace the direct toYaml rendering of extraInitContainers
with the same template-evaluation helper used by other extra* fields: call
api7ee3.tplvalues.render on .Values.dp_manager.extraInitContainers (so template
expressions in values are evaluated), then pass the result through toYaml and
nindent 8 as before; update the block that references extraInitContainers to use
api7ee3.tplvalues.render .Values.dp_manager.extraInitContainers | toYaml |
nindent 8 so it matches the pattern used by extraVolumes/extraVolumeMounts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f46d60c2-b819-4916-a5e2-848d237c7067
📒 Files selected for processing (4)
charts/api7/templates/dashboard-deploy.yamlcharts/api7/templates/developer-portal-deploy.yamlcharts/api7/templates/dp-manager-deploy.yamlcharts/api7/values.yaml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ortal and dp_manager deployments
epmatimbe
left a comment
There was a problem hiding this comment.
Reviewed in CodeRabbit Change Stack
…er deployment The dp-manager-deploy.yaml template incorrectly referenced .Values.dashboard.extraVolumes and .Values.dashboard.extraVolumeMounts instead of .Values.dp_manager.extraVolumes and .Values.dp_manager.extraVolumeMounts. This made it impossible to mount custom volumes in the dp-manager pod independently of the dashboard.
PR Overview
The charts/api7 chart currently exposes extraEnvVars, extraVolumes, and extraVolumeMounts on the dashboard, developer_portal and dp_manager components, but no extraInitContainers. This makes it impossible to run initialization logic before the main container starts. For example, setup and ssl certificates required for connections, setup custom agents within the pods, etc.
Summary by CodeRabbit
New Features
Documentation
Chores