Fixed teleport matching

This commit is contained in:
Lockszmith (VAST@MacBook) 2025-06-25 12:27:24 -04:00
parent 349517ea93
commit 1eb48f8c25

View file

@ -180,22 +180,25 @@ _do_search() {
else ""
end)
+ "cluster_psnt=\(.metadata.labels.cluster_psnt),"
+ "hostname=\(.spec.hostname)"
+ "hostname=\(.spec.hostname),"
+ "teleport.internal/resource-id=\(.metadata.labels["teleport.internal/resource-id"])"
'
)"
if [[ -z "$BATCH" && "${OPTIONS}" == *$'\n'* ]]; then
SELECTED="$( tv --no-preview <<<"$OPTIONS" )"
SELECTED_RAW="$( tv --no-preview <<<"$OPTIONS" )"
else
SELECTED="$OPTIONS"
SELECTED_RAW="$OPTIONS"
fi
if [[ -z "$SELECTED" ]]; then
if [[ -z "$SELECTED_RAW" ]]; then
${SILENT:+:} printf 'Aborted (empty response)\n' >&2
exit 2
else
SELECTED="$(<<<"$SELECTED_RAW" awk -F',' '{ print $4 }' )"
fi
${SILENT:+:} printf '\n%s selected.\n' "$SELECTED" >&2
${SILENT:+:} printf '\n%s selected.\n' "$SELECTED_RAW" >&2
echo "$SELECTED"
}