mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-16 22:39:01 +00:00
gha: kata-deploy: Do the runtime class cleanup as part of the cleanup
Instead of doing this as part of the test itself, let's ensure it's done before running the tests and during the tests cleanup. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
@@ -13,11 +13,34 @@ kata_deploy_dir="$(dirname "$(readlink -f "$0")")"
|
||||
source "${kata_deploy_dir}/../../gha-run-k8s-common.sh"
|
||||
|
||||
function run_tests() {
|
||||
cleanup_runtimeclasses || true
|
||||
|
||||
pushd "${kata_deploy_dir}"
|
||||
bash run-kata-deploy-tests.sh
|
||||
popd
|
||||
}
|
||||
|
||||
function cleanup_runtimeclasses() {
|
||||
# Cleanup any runtime class that was left behind in the cluster, in
|
||||
# case of a test failure, apart from the default one that comes from
|
||||
# AKS
|
||||
for rc in `kubectl get runtimeclass -o name | grep -v "kata-mshv-vm-isolation" | sed 's|runtimeclass.node.k8s.io/||'`
|
||||
do
|
||||
kubectl delete runtimeclass $rc;
|
||||
done
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
platform="${1}"
|
||||
test_type="${2:-k8s}"
|
||||
|
||||
cleanup_runtimeclasses || true
|
||||
|
||||
if [ "${platform}" = "aks" ]; then
|
||||
delete_cluster ${test_type}
|
||||
fi
|
||||
}
|
||||
|
||||
function main() {
|
||||
export KATA_HOST_OS="${KATA_HOST_OS:-}"
|
||||
|
||||
|
Reference in New Issue
Block a user