Skip to content

Conversation

cbandy
Copy link
Member

@cbandy cbandy commented Aug 25, 2025

This is the same idea as #4253, but for the PostgresCluster controller: it separates the client.Client interface into three. Similarly, this increases the amount of code covered by make check.

This refactor is another step toward my goal of a single, shared SSA Apply function.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Testing enhancement
  • Other

We want to be mindful of our interactions with the Kubernetes API, and
these interfaces will help keep functions focused. These interfaces are
also narrower than client.Reader and client.Writer and may help us keep
RBAC markers accurate.

A new constructor populates these fields with a single client.Client.
The client.WithFieldOwner constructor allows us to drop our Owner field
and patch method.

This allows `make check` to cover 9% more of the "postgrescluster" package.
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