Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e tests for label prefix inclusion #762

Merged
merged 3 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: build

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
- github-actions

jobs:
container:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: e2e

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
- github-actions

jobs:
kind:
Expand Down
4 changes: 1 addition & 3 deletions kustomize/appmesh/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ spec:
- name: flagger
args:
- -log-level=info
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=appmesh
- -metrics-server=http://appmesh-prometheus:9090
- -slack-user=flagger
- -slack-channel=
- -slack-url=
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
Expand Down
4 changes: 1 addition & 3 deletions kustomize/contour/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ spec:
- name: flagger
args:
- -log-level=info
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=contour
- -ingress-class=contour
- -metrics-server=http://flagger-prometheus:9090
- -slack-user=flagger
- -slack-channel=
- -slack-url=
5 changes: 1 addition & 4 deletions kustomize/istio/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ spec:
- name: flagger
args:
- -log-level=info
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=istio
- -metrics-server=http://prometheus:9090
- -slack-user=flagger
- -slack-channel=
- -slack-url=
---
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
Expand Down
4 changes: 1 addition & 3 deletions kustomize/kubernetes/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ spec:
- name: flagger
args:
- -log-level=info
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=kubernetes
- -metrics-server=http://flagger-prometheus:9090
- -slack-user=flagger
- -slack-channel=
- -slack-url=
4 changes: 1 addition & 3 deletions kustomize/linkerd/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ spec:
- name: flagger
args:
- -log-level=info
- -include-label-prefix=app.kubernetes.io
- -mesh-provider=linkerd
- -metrics-server=http://linkerd-prometheus:9090
- -slack-user=flagger
- -slack-channel=
- -slack-url=
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
Expand Down
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