Skip to content

Commit 7496dae

Browse files
authored
ci: Add check for cilium error logs to cilium nightly pipeline (#3592)
* ci: create log check template * ci: add log check to cilium nightly * chore: clean up spacing. * ci: move log check, address nit
1 parent 4638620 commit 7496dae

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.pipelines/cni/cilium/nightly-release-test.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,37 @@ stages:
144144
service: true
145145

146146
- job: logs
147-
displayName: "Failure Logs"
147+
displayName: "Nightly Logs"
148148
dependsOn:
149149
- cilium_nightly
150150
- cni_linux
151-
condition: failed()
151+
condition: always()
152152
steps:
153+
- template: ../../templates/cilium-cli.yaml
154+
155+
- task: AzureCLI@2
156+
inputs:
157+
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
158+
scriptLocation: "inlineScript"
159+
scriptType: "bash"
160+
addSpnToEnvironment: true
161+
inlineScript: |
162+
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}
163+
164+
set -e
165+
echo "Run Cilium Connectivity Tests"
166+
cilium status
167+
cilium connectivity test --test check-log-errors --log-check-levels error
168+
name: "ciliumConnectivityTests"
169+
displayName: "Run Cilium Connectivity Tests"
170+
condition: always()
171+
172+
- template: ../../templates/log-check-template.yaml # Operator Check
173+
parameters:
174+
clusterName: $(clusterName)-$(commitID)
175+
podLabel: "name=cilium-operator"
176+
logGrep: "level=error"
177+
153178
- template: ../../templates/log-template.yaml
154179
parameters:
155180
clusterName: ciliumnightly-$(commitID)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
parameters:
2+
clusterName: ""
3+
podLabel: ""
4+
logGrep: ""
5+
6+
steps:
7+
- task: AzureCLI@2
8+
inputs:
9+
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
10+
scriptLocation: "inlineScript"
11+
scriptType: "bash"
12+
addSpnToEnvironment: true
13+
inlineScript: |
14+
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}
15+
16+
if ! [ -z "$(kubectl logs -n kube-system -l ${{ parameters.podLabel }} --tail=-1 | grep ${{ parameters.logGrep }})" ]; then
17+
kubectl logs -n kube-system -l ${{ parameters.podLabel }} --tail=-1 | grep ${{ parameters.logGrep }}
18+
echo "Logs found with ${{ parameters.logGrep }}"
19+
exit 1
20+
fi
21+
# Leaving "name:" blank as this template could be called multiple times in a single job with the same parameters.
22+
displayName: "Check pod with ${{ parameters.podLabel }} label for ${{ parameters.logGrep }}"
23+
condition: always()

0 commit comments

Comments
 (0)