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

Upgraded to 0.84 (#583)

`gig` for editing .gitignore
export aliases of `docker.nu`
implement `kdh` without helm-diff installed

Co-authored-by: agent <agent@nuc>
This commit is contained in:
fj0r 2023-08-23 19:23:14 +08:00 committed by GitHub
parent f2e35e153c
commit e5cf9b15ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 39 deletions

View file

@ -225,10 +225,28 @@ export def kah [
export def kdh [
name: string@"nu-complete helm list"
chart: string@"nu-complete helm charts"
values: path
valuefile: path
--values (-v): any
--namespace (-n): string@"nu-complete kube ns"
--has-plugin (-h): bool
] {
helm diff upgrade $name $chart -f $values (spr [-n $namespace])
if $has_plugin {
helm diff $name $chart -f $valuefile (spr [-n $namespace])
} else {
let update = $name in (
helm list (spr [-n $namespace]) --output json
| from json | get name
)
if not $update {
echo "new installation"
return
}
let values = if ($values | is-empty) { [] } else { [--set-json (record-to-set-json $values)] }
let target = $'/tmp/($chart | path basename).($name).out.yaml'
helm template --debug $name $chart -f $valuefile $values (spr [-n $namespace]) | save -f $target
kubectl diff -f $target
}
}
# helm delete