Skip to content

Commit

Permalink
Merge pull request #762 from fluxcd/label-prefix
Browse files Browse the repository at this point in the history
Add e2e tests for label prefix inclusion
  • Loading branch information
stefanprodan authored Dec 22, 2020
2 parents 70114e3 + 0fa4654 commit b8625d5
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
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

0 comments on commit b8625d5

Please sign in to comment.