Skip to content

fix(control-plane): skip database reconciliation for gateways with no database_id - #176

Open
jhjaggars wants to merge 1 commit into
mainfrom
fix/skip-db-reconcile-empty-database-id
Open

fix(control-plane): skip database reconciliation for gateways with no database_id#176
jhjaggars wants to merge 1 commit into
mainfrom
fix/skip-db-reconcile-empty-database-id

Conversation

@jhjaggars

@jhjaggars jhjaggars commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Gateways with an empty database_id have pre-existing self-managed PostgreSQL resources (Deployment, PVC, Service, Secret) that should not be disturbed. Previously, the reconciler unconditionally resolved CNPG configuration, blocking reconciliation of these legacy gateways.

Changes

  • Derive an explicit ReconcileDatabase flag directly from whether the gateway has a database_id.
  • Resolve the referenced ManagedDatabase and CNPG configuration only when database reconciliation is requested.
  • Gate the CNPG operator check, database resources, and credential rotation on the explicit flag rather than using an empty ClusterNamespace as a sentinel.
  • Validate that the resolved CNPG cluster namespace is present before attempting database reconciliation.
  • Continue reconciling all non-database gateway resources when database_id is empty, leaving existing database resources untouched.

Validation

  • cd components/control-plane && go test ./...
  • make check

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: fa98c5eb-4317-4b28-ba0f-2d387a6c9c73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

… database_id

Gateways with an empty database_id have pre-existing self-managed PostgreSQL resources that should not be disturbed. Previously, the reconciler unconditionally resolved CNPG configuration and blocked reconciliation of these legacy gateways.

Derive an explicit ReconcileDatabase flag from database_id, resolve CNPG configuration only when that flag is set, and use the flag to gate CNPG operator checks and database resource reconciliation. Validate the resolved CNPG namespace defensively instead of using it as the enablement signal.
@jhjaggars
jhjaggars force-pushed the fix/skip-db-reconcile-empty-database-id branch from d86042c to 483e883 Compare August 21, 2026 13:51
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