Skip to content

Commit c68a055

Browse files
rarescosmalunkan93
authored andcommitted
More Cilium test fixes (#2764)
1 parent 4babc49 commit c68a055

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

helmfile.d/charts/grafana-dashboards/dashboards/cilium-networkpolicy-dashboard.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
}
263263
},
264264
"mappings": [],
265+
"noValue": "missing",
265266
"thresholds": {
266267
"mode": "absolute",
267268
"steps": [
@@ -360,6 +361,7 @@
360361
}
361362
},
362363
"mappings": [],
364+
"noValue": "missing",
363365
"thresholds": {
364366
"mode": "absolute",
365367
"steps": [

tests/end-to-end/log-manager/resources/calico-allow-all.yaml renamed to tests/common/network-policies/calico-allow-all.yaml

File renamed without changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
apiVersion: cilium.io/v2
3+
kind: CiliumClusterwideNetworkPolicy
4+
metadata:
5+
name: global-allow-all-traffic
6+
spec:
7+
endpointSelector: {}
8+
ingress:
9+
- fromEntities:
10+
- "all"
11+
- fromEndpoints:
12+
- {}
13+
- fromCIDR:
14+
- "0.0.0.0/0"
15+
- "::/0"
16+
egress:
17+
- toEntities:
18+
- "all"
19+
- toEndpoints:
20+
- {}
21+
- toCIDR:
22+
- "0.0.0.0/0"
23+
- "::/0"

tests/end-to-end/log-manager/setup_suite.bash

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ setup_suite() {
1010

1111
# Temporarily allow all traffic to not cause dropped packets and fail the Network Policy test suite.
1212
if kubectl get crd globalnetworkpolicies.crd.projectcalico.org; then
13-
kubectl apply -f "${BATS_CWD}/end-to-end/log-manager/resources/calico-allow-all.yaml" >&3 2>&1
13+
kubectl apply -f "${BATS_CWD}/common/network-policies/calico-allow-all.yaml" >&3 2>&1
1414
# Give the CNI a bit of time to settle (arbitrary, I know..)
1515
sleep 15
1616
fi
17+
if kubectl get crd ciliumclusterwidenetworkpolicies.cilium.io; then
18+
kubectl apply -f "${BATS_CWD}/common/network-policies/cilium-allow-all.yaml" >&3 2>&1
19+
sleep 15
20+
fi
1721

1822
# Both Prometheus and the blackbox exporter will attempt to reach inexisting pods if they aren't
1923
# scaled down, causing dropped packets and failing the Network Policy test suite.
@@ -56,7 +60,10 @@ teardown_suite() {
5660

5761
# Delete the allow-all policy
5862
if kubectl get crd globalnetworkpolicies.crd.projectcalico.org; then
59-
kubectl delete -f "${BATS_CWD}/end-to-end/log-manager/resources/calico-allow-all.yaml" --ignore-not-found >&3 2>&1
63+
kubectl delete -f "${BATS_CWD}/common/network-policies/calico-allow-all.yaml" --ignore-not-found >&3 2>&1
64+
fi
65+
if kubectl get crd ciliumclusterwidenetworkpolicies.cilium.io; then
66+
kubectl delete -f "${BATS_CWD}/common/network-policies/cilium-allow-all.yaml" --ignore-not-found >&3 2>&1
6067
fi
6168
}
6269

0 commit comments

Comments
 (0)