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

fix ka command in kubernetes module (#884)

substring ..-1 not working. Use str trim to remove '-'
This commit is contained in:
Kuo-tung Kao 2024-06-24 20:00:35 +08:00 committed by GitHub
parent a992f5b4fa
commit 526c9525ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -266,7 +266,7 @@ export def --wrapped ka [
let n = $namespace | with-flag -n let n = $namespace | with-flag -n
let pod = if ($selector | is-empty) { let pod = if ($selector | is-empty) {
if ($pod | str ends-with '-') { if ($pod | str ends-with '-') {
$"deployment/($pod | str substring ..-1)" $"deployment/($pod | str trim --char '-' --right)"
} else { } else {
$pod $pod
} }