Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reduce duplication in sync target functions #436

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Sep 10, 2024

The main goal of this refactoring is to move the deletion of target configmap/secret out of the patch functions. The end goal is to provide functions that can be reused in the new pull-target feature I am working on. When the user creates the target resource, it does not make sense for trust-manager to delete it (as a side effect of patching it).

I have renamed some variables to avoid shadowing in #378.

Relates to #378

@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 10, 2024
@erikgb erikgb force-pushed the refactor-sync-target branch 3 times, most recently from 00468de to acb6f3c Compare September 17, 2024 06:21
@erikgb
Copy link
Contributor Author

erikgb commented Sep 17, 2024

I have now attempted to reduce duplication even more using generics, but I am not too happy with the result. Go generics is not the generics I am used to. 😉 PTAL @inteon!

Copy link
Member

@inteon inteon left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
Thanks for the simplification!

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2024
@cert-manager-prow cert-manager-prow bot merged commit b02e2b0 into cert-manager:main Sep 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants