mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
deploy: re-alignment of code in rook.sh
currently, rook.sh code is not aligned properly unside the functions, this commit does the code alignment. PS: this is done by vscode for me :) Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
901a1368ab
commit
c32bf71846
@ -36,11 +36,11 @@ rook_version() {
|
|||||||
function deploy_rook() {
|
function deploy_rook() {
|
||||||
kubectl_retry create -f "${ROOK_URL}/common.yaml"
|
kubectl_retry create -f "${ROOK_URL}/common.yaml"
|
||||||
|
|
||||||
# If rook version is > 1.5 , we will apply CRDs.
|
|
||||||
ROOK_MAJOR=$(rook_version 1)
|
ROOK_MAJOR=$(rook_version 1)
|
||||||
ROOK_MINOR=$(rook_version 2)
|
ROOK_MINOR=$(rook_version 2)
|
||||||
if [ "${ROOK_MAJOR}" -eq 1 ] && [ "${ROOK_MINOR}" -ge 5 ];
|
|
||||||
then
|
# If rook version is > 1.5 , we will apply CRDs.
|
||||||
|
if [ "${ROOK_MAJOR}" -eq 1 ] && [ "${ROOK_MINOR}" -ge 5 ]; then
|
||||||
kubectl_retry create -f "${ROOK_URL}/crds.yaml"
|
kubectl_retry create -f "${ROOK_URL}/crds.yaml"
|
||||||
fi
|
fi
|
||||||
TEMP_DIR="$(mktemp -d)"
|
TEMP_DIR="$(mktemp -d)"
|
||||||
@ -51,8 +51,7 @@ function deploy_rook() {
|
|||||||
|
|
||||||
kubectl_retry create -f "${TEMP_DIR}/operator.yaml"
|
kubectl_retry create -f "${TEMP_DIR}/operator.yaml"
|
||||||
# Override the ceph version which rook installs by default.
|
# Override the ceph version which rook installs by default.
|
||||||
if [ -z "${ROOK_CEPH_CLUSTER_IMAGE}" ]
|
if [ -z "${ROOK_CEPH_CLUSTER_IMAGE}" ]; then
|
||||||
then
|
|
||||||
kubectl_retry create -f "${ROOK_URL}/cluster-test.yaml"
|
kubectl_retry create -f "${ROOK_URL}/cluster-test.yaml"
|
||||||
else
|
else
|
||||||
ROOK_CEPH_CLUSTER_VERSION_IMAGE_PATH="image: ${ROOK_CEPH_CLUSTER_IMAGE}"
|
ROOK_CEPH_CLUSTER_VERSION_IMAGE_PATH="image: ${ROOK_CEPH_CLUSTER_IMAGE}"
|
||||||
@ -94,8 +93,7 @@ function teardown_rook() {
|
|||||||
kubectl delete -f "${ROOK_URL}/operator.yaml"
|
kubectl delete -f "${ROOK_URL}/operator.yaml"
|
||||||
ROOK_MAJOR=$(rook_version 1)
|
ROOK_MAJOR=$(rook_version 1)
|
||||||
ROOK_MINOR=$(rook_version 2)
|
ROOK_MINOR=$(rook_version 2)
|
||||||
if [ "${ROOK_MAJOR}" -eq 1 ] && [ "${ROOK_MINOR}" -ge 5 ];
|
if [ "${ROOK_MAJOR}" -eq 1 ] && [ "${ROOK_MINOR}" -ge 5 ]; then
|
||||||
then
|
|
||||||
kubectl delete -f "${ROOK_URL}/crds.yaml"
|
kubectl delete -f "${ROOK_URL}/crds.yaml"
|
||||||
fi
|
fi
|
||||||
kubectl delete -f "${ROOK_URL}/common.yaml"
|
kubectl delete -f "${ROOK_URL}/common.yaml"
|
||||||
@ -192,8 +190,11 @@ function check_rbd_stat() {
|
|||||||
|
|
||||||
TOOLBOX_POD=$(kubectl_retry -n rook-ceph get pods -l app=rook-ceph-tools -o jsonpath='{.items[0].metadata.name}')
|
TOOLBOX_POD=$(kubectl_retry -n rook-ceph get pods -l app=rook-ceph-tools -o jsonpath='{.items[0].metadata.name}')
|
||||||
TOOLBOX_POD_STATUS=$(kubectl_retry -n rook-ceph get pod "$TOOLBOX_POD" -ojsonpath='{.status.phase}')
|
TOOLBOX_POD_STATUS=$(kubectl_retry -n rook-ceph get pod "$TOOLBOX_POD" -ojsonpath='{.status.phase}')
|
||||||
[[ "$TOOLBOX_POD_STATUS" != "Running" ]] && \
|
[[ "$TOOLBOX_POD_STATUS" != "Running" ]] &&
|
||||||
{ echo "Toolbox POD ($TOOLBOX_POD) status: [$TOOLBOX_POD_STATUS]"; continue; }
|
{
|
||||||
|
echo "Toolbox POD ($TOOLBOX_POD) status: [$TOOLBOX_POD_STATUS]"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if kubectl_retry exec -n rook-ceph "$TOOLBOX_POD" -it -- rbd pool stats "$RBD_POOL_NAME" &>/dev/null; then
|
if kubectl_retry exec -n rook-ceph "$TOOLBOX_POD" -it -- rbd pool stats "$RBD_POOL_NAME" &>/dev/null; then
|
||||||
echo "RBD ($RBD_POOL_NAME) is successfully created..."
|
echo "RBD ($RBD_POOL_NAME) is successfully created..."
|
||||||
|
Loading…
Reference in New Issue
Block a user