Skip to content

Commit

Permalink
minify js
Browse files Browse the repository at this point in the history
  • Loading branch information
mruoss committed Oct 31, 2023
1 parent 6fafbfa commit f235be4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1,427 deletions.
38 changes: 3 additions & 35 deletions dev.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,10 @@ Mix.install([{:kino_k8s, path: "~/src/community/kino_k8s"}])
)
```

<!-- livebook:{"attrs":{"connect_to":"exec","connect_tos":["exec","logs"],"connection":{"conn_hash":99636626,"variable":"conn"},"connections":[{"conn_hash":99636626,"variable":"conn"}],"container":"kindnet-cni","containers":["kindnet-cni"],"mix_env":"dev","namespace":"kube-system","namespaces":["default","kube-node-lease","kube-public","kube-system","local-path-storage"],"pod":"kindnet-p5nv5","pods":["coredns-5d78c9869d-4hvkk","coredns-5d78c9869d-ktfph","etcd-kino-k8s-control-plane","kindnet-p5nv5","kube-apiserver-kino-k8s-control-plane","kube-controller-manager-kino-k8s-control-plane","kube-proxy-gnvcp","kube-scheduler-kino-k8s-control-plane"]},"chunks":null,"kind":"Elixir.KinoK8s.TerminalCell","livebook_object":"smart_cell"} -->
<!-- livebook:{"attrs":{"connect_to":"exec","connect_tos":["exec","logs"],"connection":null,"connections":[],"container":null,"containers":null,"mix_env":"dev","namespace":null,"namespaces":null,"pod":null,"pods":null},"chunks":null,"kind":"Elixir.KinoK8s.TerminalCell","livebook_object":"smart_cell"} -->

```elixir
connect_to_pod = fn terminal_kino_pid ->
{:ok, send_to_websocket} =
K8s.Client.connect(
"v1",
"pods/exec",
[namespace: "kube-system", name: "kindnet-p5nv5"],
container: "kindnet-cni",
command: "/bin/sh",
tty: true
)
|> K8s.Client.put_conn(conn)
|> K8s.Client.stream_to(terminal_kino_pid)

send_to_websocket
end

KinoK8s.KinoTerminal.open(connect_to_pod)

```

<!-- livebook:{"attrs":{"connection":{"conn_hash":120031226,"variable":"conn"},"connections":[{"conn_hash":99636626,"variable":"conn"}],"gvk":null,"mix_env":"dev","namespace":null,"namespaces":null,"request_type":"get","request_types":["get","list","watch"],"resource":null,"resources":null,"result_type":null,"result_types":{"get":null,"list":["list","stream"],"watch":["stream"]},"result_variable":"result"},"chunks":null,"kind":"Elixir.KinoK8s.GetCell","livebook_object":"smart_cell"} -->
Expand All @@ -54,21 +38,5 @@ KinoK8s.KinoTerminal.open(connect_to_pod)
<!-- livebook:{"attrs":{"body":"kind: ConfigMap\napiVersion: v1\nmetadata:\n name: kino-k8s-cm\n namespace: default\ndata:\n key: default\n","connection":{"conn_hash":120031226,"variable":"conn"},"connections":[{"conn_hash":99636626,"variable":"conn"}],"method":"create","methods":["apply","create","update"],"result_variable":"applied_resource"},"chunks":null,"kind":"Elixir.KinoK8s.ApplyCell","livebook_object":"smart_cell"} -->

```elixir
import YamlElixir.Sigil

{:ok, applied_resource} =
~y"""
kind: ConfigMap
apiVersion: v1
metadata:
name: kino-k8s-cm
namespace: default
data:
key: default
"""
|> K8s.Client.create()
|> K8s.Client.put_conn(conn)
|> K8s.Client.run()

applied_resource |> Ymlr.document!() |> IO.puts()

```
299 changes: 1 addition & 298 deletions lib/assets/apply_cell/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f235be4

Please sign in to comment.