From 7e44dc39855b726fd5da3d001a5020df4f21ab20 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Wed, 6 Apr 2022 14:53:29 +0200 Subject: [PATCH] cleaned up validate_private_ingress --- .functions/kubernetes.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.functions/kubernetes.sh b/.functions/kubernetes.sh index de6d1c4..c515cdf 100644 --- a/.functions/kubernetes.sh +++ b/.functions/kubernetes.sh @@ -40,6 +40,9 @@ function validate_private_ingress(){ local OK='\e[32m\u2714\e[0m' local NOT_OK='\u274c' printf "Validating ingresses in private project (%s}\n" "$PRIVATE_PROJECT_ID" + printf "%-22s %s\n" "namespace" "ingress" + printf -- '-%.0s' {1..30} + printf "\n" for NS in $(kubectl get namespaces --selector=field.cattle.io/projectId="$PRIVATE_PROJECT_ID" --template "{{range .items}}{{.metadata.name}}{{\"\n\"}}{{end}}"); do for INGRESS in $(kubectl --namespace "$NS" get ingress --template "{{range .items}}{{.metadata.name}}{{\"\n\"}}{{end}}"); do if [[ $(kubectl --namespace "$NS" get ingress "$INGRESS" -o jsonpath='{.metadata.annotations.nginx\.ingress\.kubernetes\.io/whitelist-source-range}') == "$WHITELIST_SOURCE_RANGE" ]];then