Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ steps:
- script: |
echo "validate pod IP assignment and check systemd-networkd restart"
kubectl get pod -owide -A
if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then
echo "Check cilium identities in cilium-test namepsace during nightly run"
echo "expect the identities to be deleted when the namespace is deleted"
kubectl get ciliumidentity | grep cilium-test
fi
make test-validate-state
echo "delete cilium connectivity test resources and re-validate state"
kubectl delete ns cilium-test
Expand All @@ -166,6 +171,33 @@ steps:
name: "validatePods"
displayName: "Validate Pods"

- script: |
if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then
kubectl get pod -owide -n cilium-test
echo "wait for pod and cilium identity deletion in cilium-test namespace"
ns="cilium-test"
while true; do
pods=$(kubectl get pods -n $ns --no-headers=true 2>/dev/null)
if [[ -z "$pods" ]]; then
echo "No pods found"
break
fi
sleep 2s
done
sleep 20s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are sleeping again after checking the deletion of pods ? For cilium gc ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, need to wait for cilium gc

echo "Verify cilium identities are deleted from cilium-test"
checkIdentity="$(kubectl get ciliumidentity -o json | grep cilium-test | jq -e 'length == 0')"
if [[ -n $checkIdentity ]]; then
echo "##[error]Cilium Identities still present in cilium-test namespace"
else
printf -- "Identities deleted from cilium-test namespace\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we added printf and not echo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I wrote this for the original nightly pipeline I recall I had to change the first case to echo with azp syntax in order to indicate actual failure in the pipeline.

fi
else
echo "skip cilium identities check for PR pipeline"
fi
name: "CiliumIdentities"
displayName: "Verify Cilium Identities Deletion"

- script: |
echo "validate pod IP assignment before CNS restart"
kubectl get pod -owide -A
Expand Down
2 changes: 2 additions & 0 deletions test/integration/manifests/cilium/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
args:
- --config-dir=/tmp/cilium/config-map
- --debug=$(CILIUM_DEBUG)
- --identity-gc-interval=0m20s
- --identity-heartbeat-timeout=0m20s
env:
- name: K8S_NODE_NAME
valueFrom:
Expand Down