Skip to content

enhance logging for Postgres controllers#1805

Merged
mploski merged 1 commit intofeature/database-controllersfrom
feature/enhance-logging
Mar 31, 2026
Merged

enhance logging for Postgres controllers#1805
mploski merged 1 commit intofeature/database-controllersfrom
feature/enhance-logging

Conversation

@mploski
Copy link
Copy Markdown
Collaborator

@mploski mploski commented Mar 31, 2026

Description

Cleanup of our logs according to PostgreSQL Controllers Logging Strategy doc

Key Changes

  • Logging strategy: established and documented 6 rules covering logger enrichment, error ownership, loop helper patterns, log levels, message format conventions, and error string format — with a quick reference cheat sheet (docs/postgresql-logging-strategy.md)
  • PostgresCluster and PostgresDatabase controllers: applied all 6 rules across pkg/postgresql/cluster/core/cluster.go and pkg/postgresql/database/core/database.go — fixed double-logging violations, redundant KV pairs, inconsistent message tenses, wrong error string forms, and inline logger calls
  • API validation: added +kubebuilder:validation:Pattern to DatabaseDefinition.Name (lowercase identifier, max 30 chars), clusterRef immutability, and clusterRef.name non-empty CEL validation to postgresdatabase_types.go

Testing and Verification

Created Postgres Class, Postgres Cluster and Postgres Database
reconciler.txt

Related Issues

Jira tickets, GitHub issues, Support tickets...

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contribution License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment with the exact sentence copied from below.


I have read the CLA Document and I hereby sign the CLA


2 out of 4 committers have signed the CLA.
@minjieqiu
@DmytroPI-dev
@mploski
@limak9182
You can retrigger this bot by commenting recheck in this Pull Request

@mploski mploski marked this pull request as draft March 31, 2026 11:58
@mploski mploski changed the base branch from main to feature/database-controllers March 31, 2026 11:59
@mploski mploski requested review from DmytroPI-dev, M4KIF, limak9182 and minjieqiu and removed request for minjieqiu March 31, 2026 11:59
Copy link
Copy Markdown

@M4KIF M4KIF left a comment

Choose a reason for hiding this comment

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

lgtm

@mploski mploski marked this pull request as ready for review March 31, 2026 12:48
@mploski mploski merged commit 8b9b538 into feature/database-controllers Mar 31, 2026
18 of 33 checks passed
@mploski mploski deleted the feature/enhance-logging branch March 31, 2026 12:48
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants