kcp icon indicating copy to clipboard operation
kcp copied to clipboard

Clean Up Our Controllers

Open stevekuznetsov opened this issue 2 years ago • 7 comments

Right now, we're using old-school Kubernetes boilerplate and the like for our controllers. This leads to a lot of boilerplate copy-paste and by my count we've got even three different implementations of Start(). Not to mention, the code flows around creating informers and the like in the correct order are very fragile and multiple dev hours/days have been spent debugging informers that won't sync due to some mechanical issue.

We've spent time and effort fixing and re-fixing patch flows as well as hand-crafted patch statements. None of this adds value to our product and saps our available development effort. Let's consider what we can do to make writing controllers simpler and less error-prone. That might look like helpers, libraries using generics when we've got 1.18, or controller-runtime perhaps.

stevekuznetsov avatar Jun 24 '22 21:06 stevekuznetsov

/cc @sttts @ncdc

stevekuznetsov avatar Jun 24 '22 21:06 stevekuznetsov

controller-runtime has been discussed before. We cannot. It depends on kube and we cannot bind our fork life-cycle to some libraries' life-cycle.

Other than that, I am open to some kind of slim controller plumbing library. Generic will certainly make that much easier.

sttts avatar Jun 25 '22 06:06 sttts

At a minimum Andy and I were hoping to get the JSON patch construction and logic around spec/status updates shared. It's currently copied around per-type everywhere.

stevekuznetsov avatar Jun 25 '22 20:06 stevekuznetsov

Yes, please. That bit is most painful.

sttts avatar Jun 26 '22 07:06 sttts

We could do controllers in kcp proper using controller-runtime, couldn't we? Just not in kcp-dev/k?

ncdc avatar Jun 27 '22 15:06 ncdc

Issues go stale after 90d of inactivity. After a furter 30 days, they will turn rotten. Mark the issue as fresh with /remove-lifecycle stale.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kcp-ci-bot avatar Apr 13 '24 20:04 kcp-ci-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kcp-ci-bot avatar May 13 '24 20:05 kcp-ci-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kcp-ci-bot avatar Jun 12 '24 20:06 kcp-ci-bot

@kcp-ci-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

kcp-ci-bot avatar Jun 12 '24 20:06 kcp-ci-bot