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
] {
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
@ -228,7 +228,7 @@ export def container-history [img: string@"nu-complete docker images" -n: string
# save 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
@ -259,13 +259,13 @@ export def image-tag [from: string@"nu-complete docker images" to: string -n: s
# push image
export def image-push [img: string@"nu-complete docker images" -n: string@"nu-complete docker ns" -i] {
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
export def image-pull [img -n: string@"nu-complete docker ns" -i] {
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
@ -289,7 +289,7 @@ export def volume-inspect [name: string@"nu-complete docker volume" -n: string@"
# remove volume
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

View File

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