Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions .pipelines/cni/cilium/nightly-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ stages:
parameters:
clusterName: $(clusterName)-$(commitID)

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

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

- template: ../../templates/delete-cluster.yaml
parameters:
name: $(name)
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
done
# 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