mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 10:37:10 +00:00
Merge pull request #9082 from fidencio/topic/cleanup-kata-deploy-leftovers-before-start-a-test
tests: Remove kata-deploy-tdx test and ensure kata-deploy is always cleaned up before starting the tests
This commit is contained in:
commit
28488f0790
36
.github/workflows/run-kata-coco-tests.yaml
vendored
36
.github/workflows/run-kata-coco-tests.yaml
vendored
@ -23,42 +23,6 @@ on:
|
|||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-kata-deploy-tests-on-tdx:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
vmm:
|
|
||||||
- qemu-tdx
|
|
||||||
snapshotter:
|
|
||||||
- nydus
|
|
||||||
pull-type:
|
|
||||||
- guest-pull
|
|
||||||
runs-on: tdx
|
|
||||||
env:
|
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
|
||||||
DOCKER_REPO: ${{ inputs.repo }}
|
|
||||||
DOCKER_TAG: ${{ inputs.tag }}
|
|
||||||
PR_NUMBER: ${{ inputs.pr-number }}
|
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
|
||||||
KUBERNETES: "k3s"
|
|
||||||
USING_NFD: "true"
|
|
||||||
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
|
||||||
PULL_TYPE: ${{ matrix.pull-type }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.commit-hash }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Rebase atop of the latest target branch
|
|
||||||
run: |
|
|
||||||
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
|
||||||
env:
|
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: bash tests/functional/kata-deploy/gha-run.sh run-tests
|
|
||||||
|
|
||||||
run-k8s-tests-on-tdx:
|
run-k8s-tests-on-tdx:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -110,6 +110,8 @@ function deploy_kata() {
|
|||||||
[ "$platform" = "kcli" ] && \
|
[ "$platform" = "kcli" ] && \
|
||||||
export KUBECONFIG="$HOME/.kcli/clusters/${CLUSTER_NAME:-kata-k8s}/auth/kubeconfig"
|
export KUBECONFIG="$HOME/.kcli/clusters/${CLUSTER_NAME:-kata-k8s}/auth/kubeconfig"
|
||||||
|
|
||||||
|
cleanup_kata_deploy || true
|
||||||
|
|
||||||
set_default_cluster_namespace
|
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"
|
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
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup_kata_deploy() {
|
||||||
platform="${1}"
|
|
||||||
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"
|
|
||||||
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
|
if [ "${KUBERNETES}" = "k3s" ]; then
|
||||||
deploy_spec="-k "${tools_dir}/packaging/kata-deploy/kata-deploy/overlays/k3s""
|
deploy_spec="-k "${tools_dir}/packaging/kata-deploy/kata-deploy/overlays/k3s""
|
||||||
cleanup_spec="-k "${tools_dir}/packaging/kata-deploy/kata-cleanup/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"
|
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() {
|
function deploy_snapshotter() {
|
||||||
echo "::group::Deploying ${SNAPSHOTTER}"
|
echo "::group::Deploying ${SNAPSHOTTER}"
|
||||||
case ${SNAPSHOTTER} in
|
case ${SNAPSHOTTER} in
|
||||||
|
Loading…
Reference in New Issue
Block a user