mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 19:10:21 +00:00
ci: verify that Ceph Mgr is running
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>
This commit is contained in:
parent
3ddec80346
commit
04889e66db
@ -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
|
||||
@ -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}')
|
||||
|
Loading…
Reference in New Issue
Block a user