def Kube.start
bend-kube-runtime@0.2.0.0 · src/kube.bend:55
import bend-kube-runtime@0.2.0.0/src/kube.bend as Kube
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J
import bend-kube-runtime@0.2.0.0/src/core.bend as C
import bend-kube-runtime@0.2.0.0/src/config.bend as K
import bend-kube-runtime@0.2.0.0/src/queue.bend as Q
import bend-kube-runtime@0.2.0.0/src/runtime.bend as R
import bend-kube-runtime@0.2.0.0/src/log.bend as L
55def Kube.start(~rec: J.Json -> K.Config -> IO(Q.Action), +cfg: K.Config, +primary: C.Api,
56 owned: List<&2, C.Api>, o: Opts) -> IO(Unit):
57 match o:
58 case Opts{+m, +p, l, sel}:
59 IO.bind(Chan(R.Msg), Unit, R.Controller.inbox(),
60 +inbox => IO.bind(Chan(R.SMsg), Unit, R.Keeper.start(),
61 +status => IO.bind(Unit, Unit, Kube.serve(p, status),
62 u => IO.bind(Unit, Unit, L.Log.info("starting controller",
63 [L.Log.kv("kind", R.Api.kind(primary)), L.Log.kv("server", K.Config.host(cfg))]),
64 u2 => Kube.elect(cfg, l,
65 R.Controller.start(~rec, cfg, primary, sel, owned, m, inbox, status))))))