mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
k8s: tests: Take advantage of SHIMS
and DEFAULT_SHIM
env vars
We don't have to do any sed to replace the runtimeclass being used by the moment we start taking advantage of the `DEFAULT_SHIM` environment variable exposed merged in the previous commits. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
311671abb5
commit
1e8fe131bd
@ -72,8 +72,14 @@ function deploy_kata() {
|
|||||||
|
|
||||||
# Enable debug for Kata Containers
|
# Enable debug for Kata Containers
|
||||||
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[1].value' --tag '!!str' "true"
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[1].value' --tag '!!str' "true"
|
||||||
|
# Create the runtime class only for the shim that's being tested
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[2].value' "${KATA_HYPERVISOR}"
|
||||||
|
# Set the tested hypervisor as the default `kata` shim
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[3].value' "${KATA_HYPERVISOR}"
|
||||||
# Let the `kata-deploy` script take care of the runtime class creation / removal
|
# Let the `kata-deploy` script take care of the runtime class creation / removal
|
||||||
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[4].value' --tag '!!str' "true"
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[4].value' --tag '!!str' "true"
|
||||||
|
# Let the `kata-deploy` create the default `kata` runtime class
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[5].value' --tag '!!str' "true"
|
||||||
|
|
||||||
if [ "${KATA_HOST_OS}" = "cbl-mariner" ]; then
|
if [ "${KATA_HOST_OS}" = "cbl-mariner" ]; then
|
||||||
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[+].name' "HOST_OS"
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[+].name' "HOST_OS"
|
||||||
@ -154,6 +160,12 @@ function cleanup() {
|
|||||||
|
|
||||||
# Let the `kata-deploy` script take care of the runtime class creation / removal
|
# Let the `kata-deploy` script take care of the runtime class creation / removal
|
||||||
yq write -i "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml" 'spec.template.spec.containers[0].env[4].value' --tag '!!str' "true"
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml" 'spec.template.spec.containers[0].env[4].value' --tag '!!str' "true"
|
||||||
|
# Create the runtime class only for the shim that's being tested
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml" 'spec.template.spec.containers[0].env[2].value' "${KATA_HYPERVISOR}"
|
||||||
|
# Set the tested hypervisor as the default `kata` shim
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml" 'spec.template.spec.containers[0].env[3].value' "${KATA_HYPERVISOR}"
|
||||||
|
# Let the `kata-deploy` create the default `kata` runtime class
|
||||||
|
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[5].value' --tag '!!str' "true"
|
||||||
|
|
||||||
sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${DOCKER_REGISTRY}/${DOCKER_REPO}:${DOCKER_TAG}|g" "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.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-cleanup/base/kata-cleanup.yaml"
|
||||||
cat "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml"
|
cat "${tools_dir}/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml"
|
||||||
|
@ -15,10 +15,6 @@ reset_workloads_work_dir() {
|
|||||||
cp -R ${kubernetes_dir}/runtimeclass_workloads ${kubernetes_dir}/runtimeclass_workloads_work
|
cp -R ${kubernetes_dir}/runtimeclass_workloads ${kubernetes_dir}/runtimeclass_workloads_work
|
||||||
}
|
}
|
||||||
|
|
||||||
set_runtime_class() {
|
|
||||||
sed -i -e "s|runtimeClassName: kata|runtimeClassName: kata-${KATA_HYPERVISOR}|" ${kubernetes_dir}/runtimeclass_workloads_work/*.yaml
|
|
||||||
}
|
|
||||||
|
|
||||||
set_kernel_path() {
|
set_kernel_path() {
|
||||||
if [[ "${KATA_HOST_OS}" = "cbl-mariner" ]]; then
|
if [[ "${KATA_HOST_OS}" = "cbl-mariner" ]]; then
|
||||||
mariner_kernel_path="/usr/share/cloud-hypervisor/vmlinux.bin"
|
mariner_kernel_path="/usr/share/cloud-hypervisor/vmlinux.bin"
|
||||||
@ -35,7 +31,6 @@ set_initrd_path() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
reset_workloads_work_dir
|
reset_workloads_work_dir
|
||||||
set_runtime_class
|
|
||||||
set_kernel_path
|
set_kernel_path
|
||||||
set_initrd_path
|
set_initrd_path
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user