~/bend-docscommunity

src/client.bend relies on unsafe/foreign

raw source on the hub · import bend-kube-runtime@0.8.0.0/src/client.bend as Client

10 imports
import Base
import ./json.bend as J
import ./utf8.bend as U
import ./http.bend as H
import ./core.bend as C
import ./config.bend as K
import ./net.bend as N
import ./yaml.bend as Y
import ./queue.bend as Q
import ./lease.bend as E

Types

type KErr source · line 31 · raw

Data

KRetry: an API error that names a delay: the Status body's details.retryAfterSeconds, else the Retry-After header (seconds), as the API server sends with 429 and some 5xx answers.

type Reply source · line 37 · raw

Data

type Creds source · line 212 · raw

Data

type ReadEv source · line 340 · raw

Type

What the read loop just saw: bytes (or a failure) from a recv, or the decoder's state after feeding them.

type PEv source · line 501 · raw

Type

type REv source · line 777 · raw

Data

A PUT's retry on conflict: put, read the current object after a 409, put again with its version.

Definitions

def Res source · line 25 · raw

@-A:Type -> Type

def KErr.show source · line 40 · raw

@e:KErr -> String

def KErr.retryable source · line 53 · raw

@e:KErr -> Bool

Whether a failed call is worth retrying: the network, 429 (API priority and fairness), and 5xx. 4xx answers are final.

def KErr.code source · line 64 · raw

@e:KErr -> U32

def KErr.reason source · line 73 · raw

@e:KErr -> String

def KErr.retry_after source · line 83 · raw

@e:KErr -> Maybe<&2, U32>

The delay the server asked for, in seconds, if it named one.

def KErr.action.go source · line 90 · raw

@+e:KErr -> @m:Maybe<&2, U32> -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/queue.Action

def KErr.action source · line 101 · raw

@+e:KErr -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/queue.Action

What a reconcile answers after a failed call: retry after the delay the server named (a 429's Retry-After), from 1s (so a 0 cannot spin) to at most 1000s (the key backoff's own cap, so a bad value cannot park a key for weeks), else retry with the key's backoff.

def KErr.is_conflict source · line 106 · raw

@+e:KErr -> Bool

A write lost to a newer resourceVersion (409 Conflict): read again and retry (client-go's retry.RetryOnConflict case).

def KErr.is_not_found source · line 109 · raw

@+e:KErr -> Bool

def KErr.is_already_exists source · line 112 · raw

@+e:KErr -> Bool

def KErr.is_throttled source · line 116 · raw

@+e:KErr -> Bool

The server is shedding load (429): back off before retrying.

def Fs.close_with source · line 122 · raw

@-A:Type -> @f:File -> @r:Res(A) -> IO(Res(A))

def Fs.read.got source · line 125 · raw

@p:Pair(File, Res(List<&2, U32>)) -> IO(Res(String))

def Fs.read.sized.go source · line 132 · raw

@f:File -> @+n:U32 -> @empty:Bool -> IO(Res(String))

def Fs.read.sized source · line 139 · raw

@p:Pair(File, Res(U32)) -> IO(Res(String))

def Fs.read.opened source · line 146 · raw

@r:Res(File) -> IO(Res(String))

def Fs.read source · line 154 · raw

@path:String -> IO(Res(String))

A whole file as UTF-8 text.

def Src.load.fin source · line 157 · raw

@+path:String -> @r:Res(String) -> IO(Res(String))

def Strs.own source · line 164 · raw

@xs:List<&2, String> -> List<&1, String>

def Exec.token.got source · line 171 · raw

@+cmd:String -> @t:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> Res(String)

def Exec.token.json source · line 178 · raw

@+cmd:String -> @j:Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> Res(String)

def Exec.token source · line 188 · raw

@+cmd:String -> @r:Res(Pair(U32, Pair(String, String))) -> IO(Res(String))

A credential plugin's answer (client-go's exec ExecCredential): its status.token. The plugin runs on every connection, so it may cache and refresh tokens as it sees fit.

def Src.load source · line 197 · raw

@s:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> IO(Res(String))

def Creds.load.k source · line 215 · raw

@ca:String -> @cert:String -> @key:String -> @tok:Res(String) -> IO(Res(Creds))

def Creds.load.c source · line 222 · raw

