tests: k8s: install genpolicy

Install the genpolicy app before starting test execution.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
Dan Mihai 2024-02-01 21:00:15 +00:00
parent 8aa8b70573
commit 05b2e4f606
2 changed files with 17 additions and 10 deletions

View File

@ -371,11 +371,10 @@ log_level = "debug"
EOF
}
function install_kata() {
local kata_tarball="kata-static.tar.xz"
declare -r katadir="/opt/kata"
function install_kata_common() {
declare -r katadir="$1"
declare -r destdir="/"
declare -r local_bin_dir="/usr/local/bin/"
declare -r kata_tarball="kata-static.tar.xz"
# Removing previous kata installation
sudo rm -rf "${katadir}"
@ -383,6 +382,18 @@ function install_kata() {
pushd "${kata_tarball_dir}"
sudo tar -xvf "${kata_tarball}" -C "${destdir}"
popd
}
function install_kata_tools() {
declare -r katadir="/opt/kata"
install_kata_common "${katadir}"
}
function install_kata() {
declare -r katadir="/opt/kata"
declare -r local_bin_dir="/usr/local/bin/"
install_kata_common "${katadir}"
# create symbolic links to kata components
for b in "${katadir}"/bin/* ; do

View File

@ -15,6 +15,7 @@ kubernetes_dir="$(dirname "$(readlink -f "$0")")"
source "${kubernetes_dir}/../../gha-run-k8s-common.sh"
# shellcheck disable=2154
tools_dir="${repo_root_dir}/tools"
kata_tarball_dir="${2:-kata-artifacts}"
DOCKER_REGISTRY=${DOCKER_REGISTRY:-quay.io}
DOCKER_REPO=${DOCKER_REPO:-kata-containers/kata-deploy-ci}
@ -233,11 +234,6 @@ function cleanup() {
kubectl delete -f "${tools_dir}/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml"
}
install_kata_tools_placeholder() {
echo "Kata tools will be installed (for the genpolicy app)"\
"after CI picks up the gha yaml changes required to test that installation."
}
function deploy_snapshotter() {
echo "::group::Deploying ${SNAPSHOTTER:-}"
#TODO Add the deployment logic for the snapshotter in PR https://github.com/kata-containers/kata-containers/pull/8585.
@ -265,7 +261,7 @@ function main() {
setup-crio) setup_crio ;;
deploy-k8s) deploy_k8s ;;
install-bats) install_bats ;;
install-kata-tools) install_kata_tools_placeholder ;;
install-kata-tools) install_kata_tools ;;
install-kubectl) install_kubectl ;;
get-cluster-credentials) get_cluster_credentials ;;
deploy-kata-aks) deploy_kata "aks" ;;