From 08ee61a29853f575fed5f67dba503820048624f0 Mon Sep 17 00:00:00 2001 From: Guillaume Berche Date: Mon, 13 Dec 2021 20:33:00 +0100 Subject: [PATCH] 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 --- plugins/flux.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/flux.yaml b/plugins/flux.yaml index 17132aa9..e52d2f8e 100644 --- a/plugins/flux.yaml +++ b/plugins/flux.yaml @@ -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"