Skip to content

helm: enhance test to verify readiness (includes DB connectivity)#308

Closed
Soju06 wants to merge 0 commit intomainfrom
helm/test-db-connectivity
Closed

helm: enhance test to verify readiness (includes DB connectivity)#308
Soju06 wants to merge 0 commit intomainfrom
helm/test-db-connectivity

Conversation

@Soju06
Copy link
Copy Markdown
Owner

@Soju06 Soju06 commented Apr 3, 2026

Summary

  • Enhance Helm test to check both /health and /health/ready endpoints
  • The readiness probe verifies DB connectivity (app reports not-ready if DB is unreachable)
  • Add nodeSelector support for ARM clusters

Motivation

Current test only checks /health which passes even if the database connection is broken. The /health/ready endpoint includes DB connectivity verification, catching misconfigured external database URLs.

Changes

  • tests/test-connection.yaml: Add readiness check + nodeSelector

@Soju06 Soju06 closed this Apr 3, 2026
@Soju06 Soju06 force-pushed the helm/test-db-connectivity branch from 45895ee to c657c91 Compare April 3, 2026 06:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45895ee146

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{{- range .Values.dbInit.databases }}
DO $$ BEGIN
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = '{{ .user }}') THEN
CREATE ROLE {{ .user }} WITH LOGIN PASSWORD '{{ .password }}';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Escape db-init password before embedding it in SQL

The pre-install db-init hook interpolates {{ .password }} directly inside a SQL string literal ('...'). If any configured password contains a single quote, the SQL becomes syntactically invalid and the hook job fails, which blocks installs/upgrades when dbInit.enabled=true. This also creates a SQL-injection footgun for values-driven provisioning; use proper literal escaping (or psql variables with quote_literal) instead of raw interpolation.

Useful? React with 👍 / 👎.

Comment on lines +9 to +10
# @param global.nodeSelector Node selector labels applied to ALL pods (deployment, jobs, tests)
nodeSelector: {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wire global nodeSelector to templates or remove the value

This commit adds global.nodeSelector and documents it as applying to all pods, but the chart templates continue reading .Values.nodeSelector (deployment, test pod, and db-init job) and never reference .Values.global.nodeSelector. Users who follow the new value contract will see no scheduling effect, which is especially problematic for ARM pinning scenarios described in the change.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant