]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
cephadm-e2e: wrap kcli commands in libvirt group 2562/head
authorNizamudeen A <nia@redhat.com>
Thu, 2 Apr 2026 10:44:22 +0000 (16:14 +0530)
committerNizamudeen A <nia@redhat.com>
Sun, 12 Apr 2026 04:54:35 +0000 (10:24 +0530)
as per: https://github.com/ceph/ceph-build/pull/2458#discussion_r3009905844

Signed-off-by: Nizamudeen A <nia@redhat.com>
ceph-dashboard-cephadm-e2e/build/cleanup
scripts/dashboard/install-cephadm-e2e-deps.sh

index 8bb6c0fc3277feec6323cefe47dc59c5b1be25aa..b3e7285a7a145c1b513c35fd02d38877a5e7979b 100755 (executable)
@@ -1,9 +1,14 @@
 #!/usr/bin/env bash
 set +x
 echo "Starting cleanup..."
-kcli delete plan -y ceph || true
-kcli delete network ceph-dashboard -y
-kcli delete pool ceph-dashboard -y
+
+with_libvirt() {
+    sg libvirt -c "$1"
+}
+
+with_libvirt "kcli delete plan -y ceph || true"
+with_libvirt "kcli delete network ceph-dashboard -y || true"
+with_libvirt "kcli delete pool ceph-dashboard -y || true"
 sudo rm -rf ${HOME}/.kcli
 podman container prune -f
 echo "Cleanup completed."
index 81158d5808c8650de4e3a141695302b49cb7a710..454eff046e932bed5acfd6e6f06768c9aa15ecff 100644 (file)
@@ -69,7 +69,12 @@ sudo chmod +x /usr/local/bin/kcli
 
 # KCLI cleanup function can be found here: https://github.com/ceph/ceph/blob/main/src/pybind/mgr/dashboard/ci/cephadm/start-cluster.sh
 sudo mkdir -p /var/lib/libvirt/images/ceph-dashboard
-kcli delete plan ceph -y || true
-kcli delete network ceph-dashboard -y || true
-kcli create pool -p /var/lib/libvirt/images/ceph-dashboard ceph-dashboard
-kcli create network -c 192.168.100.0/24 ceph-dashboard
+
+with_libvirt() {
+    sg libvirt -c "$1"
+}
+
+with_libvirt "kcli delete plan ceph -y || true"
+with_libvirt "kcli delete network ceph-dashboard -y || true"
+with_libvirt "kcli create pool -p /var/lib/libvirt/images/ceph-dashboard ceph-dashboard"
+with_libvirt "kcli create network -c 192.168.100.0/24 ceph-dashboard"