def Kube.start_all

bend-kube-runtime@0.2.0.0 · src/kube.bend:86

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/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

86# Several controllers in one process, sharing their watches (Manager):
87# rec(i, obj, cfg) reconciles for the i-th controller of cs. Opts.label is
88# unused here (each Ctrl has its own); max likewise.
89def Kube.start_all(~rec: U32 -> J.Json -> K.Config -> IO(Q.Action), +cfg: K.Config, +cs: List<&2, R.Ctrl>,
90  o: Opts) -> IO(Unit):
91  match o:
92    case Opts{m, +p, l, sel}:
93      IO.bind(Chan(R.SMsg), Unit, R.Keeper.start(),
94        +status => IO.bind(Unit, Unit, Kube.serve(p, status),
95          u => IO.bind(Unit, Unit, L.Log.info("starting controllers",
96            [L.Log.kv("count", Nat.show(List.length(&2, R.Ctrl, cs))), L.Log.kv("server", K.Config.host(cfg))]),
97            u2 => Kube.elect(cfg, l, R.Manager.start(~rec, cfg, cs, status)))))

Uses (21)

Used by (1)