Skip to content

Commit

Permalink
fix: check in the olm test that the spod resource exists before waiti…
Browse files Browse the repository at this point in the history
…ng to be ready

This is to avoid that the olm test is randomly failing with 'resource not found', due to this
unsolved issue in kubernetes https://github.com/kubernetes/kubernetes/issues/83242.

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
  • Loading branch information
ccojocar authored and k8s-ci-robot committed Apr 13, 2022
1 parent 041ebb4 commit ac82a2e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hack/ci/e2e-olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ function check_spo_is_running() {
# wait for the operator to be ready
kubectl -nsecurity-profiles-operator wait --for=condition=ready pod -lname=security-profiles-operator
kubectl -nsecurity-profiles-operator wait --for=condition=ready pod -lname=security-profiles-operator-webhook

# wait for spod pod to be created, kubectl wait for un-existed resource seems to exit with error
# which is causing random test failure
# see https://github.com/kubernetes/kubernetes/issues/83242
for i in $(seq 1 10); do
found=$(kubectl get -nsecurity-profiles-operator pods -lname=spod 2> /dev/null)
if [[ $found ]]; then
break
fi
sleep 5
done
kubectl -nsecurity-profiles-operator wait --for=condition=ready pod -lname=spod
}

Expand Down

0 comments on commit ac82a2e

Please sign in to comment.