mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 09:26:52 +00:00 
			
		
		
		
	tests: k8s: Call ensure_yq() in setup.sh
It wasn't the `common.bash` import in `run_kubernetes_tests.sh` causing the yq error so let's try this instead. Reference: https://github.com/kata-containers/kata-containers/actions/runs/5674941359/job/15379797568#step:10:341 Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
This commit is contained in:
		| @@ -338,6 +338,7 @@ function ensure_yq() { | |||||||
|     export GOPATH |     export GOPATH | ||||||
|     export PATH="${GOPATH}/bin:${PATH}" |     export PATH="${GOPATH}/bin:${PATH}" | ||||||
|     INSTALL_IN_GOPATH=true "${repo_root_dir}/ci/install_yq.sh" |     INSTALL_IN_GOPATH=true "${repo_root_dir}/ci/install_yq.sh" | ||||||
|  |     hash -d yq # yq is preinstalled on GHA Ubuntu 22.04 runners so we clear Bash's PATH cache. | ||||||
| } | } | ||||||
|  |  | ||||||
| # dependency: What we want to get the version from the versions.yaml file | # dependency: What we want to get the version from the versions.yaml file | ||||||
|   | |||||||
| @@ -18,18 +18,20 @@ reset_workloads_work_dir() { | |||||||
| 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" | ||||||
|         find ${kubernetes_dir}/runtimeclass_workloads_work/*.yaml -exec yq write -i {} 'metadata.annotations[io.katacontainers.config.hypervisor.kernel]' "${mariner_kernel_path}" \; |         # Not using find -exec as that still returns 0 on failure. | ||||||
|  |         find ${kubernetes_dir}/runtimeclass_workloads_work/*.yaml -print0 | xargs -0 -I% yq write -i % 'metadata.annotations[io.katacontainers.config.hypervisor.kernel]' "${mariner_kernel_path}" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| set_initrd_path() { | set_initrd_path() { | ||||||
|     if [[ "${KATA_HOST_OS}" = "cbl-mariner" ]]; then |     if [[ "${KATA_HOST_OS}" = "cbl-mariner" ]]; then | ||||||
|         initrd_path="/opt/kata/share/kata-containers/kata-containers-initrd-mariner.img" |         initrd_path="/opt/kata/share/kata-containers/kata-containers-initrd-mariner.img" | ||||||
|         find ${kubernetes_dir}/runtimeclass_workloads_work/*.yaml -exec yq write -i {} 'metadata.annotations[io.katacontainers.config.hypervisor.initrd]' "${initrd_path}" \; |         find ${kubernetes_dir}/runtimeclass_workloads_work/*.yaml -print0 | xargs -0 -I% yq write -i % 'metadata.annotations[io.katacontainers.config.hypervisor.initrd]' "${initrd_path}" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  |  | ||||||
| main() { | main() { | ||||||
|  |     ensure_yq | ||||||
|     reset_workloads_work_dir |     reset_workloads_work_dir | ||||||
|     set_kernel_path |     set_kernel_path | ||||||
|     set_initrd_path |     set_initrd_path | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user