Skip to content

Commit

Permalink
Add label prefix e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Dec 22, 2020
1 parent 6349dbf commit 0fa4654
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/kubernetes/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ kubectl apply -k ${REPO_ROOT}/kustomize/kubernetes
kubectl -n flagger-system set image deployment/flagger flagger=test/flagger:latest

kubectl -n flagger-system rollout status deployment/flagger
kubectl -n flagger-system rollout status deployment/flagger-prometheus
kubectl -n flagger-system rollout status deployment/flagger-prometheus
11 changes: 11 additions & 0 deletions test/kubernetes/test-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ until ${ok}; do
fi
done

passed=$(kubectl -n test get deploy/podinfo-primary -oyaml 2>&1 | { grep test-label-prefix || true; })
if [ -z "$passed" ]; then
echo -e '\u2716 primary copy labels by prefix test failed'
exit 1
fi
passed=$(kubectl -n test get deploy/podinfo-primary -oyaml 2>&1 | { grep test-annotation-prefix || true; })
if [ -z "$passed" ]; then
echo -e '\u2716 primary copy annotations by prefix test failed'
exit 1
fi

echo '✔ Canary initialization test passed'

echo '>>> Triggering canary deployment'
Expand Down
5 changes: 4 additions & 1 deletion test/workloads/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ metadata:
name: podinfo
namespace: test
labels:
app: podinfo
app.kubernetes.io/name: podinfo
app.kubernetes.io/managed-by: test-label-prefix
annotations:
app.kubernetes.io/instance: test-annotation-prefix
spec:
minReadySeconds: 5
revisionHistoryLimit: 5
Expand Down

0 comments on commit 0fa4654

Please sign in to comment.