weaveworks / pipeline-controller

This repository contains the Pipeline CRD and associated controller for Weave GitOps Enterprise.
1 stars 4 forks source link

Use Flux's serial patcher #212

Closed squaremo closed 11 months ago

squaremo commented 11 months ago

This replaces the use of the method .patchStatus with a fluxcd/pkg/runtime/patch/SerialPatcher. The aim is to make repeated patching "obvious": you always assign into pipeline.Status, and you always call patcher.Patch(ctx, &pipeline) to do the right thing.

I've also changed the division of labour between Reconcile and status-updating helpers. Before, the helpers would do their own patching. I think it's more transparent if the helpers mutate the object status, and the Reconcile method chooses when to patch.

No new tests, since the behaviour is supposed to be the same.