refactor(linstor): follow blockstor's API group to blockstor.org

blockstor moves its API group from blockstor.cozystack.io to
blockstor.org before anything is deployed on it. The chart's CRD
copies, the RBAC rules of the apiserver, controller and satellite, the
chart tests and the e2e helpers that read the storage pools now use
the new group.

This needs the blockstor release that carries the rename, which the
backend is pinned to before this PR merges.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil committed 2026-11-29 13:45:11 +01:00
1 parent cf7bd11eeb
commit d617d52bfd
18 files changed
+55 -55

No files matched your search

+3 -3
View File
@@ -518,7 +518,7 @@ _cozy_pool_free_rows() {
if [ "$_backend" = blockstor ]; then
# Read first and filter second: piped, the read's status is jq's, and jq
# on empty input succeeds.
_pools_json=$(kubectl get storagepools.blockstor.cozystack.io --request-timeout=20s -o json) || return 1
_pools_json=$(kubectl get storagepools.blockstor.org --request-timeout=20s -o json) || return 1
printf '%s\n' "$_pools_json" |
jq -r '.items[] | select((.spec.providerKind | test("^ZFS")) and .status.freeCapacity != null) | "\(.status.freeCapacity):\(.spec.nodeName)"'
return
@@ -533,7 +533,7 @@ _cozy_pool_free_rows() {
_cozy_pool_diagnostics() {
if [ "$(_cozy_storage_backend 2>/dev/null)" = blockstor ]; then
kubectl get storagepools.blockstor.cozystack.io -o wide --request-timeout=20s 2>&1
kubectl get storagepools.blockstor.org -o wide --request-timeout=20s 2>&1
return
fi
kubectl -n cozy-linstor exec deploy/linstor-controller -- linstor --no-color sp l 2>&1
@@ -633,7 +633,7 @@ _cozy_linstor_pool_baseline_file() {
_cozy_linstor_pool_datasets() {
_backend=$(_cozy_storage_backend) || return 1
if [ "$_backend" = blockstor ]; then
_pools_json=$(timeout -k 5 30 kubectl get storagepools.blockstor.cozystack.io --request-timeout=20s -o json 2>/dev/null) || return 1
_pools_json=$(timeout -k 5 30 kubectl get storagepools.blockstor.org --request-timeout=20s -o json 2>/dev/null) || return 1
_pools=$(printf '%s\n' "$_pools_json" |
jq -r '.items[] | select(.spec.providerKind | test("^ZFS")) | "\(.spec.nodeName) \(.spec.props["StorDriver/StorPoolName"] // .spec.props["StorDriver/ZPoolThin"] // .spec.props["StorDriver/ZPool"] // "")"') || return 1
_satellite_selector=app=blockstor-satellite
+4 -4
View File
@@ -164,7 +164,7 @@ count_lines() {
render_blockstor_node() {
cat <<EOF
apiVersion: blockstor.cozystack.io/v1alpha1
apiVersion: blockstor.org/v1alpha1
kind: Node
metadata:
name: $1
@@ -178,7 +178,7 @@ EOF
# The CRD's CEL rule pins metadata.name to <poolName>.<nodeName>.
render_blockstor_storage_pool() {
cat <<EOF
apiVersion: blockstor.cozystack.io/v1alpha1
apiVersion: blockstor.org/v1alpha1
kind: StoragePool
metadata:
name: data.$1
@@ -547,14 +547,14 @@ echo "[post-install-prep] waiting for every satellite to report its 'data' pool"
pool_deadline=$(( $(date +%s) + 300 ))
while :; do
pools_rc=0
reported=$(timeout -k 5 30 kubectl get storagepools.blockstor.cozystack.io --request-timeout=20s \
reported=$(timeout -k 5 30 kubectl get storagepools.blockstor.org --request-timeout=20s \
-o jsonpath='{range .items[?(@.spec.poolName=="data")]}{.spec.nodeName} {.status.freeCapacity}{"\n"}{end}') || pools_rc=$?
if [ "$pools_rc" -eq 0 ] && [ "$(printf '%s\n' "$reported" | awk 'NF == 2' | grep -c .)" -eq "$node_count" ]; then
break
fi
if [ "$(date +%s)" -ge "$pool_deadline" ]; then
echo "[post-install-prep] timed out after 300s waiting for $node_count reported 'data' pools (read exited $pools_rc): $reported" >&2
timeout -k 5 30 kubectl get storagepools.blockstor.cozystack.io -o yaml --request-timeout=20s 2>&1 | tail -n 80 >&2
timeout -k 5 30 kubectl get storagepools.blockstor.org -o yaml --request-timeout=20s 2>&1 | tail -n 80 >&2
exit 1
fi
sleep 5
+4 -4
View File
@@ -727,7 +727,7 @@ blockstor_storage_pools_json() {
kubectl() {
printf '%s\n' "$*" >>"$calls"
case "$*" in
'get storagepools.blockstor.cozystack.io '*-o\ json*) blockstor_storage_pools_json ;;
'get storagepools.blockstor.org '*-o\ json*) blockstor_storage_pools_json ;;
*) return 1 ;;
esac
}
@@ -755,7 +755,7 @@ blockstor_storage_pools_json() {
COZY_STORAGE_BACKEND=blockstor
kubectl() {
case "$*" in
'get storagepools.blockstor.cozystack.io '*-o\ json*) blockstor_storage_pools_json 87127923 ;;
'get storagepools.blockstor.org '*-o\ json*) blockstor_storage_pools_json 87127923 ;;
*) printf 'STUB-POOL-TABLE\n' ;;
esac
}
@@ -782,7 +782,7 @@ blockstor_storage_pools_json() {
COZY_STORAGE_BACKEND=blockstor
kubectl() {
case "$*" in
'get storagepools.blockstor.cozystack.io '*-o\ json*)
'get storagepools.blockstor.org '*-o\ json*)
echo 'Error from server (Forbidden): storagepools is forbidden' >&2
return 1 ;;
esac
@@ -814,7 +814,7 @@ blockstor_storage_pools_json() {
kubectl() {
printf '%s\n' "$*" >>"$calls"
case "$*" in
'get storagepools.blockstor.cozystack.io '*) blockstor_storage_pools_json ;;
'get storagepools.blockstor.org '*) blockstor_storage_pools_json ;;
*'-l app=blockstor-satellite'*)
printf 'srv1 blockstor-satellite-a\nsrv2 blockstor-satellite-b\nsrv3 blockstor-satellite-c\n' ;;
*'--container=satellite -- zfs list'*) printf 'data\n' ;;
+2 -2
View File
@@ -147,7 +147,7 @@ case "$*" in
exit 1
fi
for n in ${STUB_NODES:-srv1 srv2 srv3}; do echo "$n"; done ;;
'get storagepools.blockstor.cozystack.io '*freeCapacity*)
'get storagepools.blockstor.org '*freeCapacity*)
# STUB_POOLS_UNREPORTED names nodes whose satellite has not reported its
# pool yet: the object exists, its free capacity does not.
for n in ${STUB_NODES:-srv1 srv2 srv3}; do
@@ -688,7 +688,7 @@ run_prep_blockstor() {
[ "$(cat "$tmp/rc")" -eq 0 ]
grep -q "waiting for every satellite to report its 'data' pool" "$tmp/out"
grep -q '^get storagepools.blockstor.cozystack.io .*freeCapacity' "$tmp/calls"
grep -q '^get storagepools.blockstor.org .*freeCapacity' "$tmp/calls"
rm -rf "$tmp"
}