-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Bug
When multiple controllers use Patcher to write different fields to the same object's status, each Patcher overwrites the entire status object instead of merging. Fields written by one controller are wiped when another controller patches the same object.
Reproduction
Two controllers patching the same View's status:
Controller A (watches Deployments):
- "@project":
kind: MyView
status:
replicas: "$.status.replicas"
readyReplicas: "$.status.readyReplicas"Controller B (watches StatefulSets):
- "@project":
kind: MyView
status:
redis:
ready: trueExpected: Both status.replicas and status.redis.ready coexist after both controllers run.
Actual: Whichever controller runs last overwrites the other's fields. If B runs after A, status.replicas is wiped. If A runs after B, status.redis is wiped.
Expected Behavior
Patcher should do a JSON merge patch (RFC 7386) — fields not present in the patch are preserved. This matches how kubectl patch --type=merge works and how every Kubernetes controller behaves with the status subresource.
Impact
This makes it impossible to decompose status aggregation into multiple controllers — a core pattern for operators. The workaround is a single controller joining all sources, which creates complex multi-source joins and defeats the purpose of the split-view architecture.