From fd6fe5c84681181141e793ebba2c939161790a10 Mon Sep 17 00:00:00 2001 From: olegvorobiov Date: Thu, 5 Sep 2024 09:41:53 -0400 Subject: [PATCH] awk to jsonpath --- scripts/rancher/cluster-actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rancher/cluster-actions.sh b/scripts/rancher/cluster-actions.sh index cd2cac0..d3fdca6 100644 --- a/scripts/rancher/cluster-actions.sh +++ b/scripts/rancher/cluster-actions.sh @@ -6,7 +6,7 @@ ####################################### rancher_list_clusters() { echo "Listing clusters registered in Rancher..." - kubectl get clusters.provisioning.cattle.io --all-namespaces | awk 'NR>1 {print $2}' + kubectl get clusters.provisioning.cattle.io --all-namespaces -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' } #######################################