Skip to content

ci: Add check for cilium error logs to cilium nightly pipeline #3592

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 27 additions & 2 deletions .pipelines/cni/cilium/nightly-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,37 @@ stages:
service: true

- job: logs
displayName: "Failure Logs"
displayName: "Nightly Logs"
dependsOn:
- cilium_nightly
- cni_linux
condition: failed()
condition: always()
steps:
- template: ../../templates/cilium-cli.yaml

- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}

set -e
echo "Run Cilium Connectivity Tests"
cilium status
cilium connectivity test --test check-log-errors --log-check-levels error
name: "ciliumConnectivityTests"
displayName: "Run Cilium Connectivity Tests"
condition: always()

- template: ../../templates/log-check-template.yaml # Operator Check
parameters:
clusterName: $(clusterName)-$(commitID)
podLabel: "name=cilium-operator"
logGrep: "level=error"

- template: ../../templates/log-template.yaml
parameters:
clusterName: ciliumnightly-$(commitID)
Expand Down
23 changes: 23 additions & 0 deletions .pipelines/templates/log-check-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
clusterName: ""
podLabel: ""
logGrep: ""

steps:
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}

if ! [ -z "$(kubectl logs -n kube-system -l ${{ parameters.podLabel }} --tail=-1 | grep ${{ parameters.logGrep }})" ]; then
kubectl logs -n kube-system -l ${{ parameters.podLabel }} --tail=-1 | grep ${{ parameters.logGrep }}
echo "Logs found with ${{ parameters.logGrep }}"
exit 1
fi
# Leaving "name:" blank as this template could be called multiple times in a single job with the same parameters.
displayName: "Check pod with ${{ parameters.podLabel }} label for ${{ parameters.logGrep }}"
condition: always()
Loading