cleaned up validate_private_ingress
This commit is contained in:
parent
549401d356
commit
7e44dc3985
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user