def Plan.build
import bend-kube-runtime@0.2.0.0/src/runtime.bend as Runtimeimport Base
680# Every watch the controllers need, each once, with all its subscribers.
681def Plan.build(cs: List<&2, Ctrl>, chs: List<&2, Chan(Msg)>, ws: List<&2, Watch>) -> List<&2, Watch>:
682 match cs chs:
683 case Con{Ctrl{p, l, os, m}, t} Con{+ch, ct}:
684 Plan.build(t, ct, Plan.owned(os, ch, 1, Plan.sub(ws, p, l, Sub{ch, 0})))
685 case _ _:
686 ws