kubernetes-sigs / kubebuilder-declarative-pattern

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

Introduce applyset applier #248

Closed justinsb closed 1 year ago

justinsb commented 1 year ago

The applyset applier relies on server-side-apply, which means we don't need as many layers and won't accidentally fetch the OpenAPI every time without knowing (whoops!)

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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
justinsb commented 1 year ago

/test pull-declarative-test

johnsonj commented 1 year ago

This is an awesome start. I can think of multiple controller/deployment use cases where I would like to use this!

justinsb commented 1 year ago

Thanks @johnsonj - as this is additive (shouldn't change existing code paths) and I got tests to pass I removed the WIP designation!

The huge line count is (mostly) because of the go.sum files - I always wonder if I should be checking those in. I could split the move of mockkubeapiserver to its own module into a separate PR, but it isn't the bulk of the line count.

I have a few more PRs "up next" where I use this for the metrics_test, which requires supporting watch, so mockkubeapiserver is getting better - hopefully good enough for your use case when you get there!

johnsonj commented 1 year ago

I think it's harmless to include go.sum. I'm no expert in the ever-evolving world of go modules.. but at least we'll know CI will run exactly the code as expected :)

/lgtm