@ca:String -> @cert:String -> @key:Res(String) -> @tok:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> IO(Res(Creds))

def Creds.load.b source · line 229 · raw

@ca:String -> @cert:Res(String) -> @key:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> @tok:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> IO(Res(Creds))

def Creds.load.a source · line 236 · raw

@ca:Res(String) -> @cert:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> @key:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> @tok:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Src -> IO(Res(Creds))

def Creds.load source · line 244 · raw

@c:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> IO(Res(Creds))

Reads every secret a Config names; token files are read afresh each time.

def Conn.auth.go source · line 249 · raw

@token:String -> @none:Bool -> List<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Header>

def Conn.auth source · line 259 · raw

@+token:String -> List<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Header>

def Conn.user_agent source · line 262 · raw

String

def Conn.keep source · line 265 · raw

@keep:Bool -> String

def Conn.connection source · line 272 · raw

@keep:Bool -> @own:Bool -> List<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Header>

def Conn.render source · line 282 · raw

@req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @+base:String -> @+host:String -> @+token:String -> @keep:Bool -> String

The request's text, with the path under the server's base, our headers, and Connection: keep-alive (pooled) or close, unless the request names its own (an Upgrade).

def Conn.host_header.go source · line 291 · raw

@h:String -> @+p:U32 -> @v6:Bool -> String

def Conn.host_header source · line 298 · raw

@+h:String -> @+p:U32 -> String

def Conn.open.sent source · line 302 · raw

@p:Pair(Socket, Res(Unit)) -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

Opens a connection and sends req: the socket, ready to read the answer.

def Fence.mono source · line 309 · raw

IO(U32)

def Fence.check.late source · line 320 · raw

@late:Bool -> IO(Unit)

The leadership fence: the lease's last renewal, held by a keeper the leader updates (Leader.fence). Under leader election every write of request bytes (a request's first send, a pooled send, a retry, exec's input) asks the keeper first, and a lease past its renew deadline exits the process before the bytes leave: whatever delays the leader loop (a long computation on the shared event loop), nothing is written after a standby may have taken over. The keeper always answers, so a reading is never missing.

def Fence.check.at source · line 327 · raw

@f:Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Fence> -> @+now:U32 -> IO(Unit)

def Fence.check.got source · line 344 · raw

@m:Maybe<&1, Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Fence>> -> IO(Unit)

def Fence.check source · line 353 · raw

@m:Maybe<&2, Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg)> -> IO(Unit)

Asks the keeper for the reading and exits if the lease is past its deadline; nothing to check without leader election.

def Conn.open.go source · line 362 · raw

@r:Res(Socket) -> @text:String -> @fc:Maybe<&2, Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg)> -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

def Conn.open.creds source · line 370 · raw

@+h:String -> @+p:U32 -> @+sn:String -> @+base:String -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @keep:Bool -> @fc:Maybe<&2, Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg)> -> @cr:Res(Creds) -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

def Conn.open source · line 379 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @keep:Bool -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

def ReadEv.got source · line 384 · raw

@p:Pair(Socket, Res(List<&2, U32>)) -> ReadEv

def Http.has_err source · line 389 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> Bool

def Http.fail source · line 392 · raw

@msg:String -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp

def Http.lost source · line 396 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> @msg:String -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp

A failed recv: lost when no byte of a response came, else broken.

def Conn.read source · line 405 · raw

@fuel:Nat -> @ev:ReadEv -> @+resp:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> @+ms:U32 -> IO(Pair(Socket, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp))

Reads until the response is whole, the stream ends, or fuel runs out; ms bounds each recv. Answers the socket and the decoder.

def Reply.retry_after source · line 432 · raw

@m:Maybe<&2, String> -> Maybe<&2, U32>

A Retry-After header in seconds (the form the API server sends); an HTTP-date one is left to the usual backoff.

def Reply.of source · line 439 · raw

@r:Pair(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp, List<&2, U32>) -> Result<&2, &2, KErr, Reply>

def Call.read.fin source · line 450 · raw

@p:Pair(Socket, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp) -> IO(Result<&2, &2, KErr, Reply>)

def Call.read source · line 456 · raw

@t:Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls) -> IO(Result<&2, &2, KErr, Reply>)

def Conn.send_on.creds source · line 476 · raw

