Compare commits
No commits in common. "c3efa7d60e5e2cdbb7ab0aa01e5c75c082ecb4e8" and "2a236da096124bc022e3e3fffb050fd7e15dcf9e" have entirely different histories.
c3efa7d60e
...
2a236da096
@ -5,7 +5,6 @@ source xdg.nu
|
||||
|
||||
use themes.nu
|
||||
use completions *
|
||||
use inspect
|
||||
#{{- if eq .age_key "age1htqslfl4d5uv76j8eg49u9njqjx5udj9jmg3ujf2gxjjm06z0vqqwz6tlm" }}
|
||||
overlay use work
|
||||
#{{- end }}
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
export def configurations []: [
|
||||
nothing -> table<record<name: string active: bool account: string zone: string region: string>>
|
||||
] {
|
||||
gcloud config configurations list
|
||||
| detect columns
|
||||
| rename name active account project zone region
|
||||
| each { update active { $in == True } }
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
export def namespaces [] {
|
||||
# nothing -> table<record<name: string namespace: string active: string age: string>>
|
||||
#] {
|
||||
kubectl get namespaces | detect columns | rename name status age
|
||||
}
|
||||
|
||||
export def services [
|
||||
--namespace: string@"complete namespaces"
|
||||
--service: string@"complete services"
|
||||
] {
|
||||
let args = [
|
||||
( if $namespace != null {
|
||||
[ $"--namespace=($namespace)" ]
|
||||
} else {
|
||||
[ $"--all-namespaces" ]
|
||||
} )
|
||||
] | flatten
|
||||
|
||||
kubectl get services ...$args -o yaml
|
||||
| from yaml
|
||||
| get items
|
||||
| each { {
|
||||
name: $in.metadata.name
|
||||
namespace: $in.metadata.namespace
|
||||
ports: $in.spec.ports
|
||||
selector: $in.spec.selector?
|
||||
} }
|
||||
| where selector != null
|
||||
| where name == $service or $service == null
|
||||
}
|
||||
|
||||
export def "complete namespaces" []: nothing -> list<string> {
|
||||
namespaces | get name
|
||||
}
|
||||
|
||||
export def "complete services" []: nothing -> list<string> {
|
||||
services | get name
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
export use gcloud.nu
|
||||
export use k8s.nu
|
||||
export use tmux.nu
|
||||
@ -1,15 +0,0 @@
|
||||
# list of tmux sessions
|
||||
export def sessions []: [
|
||||
nothing -> table<record<
|
||||
name: string
|
||||
id: string
|
||||
attached: number
|
||||
windows: number
|
||||
attached_list: list<string>
|
||||
>>
|
||||
] {
|
||||
tmux list-sessions -F "#{session_name}\t#{session_id}\t#{session_windows}\t#{session_attached}\t#{session_attached_list}"
|
||||
| from tsv --noheaders
|
||||
| rename name id windows attached attached_list
|
||||
| update attached_list { split row , }
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user