Skip to content

fix: bitnami image hardcoded in init container definition - #41257

Merged
pratapaprasanna merged 2 commits into
releasefrom
ww-bitnami-init-image
Sep 23, 2025
Merged

pratapaprasanna merged 2 commits into
releasefrom
ww-bitnami-init-image

Conversation

@wyattwalter

@wyattwalter wyattwalter commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

Description

Hardcoded image reference was missed in the previous Bitnami image fix.

see: bitnami/charts#35256

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Init container images for Redis, MongoDB, and PostgreSQL now respect chart values for registry, repository, and tag, allowing customization and private registry support. Defaults are no longer hardcoded; behavior for explicitly provided custom images remains unchanged. This helps with compliance, air-gapped deployments, and consistency.
  • Chores
    • Bumped Helm chart to 3.6.5.

@coderabbitai

coderabbitai Bot commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updates Helm chart version to 3.6.5 and changes initContainer image references in the Deployment template to use values-driven registry/repository/tag fields for Redis, MongoDB, and PostgreSQL instead of hardcoded defaults. No other logic or fields are modified.

Changes

Cohort / File(s) Summary
Helm chart metadata
deploy/helm/Chart.yaml
Bumped version from 3.6.4 to 3.6.5.
InitContainer image templating
deploy/helm/templates/deployment.yaml
Replaced hardcoded initContainer images with values-based construction: .Values.redis.image.{registry,repository,tag}, .Values.mongodb.image.{registry,repository,tag}, .Values.postgresql.image.{registry,repository,tag}. Existing conditional override logic for custom images retained.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Helm user
  participant Helm as Helm Renderer
  participant Values as values.yaml
  participant Tmpl as deployment.yaml (template)
  participant K8s as Kubernetes API

  Dev->>Helm: helm install/upgrade
  Helm->>Values: Load .Values
  Helm->>Tmpl: Render with .Values
  note right of Tmpl: Build initContainer images from<br/>redis/mongodb/postgresql<br/>registry+repository+tag
  Tmpl-->>Helm: Rendered Deployment manifest
  Helm->>K8s: Apply manifest
  K8s-->>Dev: Deployment created/updated
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Version ticks from four to five,
Templates now let values drive.
Registries align on cue,
Repos, tags, all shining through.
Charts set sail with cleaner seas—
Init pods pull with greater ease.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description uses the repository template and contains a concise summary, the /ok-to-test automation line, the Cypress test block, and the communication checklist, but it still leaves the "Fixes #Issue Number / Fixes Issue URL" placeholder unfilled and lacks additional context such as motivation, impact, and testing steps. Because the issue reference is a template placeholder, reviewers cannot verify linkage to an issue or fully assess the change. The description is therefore incomplete for traceability and review purposes. Replace the "Fixes" placeholder with the actual issue number or URL (or create and link a new issue if none exists), and add brief motivation, impact, and testing or rollout instructions so reviewers can validate the change. Also update the Communication checklist to indicate whether DevRel/Marketing should be informed. After these additions the description will meet the repository template requirements.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title is concise and accurately describes the primary change—fixing a hardcoded Bitnami image in an init container definition—which matches the deployment.yaml change that replaces hardcoded initContainer images with Values-driven image fields; it focuses on the main fix rather than incidental changes like the Chart version bump.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ww-bitnami-init-image

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the Bug Something isn't working label Sep 23, 2025

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

🧹 Nitpick comments (5)
deploy/helm/templates/deployment.yaml (5)

68-69: Good fix; consider guarding empty registry to avoid leading slash.

If registry is empty (common for Docker Hub), this renders "/repo:tag". Add conditional prefixing of the registry.

Apply this diff:

-        image: "{{ .Values.redis.image.registry }}/{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
+        image: "{{- if .Values.redis.image.registry }}{{ .Values.redis.image.registry }}/{{ end }}{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"

Also verify the resulting image contains redis-cli, since the init command depends on it.


77-78: Same guard for MongoDB image + minor spacing nit.

Prevent a leading slash when registry is empty and remove the double-space after the colon.

-        image:  "{{  .Values.mongodb.image.registry }}/{{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}"
+        image: "{{- if .Values.mongodb.image.registry }}{{ .Values.mongodb.image.registry }}/{{ end }}{{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}"

Please confirm the selected image provides mongosh.


86-87: Same guard for PostgreSQL image.

Avoid rendering "/repo:tag" if registry is unset.

-        image: "{{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}"
+        image: "{{- if .Values.postgresql.image.registry }}{{ .Values.postgresql.image.registry }}/{{ end }}{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}"

82-89: pg_isready uses undefined shell vars; inline Helm values to avoid failures.

$postgresuser and $postgresdb aren’t defined in this init container. Inline the values so readiness works regardless of env.

-        command: ['sh', '-c', "until pg_isready -U $postgresuser -d $postgresdb -h {{.Release.Name}}-postgresql.{{.Release.Namespace}}.svc.cluster.local; do echo waiting for postgresql; sleep 2; done"]
+        command: ['sh', '-c', "until pg_isready -U {{ .Values.postgresql.auth.username }} -d {{ .Values.postgresql.auth.database }} -h {{ .Release.Name }}-postgresql.{{ .Release.Namespace }}.svc.cluster.local; do echo waiting for postgresql; sleep 2; done"]

2-5: Duplicate variable assignment; remove the second $postgrespass.

Redundant re-declaration is noisy and risks future drift.

 {{- $postgresuser := .Values.postgresql.auth.username }}
 {{- $postgrespass := .Values.postgresql.auth.password }}
-{{- $postgrespass := .Values.postgresql.auth.password }}
 {{- $releaseName := include "appsmith.fullname" . -}}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2945431 and a505ca7.

⛔ Files ignored due to path filters (1)
  • deploy/helm/tests/__snapshot__/defaults_snapshot_test.yaml.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • deploy/helm/Chart.yaml (1 hunks)
  • deploy/helm/templates/deployment.yaml (3 hunks)
🔇 Additional comments (1)
deploy/helm/Chart.yaml (1)

14-14: Patch version bump looks correct.

3.6.4 → 3.6.5 aligns with a template-only fix. No other changes needed here.

@pratapaprasanna
pratapaprasanna merged commit 903d952 into release Sep 23, 2025
20 checks passed
@pratapaprasanna
pratapaprasanna deleted the ww-bitnami-init-image branch September 23, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants