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