1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

fix docker.nu and kubernetes.nu (#739)

updates using the spread operator

Co-authored-by: nash <nash@iffy.me>
This commit is contained in:
fj0r 2024-01-17 23:09:21 +08:00 committed by GitHub
parent 32d074eb04
commit e5176370f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -169,7 +169,7 @@ export def container-log-namespace [ctn: string@"nu-complete docker containers"
-n: string@"nu-complete docker ns" # namespace -n: string@"nu-complete docker ns" # namespace
] { ] {
let l = if $l == 0 { [] } else { [--tail $l] } let l = if $l == 0 { [] } else { [--tail $l] }
^$env.docker-cli ...($n | with-flag -n) logs -f $l $ctn ^$env.docker-cli ...($n | with-flag -n) logs -f ...$l $ctn
} }
# attach container # attach container
@ -228,7 +228,7 @@ export def container-history [img: string@"nu-complete docker images" -n: string
# save images # save images
export def image-save [-n: string@"nu-complete docker ns" ...img: string@"nu-complete docker images"] { export def image-save [-n: string@"nu-complete docker ns" ...img: string@"nu-complete docker images"] {
^$env.docker-cli ...($n | with-flag -n) save $img ^$env.docker-cli ...($n | with-flag -n) save ...$img
} }
# load images # load images
@ -259,13 +259,13 @@ export def image-tag [from: string@"nu-complete docker images" to: string -n: s
# push image # push image
export def image-push [img: string@"nu-complete docker images" -n: string@"nu-complete docker ns" -i] { export def image-push [img: string@"nu-complete docker images" -n: string@"nu-complete docker ns" -i] {
let $insecure = if $i {[--insecure-registry]} else {[]} let $insecure = if $i {[--insecure-registry]} else {[]}
^$env.docker-cli ...($n | with-flag -n) $insecure push $img ^$env.docker-cli ...($n | with-flag -n) ...$insecure push $img
} }
# pull image # pull image
export def image-pull [img -n: string@"nu-complete docker ns" -i] { export def image-pull [img -n: string@"nu-complete docker ns" -i] {
let $insecure = if $i {[--insecure-registry]} else {[]} let $insecure = if $i {[--insecure-registry]} else {[]}
^$env.docker-cli ...($n | with-flag -n) $insecure pull $img ^$env.docker-cli ...($n | with-flag -n) ...$insecure pull $img
} }
### list volume ### list volume
@ -289,7 +289,7 @@ export def volume-inspect [name: string@"nu-complete docker volume" -n: string@"
# remove volume # remove volume
export def volume-remove [...name: string@"nu-complete docker volume" -n: string@"nu-complete docker ns"] { export def volume-remove [...name: string@"nu-complete docker volume" -n: string@"nu-complete docker ns"] {
^$env.docker-cli ...($n | with-flag -n) volume rm $name ^$env.docker-cli ...($n | with-flag -n) volume rm ...$name
} }
### run ### run

View file

@ -1056,7 +1056,7 @@ export def kdelh [
name: string@"nu-complete helm list" name: string@"nu-complete helm list"
--namespace (-n): string@"nu-complete kube ns" --namespace (-n): string@"nu-complete kube ns"
] { ] {
helm uninstall $name ($namespace | with-flag -n) helm uninstall $name ...($namespace | with-flag -n)
} }
# helm template # helm template