Add flux trace shortcut to flux plugin (#1356)

* Add flux trace shortcut to flux plugin

Implementation notes: $RESOURCE_NAME is exported in plural form (e.g. cronjobs, pods) so the script trims the trailing s if any.

* Generalize to support other resource name plural forms

such as Ingresses
mine
Guillaume Berche 2021-12-13 20:33:00 +01:00 committed by GitHub
parent 4a8a653e74
commit 08ee61a298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -58,3 +58,14 @@ plugin:
args:
- -c
- "flux reconcile kustomization -n $NAMESPACE $NAME | less"
trace:
shortCut: Shift-A
confirm: false
description: Flux trace
scopes:
- all
command: sh
background: false
args:
- -c
- "flux trace $NAME --kind `echo $RESOURCE_NAME | sed -E 's/(s|es)$//g'` --api-version $RESOURCE_GROUP/$RESOURCE_VERSION --namespace $NAMESPACE $NAME | less"