Skip to content

Conversation

@cbandy
Copy link
Member

@cbandy cbandy commented Sep 19, 2025

Multiple controllers had a method for this, but the implementations differed slightly. This combines their fixes and tests them in a single place.

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

Kubernetes 1.22 and OpenShift 4.8 have been out of commission for some
time now.
if !equality.Semantic.DeepEqual(actual.Selector, intent.Selector) {
patch.Replace(append(path, "selector")...)(intent.Selector)
}
return runtime.Apply(ctx, r.Writer, object)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you thinking about a separate PR to remove this file and change the many applys in internal/controller/postgrescluster?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't planning on it, but that seems reasonable. I skipped it here because it is called a lot.

//
// The "metadata.finalizers" field is also okay.
// - https://book.kubebuilder.io/reference/using-finalizers.html
//
Copy link
Contributor

Choose a reason for hiding this comment

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

Highly recommend turning off whitespace differences to see what's actually going on here for anyone reviewing this


var suite struct {
Client client.Client
Config *rest.Config
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, the only use of ServerVersion was in the test in internal/controller/postgrescluster/controller_test.go where we were checking for older versions of k8s than we care about, ah

Multiple controllers had a method for this, but the implementations
differed slightly. This combines their fixes and tests them in a single
place.
@cbandy cbandy merged commit b3d57df into CrunchyData:main Sep 22, 2025
19 checks passed
@cbandy cbandy deleted the shared-apply-patch branch September 22, 2025 22:19
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.

2 participants