@s:Socket -> @+h:String -> @+p:U32 -> @+base:String -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @fc:Maybe<&2, Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg)> -> @cr:Res(Creds) -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

Sends req on an open (pooled) connection.

def Conn.send_on source · line 487 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @s:Socket -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> IO(Res(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/net.Tls))

def Http.got_any source · line 492 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> Bool

def Http.closes source · line 507 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> Bool

def Req.idempotent.go source · line 515 · raw

@m:String -> Bool

def Req.idempotent source · line 530 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> Bool

def Pool.put.done source · line 535 · raw

@p:Poll<&1, &1, Result<&1, &1, Socket, Unit>, Socket> -> IO(Unit)

def Pool.put source · line 545 · raw

@+pool:Chan(Socket) -> @s:Socket -> IO(Unit)

Returns a connection to the pool; a full pool closes it instead.

def PEv.read source · line 549 · raw

@+reused:Bool -> @p:Pair(Socket, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp) -> PEv

def PEv.fin source · line 552 · raw

@+reused:Bool -> @idem:Bool -> @p:Pair(Socket, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp) -> PEv

def Pool.reply source · line 558 · raw

@r:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Resp -> Result<&2, &2, KErr, Reply>

def Pool.fail source · line 561 · raw

@msg:String -> IO(Result<&2, &2, KErr, Reply>)

def Pool.run source · line 565 · raw

@fuel:Nat -> @ev:PEv -> @+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @+pool:Chan(Socket) -> @+req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> IO(Result<&2, &2, KErr, Reply>)

One request through the pool (fuel bounds the retry).

def Client.send.with source · line 605 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @pool:Maybe<&2, Chan(Socket)> -> IO(Result<&2, &2, KErr, Reply>)

def Limit.fill source · line 622 · raw

@n:Nat -> @+ch:Chan(Unit) -> IO(Unit)

def Limit.tick source · line 633 · raw

@+qps:U32 -> @+every:U32 -> @+burst:U32 -> @+carry:U32 -> Nat

A tick of every ms earns qps * every / 1000 tokens; the remainder (in thousandths of a token) carries to the next tick, so the rate is exact. A tick adds at most burst tokens: the rest would find the bucket full.

def Limit.carry source · line 636 · raw

@+qps:U32 -> @+every:U32 -> @+carry:U32 -> U32

def Limit.refill source · line 639 · raw

@outer:Nat -> @fuel:Nat -> @+ch:Chan(Unit) -> @+qps:U32 -> @+every:U32 -> @+burst:U32 -> @+carry:U32 -> IO(Unit)

def Limit.every source · line 652 · raw

@+qps:U32 -> U32

Ticks of 10ms, or longer for slow rates (one token a tick), at most 1s.

def Limit.start source · line 656 · raw

@+qps:U32 -> @+burst:U32 -> IO(Chan(Unit))

A full bucket of burst tokens, refilled at qps a second (qps above 0).

def Fence.serve source · line 664 · raw

@outer:Nat -> @fuel:Nat -> @m:Maybe<&1, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg> -> @+cur:Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Fence> -> @+inbox:Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg) -> IO(Unit)

def Fence.start source · line 682 · raw

IO(Chan(0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.FenceMsg))

Starts a fence keeper with no reading yet.

def Client.send.go source · line 688 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> IO(Result<&2, &2, KErr, Reply>)

def Client.send.gate source · line 691 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> @m:Maybe<&2, Chan(Unit)> -> IO(Result<&2, &2, KErr, Reply>)

def Client.send source · line 702 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> IO(Result<&2, &2, KErr, Reply>)

Sends a request and reads the whole reply, whatever its status, after taking a token when the config has a rate limit.

def Client.json.status.fix.go source · line 705 · raw

@+c:U32 -> @+k:U32 -> @r:String -> @m:String -> @zero:Bool -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Status

def Client.json.status.fix source · line 713 · raw

@+c:U32 -> @s:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Status -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Status

A Status without a code (some proxies) takes the HTTP status.

def Client.json.err source · line 718 · raw

@s:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Status -> @m:Maybe<&2, U32> -> KErr

def Client.json.or source · line 725 · raw

@m:Maybe<&2, U32> -> @h:Maybe<&2, U32> -> Maybe<&2, U32>

def Client.json.status source · line 734 · raw

