src/config.bend checks
raw source on the hub · import bend-kube-runtime@0.7.0.0/src/config.bend as Config
4 imports
import Base import ./json.bend as J import ./utf8.bend as U import ./base64.bend as B
Types
type Src source · line 18 · raw
Data
A secret's source: inline text, a file to read, a credential plugin to run (client-go's exec ExecCredential: its status.token), or nothing.
Inline@text:String -> Src
FromFile@path:String -> Src
FromExec@cmd:String -> @args:List<&2, String> -> Src
NoSrcSrc
type Fence source · line 36 · raw
Data
pool: idle keep-alive connections to reuse (client.bend), when the program made one (Config.with_pool); None opens one per request. server_name: the name the server's certificate must carry, and the SNI sent, when it differs from host (kubeconfig's tls-server-name; "" for host). fence: the leadership fence (leader.bend): when the controllers run under leader election, each request first checks that the lease is still within its renew deadline, and the process exits if it is not. limit: the client's rate limit, a bucket of tokens a request takes one of (client.bend's Limit), when the program made one (Config.with_limit). The leadership fence's reading: the monotonic time of the last renewal and the renew deadline (ms); past last + deadline a standby may act.
Fence@last:U32 -> @deadline:U32 -> Fence
type FenceMsg source · line 41 · raw
Data
What the fence keeper (client.bend) answers: the current reading (None before the first renewal), or takes: a new reading.
FGet@reply:Chan(Maybe<&2, Fence>) -> FenceMsg
FSet@fence:Fence -> FenceMsg
type Config source · line 45 · raw
Data
Config@host:String -> @port:U32 -> @base:String -> @ca:Src -> @cert:Src -> @key:Src -> @token:Src -> @namespace:String -> @pool:Maybe<&2, Chan(Socket)> -> @limit:Maybe<&2, Chan(Unit)> -> @server_name:String -> @fence:Maybe<&2, Chan(FenceMsg)> -> Config
type Url source · line 63 · raw
Data
Url@host:String -> @port:U32 -> @base:String -> Url
Definitions
def Config.host source · line 50 · raw
@c:Config -> String
def Config.namespace source · line 55 · raw
@c:Config -> String
def Url.drop_scheme.go source · line 66 · raw
@s:String -> @tls:Bool -> String
def Url.drop_scheme source · line 73 · raw
@+s:String -> String
def Url.split_path source · line 77 · raw
@s:String -> @acc:String -> Pair(String, String)
Splits "authority/path" at the first '/'.
def Url.port source · line 86 · raw
@p:String -> @+dflt:U32 -> U32
def Url.host_port.v6 source · line 89 · raw
@parts:List<&2, String> -> @+dflt:U32 -> Pair(String, U32)
def Url.host_port.v4 source · line 98 · raw
@parts:List<&2, String> -> @+dflt:U32 -> Pair(String, U32)
def Url.host_port source · line 109 · raw
@a:String -> @+dflt:U32 -> Pair(String, U32)
"[::1]:6443" or "host:6443" or "host": the host and the port (dflt when none is given).
def Url.trim_slash.go source · line 116 · raw
@s:String -> String
def Url.trim_slash source · line 123 · raw
@s:String -> String
def Url.parse.fin source · line 126 · raw
@hp:Pair(String, U32) -> @base:String -> Url
def Url.parse.go source · line 131 · raw
@ap:Pair(String, String) -> Url
def Url.parse source · line 136 · raw
@s:String -> Url
def Kube.named.if source · line 139 · raw
@+x:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+field:String -> @rest:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @hit:Bool -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
def Kube.named source · line 151 · raw
@xs:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> @+name:String -> @+field:String -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
The entry of a named list ("clusters", "users", "contexts") with this name, as its inner object (cluster, user or context).
def Kube.src.b64 source · line 159 · raw
@bs:Maybe<&2, List<&2, U32>> -> Src
def Kube.src.go source · line 166 · raw
@data:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @path:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> Src
def Kube.src source · line 176 · raw
@+o:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+name:String -> Src
A secret from "<name>-data" (base64, inline) or "<name>" (a path).
def Kube.strs source · line 179 · raw
@xs:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> List<&2, String>
def Kube.token.exec source · line 190 · raw
@c:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @env:List<&2, String> -> @args:List<&2, String> -> Src
A plugin runs under env, which sets the plugin's env entries (and
KUBERNETES_EXEC_INFO, as client-go does) on top of our environment.
def Kube.envs source · line 200 · raw
@xs:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> List<&2, String>
An exec plugin's env entries ({name, value}) as "name=value".
def Kube.token.go source · line 208 · raw
@t:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @f:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+e:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> Src
def Kube.token source · line 218 · raw
@+u:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> Src
def Kube.config.pick.go source · line 221 · raw
@ctx:String -> @cur:String -> @empty:Bool -> String
def Kube.config.pick source · line 228 · raw
@+ctx:String -> @cur:String -> String
def Kube.config.fin source · line 231 · raw
@u:Url -> @ca:Src -> @cert:Src -> @key:Src -> @tok:Src -> @ns:String -> @sn:String -> Result<&2, &2, String, Config>
def Kube.config.server source · line 237 · raw
@s:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @ca:Src -> @cert:Src -> @key:Src -> @tok:Src -> @ns:String -> @sn:String -> Result<&2, &2, String, Config>
def Kube.config.build source · line 245 · raw
@+cl:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+u:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @ns:String -> @name:String -> @missing:Bool -> Result<&2, &2, String, Config>
def Kube.config.with source · line 255 · raw
@+kc:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @name:String -> @+c:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> Result<&2, &2, String, Config>
def Kube.config.ctx source · line 263 · raw
@+kc:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+name:String -> Result<&2, &2, String, Config>
def Kube.config source · line 268 · raw
@+kc:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @ctx:String -> Result<&2, &2, String, Config>
The Config a kubeconfig (as JSON) names for a context ("" for its current-context), or why it cannot.
def InCluster.dir source · line 274 · raw
String
def InCluster.config source · line 279 · raw
@host:String -> @port:String -> @ns:String -> Config
The pod's service account, from KUBERNETES_SERVICE_HOST and _PORT (client-go's InClusterConfig). An IPv6 host needs no brackets here.
def Kube.names source · line 286 · raw
@xs:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> List<&2, String>
def Kube.merge.new.put source · line 293 · raw
@x:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @rest:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> @dup:Bool -> List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json>
def Kube.merge.new source · line 300 · raw
@b:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> @+seen:List<&2, String> -> List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json>
def Kube.merge.list source · line 308 · raw
@+a:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> @b:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json>
def Kube.merge.field source · line 311 · raw
@+a:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+b:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+f:String -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
def Kube.merge.cur source · line 314 · raw
@a:String -> @b:String -> String
def Kube.merge source · line 320 · raw
@+a:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+b:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
Two kubeconfigs as client-go merges a KUBECONFIG list: an entry named in the first wins over the same name in the second, and current-context is the first one set.
def Kube.rebase.str source · line 327 · raw
@dir:String -> @s:String -> @abs:Bool -> String
def Kube.rebase.path source · line 335 · raw
@+dir:String -> @p:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
A relative path in a kubeconfig is relative to the kubeconfig's directory.
def Kube.rebase.key source · line 342 · raw
@+o:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+dir:String -> @+k:String -> @missing:Bool -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
def Kube.rebase.keys source · line 349 · raw
@ks:List<&2, String> -> @+o:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+dir:String -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
def Kube.rebase.items source · line 356 · raw
@xs:List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json> -> @+dir:String -> @+inner:String -> @+ks:List<&2, String> -> List<&2, 0x4f5f473f9903832811734f64f633d6d3/src/json.Json>
def Kube.rebase source · line 366 · raw
@+kc:0x4f5f473f9903832811734f64f633d6d3/src/json.Json -> @+dir:String -> 0x4f5f473f9903832811734f64f633d6d3/src/json.Json
The kubeconfig with every file path made absolute against dir.
def Kube.dir.fin source · line 373 · raw
@d:String -> @bare:Bool -> String
def Kube.dir.go source · line 380 · raw
@+parts:List<&2, String> -> String
def Kube.dir source · line 385 · raw
@+p:String -> String
The directory of a path ("." when it has none).
def Config.with_pool source · line 388 · raw
@c:Config -> @pool:Chan(Socket) -> Config
def Config.pool source · line 393 · raw
@c:Config -> Maybe<&2, Chan(Socket)>
def Config.with_limit source · line 398 · raw
@c:Config -> @limit:Chan(Unit) -> Config
def Config.limit source · line 403 · raw
@c:Config -> Maybe<&2, Chan(Unit)>
def Config.server_name source · line 408 · raw
@c:Config -> String
def Config.with_server_name source · line 414 · raw
@c:Config -> @name:String -> Config
The config with the name the server's certificate must carry.
def Config.fence source · line 419 · raw
@c:Config -> Maybe<&2, Chan(FenceMsg)>
def Config.with_fence source · line 426 · raw
@c:Config -> @f:Chan(FenceMsg) -> Config
The config with a leadership fence (Kube.start sets it for the controllers when they run under leader election).
def Config.fence_as source · line 433 · raw
@c:Config -> @m:Maybe<&2, Chan(FenceMsg)> -> Config
The config with another config's leadership fence (or none): a watch on another cluster stays fenced by the controllers' lease.
def Src.ident source · line 438 · raw
@s:Src -> String
def Config.ident source · line 452 · raw
@c:Config -> String
Which cluster, as whom: the server and the credentials, so two configs share a watch only when they would see the same objects. Never logged (it can hold an inline token).
def Config.without_pool source · line 459 · raw
@c:Config -> Config
The config with no connection pool: one connection per request, until a pool of its own is set (Config.with_pool).
def Config.server.name source · line 464 · raw
@+sn:String -> @none:Bool -> String
def Config.server source · line 473 · raw
@c:Config -> String
The API server, for logs: its URL, and the certificate name when one is set (tls-server-name). No credentials.