mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
ci: create default subvolumegroup
Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
parent
5df2a23f43
commit
cbc8210600
@ -5,6 +5,7 @@ ROOK_DEPLOY_TIMEOUT=${ROOK_DEPLOY_TIMEOUT:-300}
|
|||||||
ROOK_URL="https://raw.githubusercontent.com/rook/rook/${ROOK_VERSION}/deploy/examples"
|
ROOK_URL="https://raw.githubusercontent.com/rook/rook/${ROOK_VERSION}/deploy/examples"
|
||||||
ROOK_BLOCK_POOL_NAME=${ROOK_BLOCK_POOL_NAME:-"newrbdpool"}
|
ROOK_BLOCK_POOL_NAME=${ROOK_BLOCK_POOL_NAME:-"newrbdpool"}
|
||||||
ROOK_BLOCK_EC_POOL_NAME=${ROOK_BLOCK_EC_POOL_NAME:-"ec-pool"}
|
ROOK_BLOCK_EC_POOL_NAME=${ROOK_BLOCK_EC_POOL_NAME:-"ec-pool"}
|
||||||
|
ROOK_SUBVOLUMEGROUP_NAME=${ROOK_SUBVOLUMEGROUP_NAME:-"csi"}
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
@ -53,12 +54,15 @@ function deploy_rook() {
|
|||||||
cat "${TEMP_DIR}"/cluster-test.yaml
|
cat "${TEMP_DIR}"/cluster-test.yaml
|
||||||
kubectl_retry create -f "${TEMP_DIR}/cluster-test.yaml"
|
kubectl_retry create -f "${TEMP_DIR}/cluster-test.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "${TEMP_DIR}"
|
rm -rf "${TEMP_DIR}"
|
||||||
|
|
||||||
kubectl_retry create -f "${ROOK_URL}/toolbox.yaml"
|
kubectl_retry create -f "${ROOK_URL}/toolbox.yaml"
|
||||||
kubectl_retry create -f "${ROOK_URL}/filesystem-test.yaml"
|
kubectl_retry create -f "${ROOK_URL}/filesystem-test.yaml"
|
||||||
kubectl_retry create -f "${ROOK_URL}/pool-test.yaml"
|
kubectl_retry create -f "${ROOK_URL}/pool-test.yaml"
|
||||||
|
|
||||||
|
create_or_delete_subvolumegroup "create"
|
||||||
|
|
||||||
# Check if CephCluster is empty
|
# Check if CephCluster is empty
|
||||||
if ! kubectl_retry -n rook-ceph get cephclusters -oyaml | grep 'items: \[\]' &>/dev/null; then
|
if ! kubectl_retry -n rook-ceph get cephclusters -oyaml | grep 'items: \[\]' &>/dev/null; then
|
||||||
check_ceph_cluster_health
|
check_ceph_cluster_health
|
||||||
@ -79,6 +83,7 @@ function deploy_rook() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function teardown_rook() {
|
function teardown_rook() {
|
||||||
|
create_or_delete_subvolumegroup "delete"
|
||||||
kubectl delete -f "${ROOK_URL}/pool-test.yaml"
|
kubectl delete -f "${ROOK_URL}/pool-test.yaml"
|
||||||
kubectl delete -f "${ROOK_URL}/filesystem-test.yaml"
|
kubectl delete -f "${ROOK_URL}/filesystem-test.yaml"
|
||||||
kubectl delete -f "${ROOK_URL}/toolbox.yaml"
|
kubectl delete -f "${ROOK_URL}/toolbox.yaml"
|
||||||
@ -88,6 +93,21 @@ function teardown_rook() {
|
|||||||
kubectl delete -f "${ROOK_URL}/crds.yaml"
|
kubectl delete -f "${ROOK_URL}/crds.yaml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO: to be removed once issue is closed - https://github.com/rook/rook/issues/13040
|
||||||
|
function create_or_delete_subvolumegroup() {
|
||||||
|
local action="$1"
|
||||||
|
curl -o "subvolumegroup.yaml" "${ROOK_URL}/subvolumegroup.yaml"
|
||||||
|
sed -i "s|name:.*|name: $ROOK_SUBVOLUMEGROUP_NAME|g" subvolumegroup.yaml
|
||||||
|
|
||||||
|
if [ "$action" == "create" ]; then
|
||||||
|
kubectl_retry create -f subvolumegroup.yaml
|
||||||
|
else
|
||||||
|
kubectl delete -f subvolumegroup.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f "subvolumegroup.yaml"
|
||||||
|
}
|
||||||
|
|
||||||
function create_block_pool() {
|
function create_block_pool() {
|
||||||
curl -o newpool.yaml "${ROOK_URL}/pool-test.yaml"
|
curl -o newpool.yaml "${ROOK_URL}/pool-test.yaml"
|
||||||
sed -i "s/replicapool/$ROOK_BLOCK_POOL_NAME/g" newpool.yaml
|
sed -i "s/replicapool/$ROOK_BLOCK_POOL_NAME/g" newpool.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user