Skip to content

Commit

Permalink
ci: verify that Ceph Mgr is running
Browse files Browse the repository at this point in the history
The Ceph v17.2.2 container-image fails to start Ceph Mgr. This causes
issues while the e2e test suite is running. It is better to check if
Ceph Mgr is available, before continuing with the rest of the CI job.

Updates: #3259
Signed-off-by: Niels de Vos <ndevos@redhat.com>
  • Loading branch information
nixpanic authored and mergify[bot] committed Jul 26, 2022
1 parent 3ddec80 commit 04889e6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/rook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ function deploy_rook() {
check_ceph_cluster_health
fi

# Make sure Ceph Mgr is running
check_ceph_mgr

# Check if CephFileSystem is empty
if ! kubectl_retry -n rook-ceph get cephfilesystems -oyaml | grep 'items: \[\]' &>/dev/null; then
check_mds_stat
Expand Down Expand Up @@ -166,6 +169,22 @@ function check_ceph_cluster_health() {
echo ""
}

function check_ceph_mgr() {
for ((retry = 0; retry <= ROOK_DEPLOY_TIMEOUT; retry = retry + 5)); do
echo "Waiting for Ceph Mgr... ${retry}s" && sleep 5

MGR_POD=$(kubectl_retry -n rook-ceph get pods -l app=rook-ceph-mgr -o jsonpath='{.items[0].metadata.name}')
MGR_POD_STATUS=$(kubectl_retry -n rook-ceph get pod "$MGR_POD" -ojsonpath='{.status.phase}')
[[ "$MGR_POD_STATUS" = "Running" ]] && break
done

if [ "$retry" -gt "$ROOK_DEPLOY_TIMEOUT" ]; then
echo "[Timeout] Ceph Mgr is not running (timeout)"
return 1
fi
echo ""
}

function check_mds_stat() {
for ((retry = 0; retry <= ROOK_DEPLOY_TIMEOUT; retry = retry + 5)); do
FS_NAME=$(kubectl_retry -n rook-ceph get cephfilesystems.ceph.rook.io -ojsonpath='{.items[0].metadata.name}')
Expand Down

0 comments on commit 04889e6

Please sign in to comment.