mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
Move rook-deploy code from e2e to ./scripts/minikube.sh
We have the e2e test with --deploy-rook=true that makes all test environment. It works fine, but It does not seem to be the role of e2e test. In addition, when developing the code we need to run full test scenario with deploying rook every time, or we need to build rook environment by hand. Move rook-deploy code to minikube.sh.
This commit is contained in:
committed by
mergify[bot]
parent
685e2540a8
commit
2c9d711463
48
scripts/rook.sh
Executable file
48
scripts/rook.sh
Executable file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
ROOK_VERSION=${ROOK_VERSION:-"v1.1.7"}
|
||||
ROOK_DEPLOY_TIMEOUT=${ROOK_DEPLOY_TIMEOUT:-300}
|
||||
ROOK_URL="https://raw.githubusercontent.com/rook/rook/${ROOK_VERSION}/cluster/examples/kubernetes/ceph"
|
||||
|
||||
function deploy_rook() {
|
||||
kubectl create -f "${ROOK_URL}/common.yaml"
|
||||
kubectl create -f "${ROOK_URL}/operator.yaml"
|
||||
kubectl create -f "${ROOK_URL}/cluster-test.yaml"
|
||||
kubectl create -f "${ROOK_URL}/toolbox.yaml"
|
||||
kubectl create -f "${ROOK_URL}/filesystem-test.yaml"
|
||||
kubectl create -f "${ROOK_URL}/pool-test.yaml"
|
||||
|
||||
for ((retry=0; retry<=ROOK_DEPLOY_TIMEOUT; retry=retry+5)); do
|
||||
echo "Wait for rook deploy... ${retry}s"
|
||||
sleep 5
|
||||
|
||||
if kubectl get cephclusters -n rook-ceph | grep HEALTH_OK &> /dev/null; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function teardown_rook() {
|
||||
kubectl delete -f "${ROOK_URL}/pool-test.yaml"
|
||||
kubectl delete -f "${ROOK_URL}/filesystem-test.yaml"
|
||||
kubectl delete -f "${ROOK_URL}/toolbox.yaml"
|
||||
kubectl delete -f "${ROOK_URL}/cluster-test.yaml"
|
||||
kubectl delete -f "${ROOK_URL}/operator.yaml"
|
||||
kubectl delete -f "${ROOK_URL}/common.yaml"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
deploy)
|
||||
deploy_rook
|
||||
;;
|
||||
teardown)
|
||||
teardown_rook
|
||||
;;
|
||||
*)
|
||||
echo " $0 [command]
|
||||
Available Commands:
|
||||
deploy Deploy a rook
|
||||
teardown Teardown a rook
|
||||
" >&2
|
||||
;;
|
||||
esac
|
Reference in New Issue
Block a user