def Fin.added

bend-kube-runtime@0.2.0.0 · src/helpers.bend:21

import bend-kube-runtime@0.2.0.0/src/helpers.bend as Helpers
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J
import bend-kube-runtime@0.2.0.0/src/client.bend as Cl
import bend-kube-runtime@0.2.0.0/src/queue.bend as Q
import bend-kube-runtime@0.2.0.0/src/log.bend as L

21def Fin.added(r: Result<&2, &2, Cl.KErr, J.Json>) -> IO(Q.Action):
22  match r:
23    case Done{o}:
24      # the patch itself triggers the next reconcile
25      IO.pure(Q.Action, Q.AwaitChange{})
26    case Fail{+e}:
27      IO.bind(Unit, Q.Action, L.Log.warn("adding finalizer failed", [L.Log.kv("error", Cl.KErr.show(e))]),
28        u => IO.pure(Q.Action, Q.Retry{Cl.KErr.show(e)}))

Uses (12)

Used by (1)