Skip to content

Validate cross-referenced parameters between PostgresCluster and PostgresClusterClass#1858

Draft
limak9182 wants to merge 1 commit intofeature/pg_hba-validationfrom
feature/cross-referenced-parameters-validation
Draft

Validate cross-referenced parameters between PostgresCluster and PostgresClusterClass#1858
limak9182 wants to merge 1 commit intofeature/pg_hba-validationfrom
feature/cross-referenced-parameters-validation

Conversation

@limak9182
Copy link
Copy Markdown

@limak9182 limak9182 commented Apr 20, 2026

Description

  • Adds admission-time cross-resource validation for PostgresCluster against its referenced PostgresClusterClass
  • Uses mgr.GetAPIReader() (live API read, not cached) to avoid false rejections during cache propagation

Key Changes

Rule Field Condition
Class existence spec.class Referenced PostgresClusterClass must exist
Storage floor spec.storage Cannot be lower than class default
Version floor spec.postgresVersion Major version cannot be lower than class default
Pooler enablement spec.connectionPoolerEnabled Cannot be true when class has it disabled
Merge completeness spec.instances, spec.postgresVersion, spec.storage After overlay, all three must be resolvable from cluster or class

Testing and Verification

  • unit test cases with fake client.Reader covering all rules and edge cases
  • Existing pg_hba validation tests updated to pass nil reader (no behavioral change)
  • go build ./... passes
  • go test ./pkg/splunk/enterprise/validation/... passes

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


You can retrigger this bot by commenting recheck in this Pull Request

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