Fix delayed ingress startup in tests (#438)
* Fix delayed ingress startup in tests Signed-off-by: Kevin Fox <[email protected]> * Fix lint Signed-off-by: Kevin Fox <[email protected]> --------- Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -72,6 +72,16 @@ $(helm ls -A | sed 's/\t/ | /g' | sed 's/^/| /' | sed 's/$/ |/' | sed '/^| NAME.
|
||||
EOF
|
||||
}
|
||||
|
||||
common_test_url () (
|
||||
count=10
|
||||
while true; do
|
||||
if curl "$1"; then exit 0; fi
|
||||
sleep 2
|
||||
count=$((count-1))
|
||||
[ $count -le 0 ] && exit 1
|
||||
done
|
||||
)
|
||||
|
||||
# Used just for testing. You should provide your own values as described in the install instructions.
|
||||
common_test_your_values () {
|
||||
cat > /tmp/$$.example-your-values.yaml <<EOF
|
||||
|
||||
@@ -61,7 +61,7 @@ helm upgrade --install ingress-nginx ingress-nginx --version "$VERSION_INGRESS_N
|
||||
--wait
|
||||
|
||||
# Test the ingress controller. Should 404 as there is no services yet.
|
||||
curl "$IP"
|
||||
common_test_url "$IP"
|
||||
|
||||
kubectl get configmap -n kube-system coredns -o yaml | grep hosts || kubectl get configmap -n kube-system coredns -o yaml | sed "/ready/a\ hosts {\n fallthrough\n }" | kubectl apply -f -
|
||||
kubectl get configmap -n kube-system coredns -o yaml | grep production.other || kubectl get configmap -n kube-system coredns -o yaml | sed "/hosts/a\ $IP oidc-discovery.production.other\n $IP spire-server.production.other\n" | kubectl apply -f -
|
||||
|
||||
@@ -61,7 +61,7 @@ helm upgrade --install ingress-nginx ingress-nginx --version "$VERSION_INGRESS_N
|
||||
--wait
|
||||
|
||||
# Test the ingress controller. Should 404 as there is no services yet.
|
||||
curl "$IP"
|
||||
common_test_url "$IP"
|
||||
|
||||
kubectl get configmap -n kube-system coredns -o yaml | grep hosts || kubectl get configmap -n kube-system coredns -o yaml | sed "/ready/a\ hosts {\n fallthrough\n }" | kubectl apply -f -
|
||||
kubectl get configmap -n kube-system coredns -o yaml | grep production.other || kubectl get configmap -n kube-system coredns -o yaml | sed "/hosts/a\ $IP oidc-discovery.production.other\n $IP spire-server.production.other\n" | kubectl apply -f -
|
||||
|
||||
Reference in New Issue
Block a user