From dc4460cdec0d3678ee5ae5f189de31845a17d6ba Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 1 Oct 2024 11:39:20 -0700 Subject: [PATCH] test: add github-action-helper toolbox functions Added these functions for running commands in the toolbox pod: - toolbox() - ceph() - rbd() - radosgw-admin() Signed-off-by: Joshua Hoblitt (cherry picked from commit cb1dd152ad09ab62a684658ebbfa04bc42900b4b) --- tests/scripts/github-action-helper.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 277a6f5f5..d9bd5f550 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -738,6 +738,22 @@ function install_minikube_with_none_driver() { minikube start --kubernetes-version="$1" --driver=none --memory 6g --cpus=2 --addons ingress --cni=calico } +function toolbox() { + kubectl -n rook-ceph exec -it "$(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}')" -- "$@" +} + +function ceph() { + toolbox ceph "$@" +} + +function rbd() { + toolbox rbd "$@" +} + +function radosgw-admin() { + toolbox radosgw-admin "$@" +} + FUNCTION="$1" shift # remove function arg now that we've recorded it # call the function with the remainder of the user-provided args