Skip to content

Commit

Permalink
fix Gateway API test
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbox committed Aug 23, 2024
1 parent 8f85b74 commit 380298b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,25 @@ _verify_same snip_ipbased_allow_list_and_deny_list_5 "$snip_ipbased_allow_list_a

if [ "$GATEWAY_API" == "true" ]; then
_verify_like snip_ipbased_allow_list_and_deny_list_8 "$snip_ipbased_allow_list_and_deny_list_8_out"
CLIENT_IP=$(kubectl get pods -n foo -o name -l istio.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $3}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_8
snip_ipbased_allow_list_and_deny_list_12
_wait_for_istio authorizationpolicy foo ingress-policy
else
_verify_like snip_ipbased_allow_list_and_deny_list_6 "$snip_ipbased_allow_list_and_deny_list_6_out"
CLIENT_IP=$(kubectl get pods -n istio-system | grep ingress | awk '{print $1}' | while read -r pod; do kubectl logs "$pod" -n istio-system | grep remoteIP; done | tail -1 | awk -F, '{print $3}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_6
snip_ipbased_allow_list_and_deny_list_10
_wait_for_istio authorizationpolicy istio-system ingress-policy
fi
_verify_same snip_ipbased_allow_list_and_deny_list_14 "$snip_ipbased_allow_list_and_deny_list_14_out"

if [ "$GATEWAY_API" == "true" ]; then
_verify_like snip_ipbased_allow_list_and_deny_list_9 "$snip_ipbased_allow_list_and_deny_list_9_out"
CLIENT_IP=$(kubectl get pods -n foo -o name -l istio.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $4}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_9
snip_ipbased_allow_list_and_deny_list_13
_wait_for_istio authorizationpolicy foo ingress-policy
else
_verify_like snip_ipbased_allow_list_and_deny_list_7 "$snip_ipbased_allow_list_and_deny_list_7_out"
CLIENT_IP=$(kubectl get pods -n istio-system -o name -l istio=ingressgateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n istio-system | grep remoteIP; done | tail -1 | awk -F, '{print $3}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_7
snip_ipbased_allow_list_and_deny_list_11
_wait_for_istio authorizationpolicy istio-system ingress-policy
fi
Expand All @@ -104,7 +104,7 @@ _verify_same snip_ipbased_allow_list_and_deny_list_14 "$snip_ipbased_allow_list_
# Test client IP denied

if [ "$GATEWAY_API" == "true" ]; then
CLIENT_IP=$(kubectl get pods -n foo -o name -l istio.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $3}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
CLIENT_IP=$(kubectl get pods -n foo -o name -l gateway.networking.k8s.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $3}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_17
_wait_for_istio authorizationpolicy foo ingress-policy
else
Expand All @@ -115,7 +115,7 @@ fi
_verify_same snip_ipbased_allow_list_and_deny_list_19 "$snip_ipbased_allow_list_and_deny_list_19_out"

if [ "$GATEWAY_API" == "true" ]; then
CLIENT_IP=$(kubectl get pods -n foo -o name -l istio.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $4}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
CLIENT_IP=$(kubectl get pods -n foo -o name -l gateway.networking.k8s.io/gateway-name=httpbin-gateway | sed 's|pod/||' | while read -r pod; do kubectl logs "$pod" -n foo | grep remoteIP; done | tail -1 | awk -F, '{print $4}' | awk -F: '{print $2}' | sed 's/ //') && echo "$CLIENT_IP"
snip_ipbased_allow_list_and_deny_list_18
_wait_for_istio authorizationpolicy foo ingress-policy
else
Expand Down

0 comments on commit 380298b

Please sign in to comment.