ci: k8s: add cleanup-kcli() to gha-run.sh

The cleanup-kcli() behaves like other clean up for bare-metal (e.g. sev,
tdx...etc) except that KUBECONFIG should be exported.

Fixes #7620
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta 2023-08-09 16:38:58 -03:00
parent cbb9aa15b6
commit d2be8eef1a

View File

@ -166,6 +166,9 @@ function cleanup() {
test_type="${2:-k8s}" test_type="${2:-k8s}"
ensure_yq ensure_yq
[ "$platform" = "kcli" ] && \
export KUBECONFIG="$HOME/.kcli/clusters/${CLUSTER_NAME:-kata-k8s}/auth/kubeconfig"
echo "Gather information about the nodes and pods before cleaning up the node" echo "Gather information about the nodes and pods before cleaning up the node"
get_nodes_and_pods_info get_nodes_and_pods_info
@ -231,6 +234,7 @@ function main() {
deploy-kata-tdx) deploy_kata "tdx" ;; deploy-kata-tdx) deploy_kata "tdx" ;;
deploy-kata-garm) deploy_kata "garm" ;; deploy-kata-garm) deploy_kata "garm" ;;
run-tests) run_tests ;; run-tests) run_tests ;;
cleanup-kcli) cleanup "kcli" ;;
cleanup-sev) cleanup "sev" ;; cleanup-sev) cleanup "sev" ;;
cleanup-snp) cleanup "snp" ;; cleanup-snp) cleanup "snp" ;;
cleanup-tdx) cleanup "tdx" ;; cleanup-tdx) cleanup "tdx" ;;