kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
254 stars 84 forks source link

Add support for hooks to the reconciler #277

Closed justinsb closed 1 year ago

justinsb commented 1 year ago

Hooks are an extension of the sink concept that we already use for watches, but support more interception points and we can have multiple hooks.

atoato88 commented 1 year ago

@justinsb Is this PR still live? This PR needs rebase, could you do that?

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, yuwenma

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/OWNERS)~~ [justinsb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
yuwenma commented 1 year ago

/LGTM

Everything looks good except the CI test failure.

justinsb commented 1 year ago

Is this PR still live?

Yes, sorry, I've just been stuck trying to figure out how to get all these tests all working again. The testing became so strict that it because impossible to merge code.

That said, I think I've got it now... we need to normalize APIResources (#312), we need to normalize discovery requests because kubectl doesn't do them in any predictable order (#313), and then we need to update everything (#307), and then finally I will change this PR to set up the watches in BeforeApply instead of AfterApply (which is actually really easy with this PR).

And then I think we're back in business :-)

yuwenma commented 1 year ago

/lgtm