@+c:U32 -> @j:Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @ok:Bool -> @h:Maybe<&2, U32> -> Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

h: the Retry-After header; the Status body's details.retryAfterSeconds wins when both name a delay.

def Client.json.of source · line 748 · raw

@r:Result<&2, &2, KErr, Reply> -> Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

A 2xx reply's body as JSON; any other status as the Status it carries.

def Client.json source · line 755 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @req:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/http.Req -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.get source · line 762 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.list source · line 765 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @lp:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.ListParams -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.create source · line 768 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.replace source · line 771 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Retry.rv source · line 784 · raw

@+obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> @+rv:String -> 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json

obj with the current object's resourceVersion.

def Retry.go source · line 788 · raw

@steps:Nat -> @tries:Nat -> @ev:REv -> @+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @+a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @+name:String -> @+obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

steps: fuel, at most four events per try.

def Client.replace_retry source · line 818 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @+a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @+name:String -> @+obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> @+tries:U32 -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

A PUT that rides out write conflicts (client-go's retry.RetryOnConflict with a fresh read): after a 409 it reads the object, takes its resourceVersion and puts obj again, up to tries more times. A failed read (the object deleted meanwhile: 404) ends it with that error. obj then overwrites whatever another writer changed in between, so use it for objects this writer owns whole. Client.apply (server-side apply) and Client.patch never conflict on a version and keep other writers' fields; prefer them on busy objects such as pods.

def Client.delete source · line 822 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.delete_with source · line 826 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @o:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.DeleteOpts -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

A delete with options: propagation, grace period, preconditions.

def Client.replace_status source · line 832 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @obj:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

Replaces the status subresource (a PUT carrying the object's resourceVersion, so a stale write fails with 409).

def Client.patch source · line 836 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @p:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.PatchKind -> @body:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.patch_status source · line 840 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @p:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.PatchKind -> @body:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Client.apply source · line 846 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @manager:String -> @body:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

Server-side apply, kube's recommended write: the server merges our fields under our manager name and tracks ownership.

def Client.apply_with source · line 853 · raw

@+cfg:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config -> @a:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/core.Api -> @name:String -> @manager:String -> @force:Bool -> @body:0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json -> IO(Result<&2, &2, KErr, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

Server-side apply that only forces when asked: without force, a field another manager owns (an HPA's spec.replicas) fails with 409 Conflict rather than being taken over.

def Kc.rebased source · line 857 · raw

@r:Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @+path:String -> Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

def Kc.parse source · line 869 · raw

@+t:String -> @+path:String -> @json:Bool -> Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

Reads one kubeconfig, JSON or YAML (yaml.bend), with its relative paths made absolute against its own directory, as client-go does.

def Kc.read.got source · line 876 · raw

@r:Res(String) -> @+path:String -> Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

def Kc.read source · line 883 · raw

@+path:String -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Kc.merge.got source · line 889 · raw

@acc:Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @r:Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>

Merges the files of a KUBECONFIG list in order; a file that does not exist is skipped, as client-go skips it.

def Kc.merge source · line 898 · raw

@ps:List<&2, String> -> @acc:Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> IO(Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json>)

def Config.from_kubeconfig.got source · line 906 · raw

@r:Maybe<&2, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/json.Json> -> @ctx:String -> Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>

def Config.from_kubeconfig source · line 915 · raw

@+path:String -> @ctx:String -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

A kubeconfig (one path, or a KUBECONFIG list "a:b") at a context ("" for its current one). JSON and YAML are both read natively.

def Config.in_cluster.ns source · line 920 · raw

@host:String -> @port:String -> @ns:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.in_cluster.port source · line 928 · raw

@host:String -> @port:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.in_cluster.host source · line 936 · raw

@host:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.in_cluster source · line 945 · raw

IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

The pod's own service account (client-go's InClusterConfig).

def Config.infer.home source · line 949 · raw

@r:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.infer.pod source · line 956 · raw

@r:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.infer.kc source · line 963 · raw

@r:Res(String) -> IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

def Config.infer source · line 973 · raw

IO(Result<&2, &2, String, 0xe0e77c5abbdb8584a571cae3ec9b86cc/src/config.Config>)

As kube-rs's Config::infer: $KUBECONFIG when set, else the pod's service account when in a cluster, else ~/.kube/config.