src/config.bend checks
raw source on the hub · import bend-kube-runtime@0.5.2.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 Config source · line 31 · 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). 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).
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 -> Config
type Url source · line 49 · raw
Data
Url@host:String -> @port:U32 -> @base:String -> Url
Definitions
def Config.host source · line 36 · raw
@c:Config -> String
def Config.namespace source · line 41 · raw
@c:Config -> String
def Url.drop_scheme.go source · line 52 · raw
@s:String -> @tls:Bool -> String
def Url.drop_scheme source · line 59 · raw
@+s:String -> String
def Url.split_path source · line 63 · raw
@s:String -> @acc:String -> Pair(String, String)
Splits "authority/path" at the first '/'.
def Url.port source · line 72 · raw
@p:String -> @+dflt:U32 -> U32
def Url.host_port.v6 source · line 75 · raw
@parts:List<&2, String> -> @+dflt:U32 -> Pair(String, U32)
def Url.host_port.v4 source · line 84 · raw
@parts:List<&2, String> -> @+dflt:U32 -> Pair(String, U32)
def Url.host_port source · line 95 · 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 102 · raw
@s:String -> String
def Url.trim_slash source · line 109 · raw
@s:String -> String
def Url.parse.fin source · line 112 · raw
@hp:Pair(String, U32) -> @base:String -> Url
def Url.parse.go source · line 117 · raw
@ap:Pair(String, String) -> Url
def Url.parse source · line 122 · raw
@s:String -> Url
def Kube.named.if source · line 125 · raw
@+x:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+field:String -> @rest:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @hit:Bool -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
def Kube.named source · line 137 · raw
@xs:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> @+name:String -> @+field:String -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/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 145 · raw
@bs:Maybe<&2, List<&2, U32>> -> Src
def Kube.src.go source · line 152 · raw
@data:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @path:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> Src
def Kube.src source · line 162 · raw
@+o:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+name:String -> Src
A secret from "<name>-data" (base64, inline) or "<name>" (a path).
def Kube.strs source · line 165 · raw
@xs:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> List<&2, String>
def Kube.token.exec source · line 176 · raw
@c:0x2c4c1c49bdb5ccfc58560ac0a132da8e/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 186 · raw
@xs:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> List<&2, String>
An exec plugin's env entries ({name, value}) as "name=value".
def Kube.token.go source · line 194 · raw
@t:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @f:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+e:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> Src
def Kube.token source · line 204 · raw
@+u:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> Src
def Kube.config.pick.go source · line 207 · raw
@ctx:String -> @cur:String -> @empty:Bool -> String
def Kube.config.pick source · line 214 · raw
@+ctx:String -> @cur:String -> String
def Kube.config.fin source · line 217 · 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 223 · raw
@s:0x2c4c1c49bdb5ccfc58560ac0a132da8e/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 231 · raw
@+cl:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+u:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @ns:String -> @name:String -> @missing:Bool -> Result<&2, &2, String, Config>
def Kube.config.with source · line 241 · raw
@+kc:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @name:String -> @+c:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> Result<&2, &2, String, Config>
def Kube.config.ctx source · line 249 · raw
@+kc:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+name:String -> Result<&2, &2, String, Config>
def Kube.config source · line 254 · raw
@+kc:0x2c4c1c49bdb5ccfc58560ac0a132da8e/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 260 · raw
String
def InCluster.config source · line 265 · 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 272 · raw
@xs:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> List<&2, String>
def Kube.merge.new.put source · line 279 · raw
@x:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @rest:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> @dup:Bool -> List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json>
def Kube.merge.new source · line 286 · raw
@b:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> @+seen:List<&2, String> -> List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json>
def Kube.merge.list source · line 294 · raw
@+a:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> @b:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json>
def Kube.merge.field source · line 297 · raw
@+a:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+b:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+f:String -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
def Kube.merge.cur source · line 300 · raw
@a:String -> @b:String -> String
def Kube.merge source · line 306 · raw
@+a:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+b:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/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 313 · raw
@dir:String -> @s:String -> @abs:Bool -> String
def Kube.rebase.path source · line 321 · raw
@+dir:String -> @p:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
A relative path in a kubeconfig is relative to the kubeconfig's directory.
def Kube.rebase.key source · line 328 · raw
@+o:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+dir:String -> @+k:String -> @missing:Bool -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
def Kube.rebase.keys source · line 335 · raw
@ks:List<&2, String> -> @+o:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+dir:String -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
def Kube.rebase.items source · line 342 · raw
@xs:List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json> -> @+dir:String -> @+inner:String -> @+ks:List<&2, String> -> List<&2, 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json>
def Kube.rebase source · line 352 · raw
@+kc:0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json -> @+dir:String -> 0x2c4c1c49bdb5ccfc58560ac0a132da8e/src/json.Json
The kubeconfig with every file path made absolute against dir.
def Kube.dir.fin source · line 359 · raw
@d:String -> @bare:Bool -> String
def Kube.dir.go source · line 366 · raw
@+parts:List<&2, String> -> String
def Kube.dir source · line 371 · raw
@+p:String -> String
The directory of a path ("." when it has none).
def Config.with_pool source · line 374 · raw
@c:Config -> @pool:Chan(Socket) -> Config
def Config.pool source · line 379 · raw
@c:Config -> Maybe<&2, Chan(Socket)>
def Config.with_limit source · line 384 · raw
@c:Config -> @limit:Chan(Unit) -> Config
def Config.limit source · line 389 · raw
@c:Config -> Maybe<&2, Chan(Unit)>
def Config.server_name source · line 394 · raw
@c:Config -> String
def Config.with_server_name source · line 400 · raw
@c:Config -> @name:String -> Config
The config with the name the server's certificate must carry.