def Lease.take.go

bend-kube-runtime@0.2.0.0 · src/lease.bend:83

import bend-kube-runtime@0.2.0.0/src/lease.bend as Lease
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J

83def Lease.take.go(+l: J.Json, me: String, +dur: U32, +now: String, ours: Bool) -> J.Json:
84  match ours:
85    case True{}:
86      J.Json.set(l, "spec", Lease.new_spec(me, dur,
87        J.Json.str_or(Lease.spec(l, "acquireTime"), now), now, Lease.transitions(l)))
88    case False{}:
89      J.Json.set(l, "spec", Lease.new_spec(me, dur, now, now, (Lease.transitions(l) + 1 : U32)))

Uses (10)

Used by (1)