Add target port to NGINX e2e tests

This commit is contained in:
stefanprodan
2019-10-07 10:01:28 +03:00
parent b5fb7cdae5
commit dff9287c75
2 changed files with 20 additions and 7 deletions

View File

@@ -14,4 +14,4 @@ spec:
paths:
- backend:
serviceName: podinfo
servicePort: 9898
servicePort: 80

View File

@@ -36,7 +36,8 @@ spec:
name: podinfo
progressDeadlineSeconds: 60
service:
port: 9898
port: 80
targetPort: http
canaryAnalysis:
interval: 15s
threshold: 15
@@ -138,11 +139,22 @@ until ${ok}; do
fi
done
echo '✔ Canary promotion test passed'
echo '>>> Waiting for canary finalization'
retries=50
count=0
ok=false
until ${ok}; do
kubectl -n test get canary/podinfo | grep 'Succeeded' && ok=true || ok=false
sleep 5
count=$(($count + 1))
if [[ ${count} -eq ${retries} ]]; then
kubectl -n ingress-nginx logs deployment/flagger
echo "No more retries left"
exit 1
fi
done
if [ "$1" = "canary" ]; then
exit 0
fi
echo '✔ Canary promotion test passed'
cat <<EOF | kubectl apply -f -
apiVersion: flagger.app/v1alpha3
@@ -161,7 +173,8 @@ spec:
name: podinfo
progressDeadlineSeconds: 60
service:
port: 9898
port: 80
targetPort: 9898
canaryAnalysis:
interval: 10s
threshold: 5