From 11c1b98d60b175ac5c4e89fd9cd8dea7e25a0978 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Sat, 10 Aug 2019 23:37:48 -0400 Subject: [PATCH] Add filter to skip services with replicas set to 0 --- psu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/psu b/psu index 941d687..3987618 100644 --- a/psu +++ b/psu @@ -1066,7 +1066,11 @@ services() { filters=="{$filter_service}" \ "Authorization: Bearer $AUTH_TOKEN") check_for_errors $? "$services" - echo "$services" + + local filter_mode + # If a service has a replicas set to zero, skip it! + filter_mode="map(select(.Spec.Mode.Global or any(.Spec.Mode.Replicated; .Replicas > 0)))" + echo "$services" | jq -jc "$filter_mode" } containers() {