mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 23:17:42 +00:00
ci: Clean up kata-deploy ds before starting the tests
This will ensure no leftovers are in the node, which has been cause the TDX CI to fail every now and then. Fixes: #9081 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
8fe7349d3e
commit
3877a9f49a
@ -110,6 +110,8 @@ function deploy_kata() {
|
||||
[ "$platform" = "kcli" ] && \
|
||||
export KUBECONFIG="$HOME/.kcli/clusters/${CLUSTER_NAME:-kata-k8s}/auth/kubeconfig"
|
||||
|
||||
cleanup_kata_deploy || true
|
||||
|
||||
set_default_cluster_namespace
|
||||
|
||||
sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${DOCKER_REGISTRY}/${DOCKER_REPO}:${DOCKER_TAG}|g" "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml"
|
||||
@ -188,25 +190,9 @@ function run_tests() {
|
||||
popd
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
platform="${1}"
|
||||
test_type="${2:-k8s}"
|
||||
function cleanup_kata_deploy() {
|
||||
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"
|
||||
get_nodes_and_pods_info
|
||||
|
||||
if [ "${platform}" = "aks" ]; then
|
||||
delete_cluster ${test_type}
|
||||
return
|
||||
fi
|
||||
|
||||
# Switch back to the default namespace and delete the tests one
|
||||
delete_test_cluster_namespace
|
||||
|
||||
if [ "${KUBERNETES}" = "k3s" ]; then
|
||||
deploy_spec="-k "${tools_dir}/packaging/kata-deploy/kata-deploy/overlays/k3s""
|
||||
cleanup_spec="-k "${tools_dir}/packaging/kata-deploy/kata-cleanup/overlays/k3s""
|
||||
@ -240,6 +226,28 @@ function cleanup() {
|
||||
kubectl delete -f "${tools_dir}/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml"
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
platform="${1}"
|
||||
test_type="${2:-k8s}"
|
||||
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"
|
||||
get_nodes_and_pods_info
|
||||
|
||||
if [ "${platform}" = "aks" ]; then
|
||||
delete_cluster ${test_type}
|
||||
return
|
||||
fi
|
||||
|
||||
# Switch back to the default namespace and delete the tests one
|
||||
delete_test_cluster_namespace
|
||||
|
||||
cleanup_kata_deploy
|
||||
}
|
||||
|
||||
function deploy_snapshotter() {
|
||||
echo "::group::Deploying ${SNAPSHOTTER}"
|
||||
case ${SNAPSHOTTER} in
|
||||
|
Loading…
Reference in New Issue
Block a user