cert-manager / trust-manager

trust-manager is an operator for distributing trust bundles across a Kubernetes cluster.
https://cert-manager.io/docs/projects/trust-manager/
Apache License 2.0
243 stars 65 forks source link

refactor: simplify patching resources using generics and Unstructured #237

Closed erikgb closed 9 months ago

erikgb commented 9 months ago

This PR makes use of the Bundle API apply configurations introduced in https://github.com/cert-manager/trust-manager/pull/217. The PR also suggests an alternative approach to do SSA using the controller-runtime client. You might have good reasons for keeping the existing approach, but we are using the alternative approach proposed in this PR with success. And it is at least more compact in code measures. Please let me know what you think.

I am planning to simplify even more, by just using BundleStatusApplyConfiguration, after/if https://github.com/cert-manager/trust-manager/pull/236 is merged. The utility functions to handle needsUpdate is blocking a well-written SSA reconciler IMO. 😉

/cc @inteon @SgtCoDFish

jetstack-bot commented 9 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from erikgb. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/cert-manager/trust-manager/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
erikgb commented 9 months ago

/retest