Commit Graph

16721 Commits

Author SHA1 Message Date
Fabiano Fidêncio
544c58b7cf tests: k3s: Install without traefik / metrics-server
And let's hope the images not pulled are enough to avoid disk pressure
on the GitHub Runner node.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-09-13 21:09:52 +02:00
Fabiano Fidêncio
202ed00518 tests: k8s: kata-deploy: Remove unnecessary dirs to free up space
This is following Steve's suggestion, based on what's been done on
cloud-api-adaptor.

The reason we're doing it here is because we've seen pods being evicted
due to disk pressure.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-09-13 19:45:36 +02:00
Fabiano Fidêncio
4cb999ce93 kata-deploy: nit: Fix test name
Just add a "is" there as it was missing.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-09-13 19:45:36 +02:00
Fabiano Fidêncio
1d5124e8bc kata-deploy: Don't fail if the runtimeclass is already deleted
I've hit this when using a machine with slow internet connection, which
took ages to download the kata-cleanup image, and then helm timed out in
the middle of the cleanup, leading to the cleanup job being restarted
and then bailing with an error as the runtimeclasses that kata-deploy
tries to delete were already deleted.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-09-13 19:45:36 +02:00
Dan Mihai
34925ae740 Merge pull request #11795 from microsoft/danmihai1/snp-annotations
runtime: snp: enable CoCo annotations
2025-09-12 14:23:54 -07:00
Dan Mihai
60beb5236d runtime: snp: enable CoCo annotations
Use @DEFENABLEANNOTATIONS_COCO@ in configuration-qemu-snp.toml,
for consistency with the tdx and coco-dev configuration files.

k8s-initdata.bats was failing during CI on SNP without this change,
because the cc_init_data annotation was disabled.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-09-12 15:38:33 +00:00
RuoqingHe
a011d2132f Merge pull request #11775 from RuoqingHe/fix-test_execute_hook
libs: Fix unit tests under non-root user
2025-09-12 08:03:05 +08:00
Aurélien Bombo
760b465bb0 Merge pull request #11788 from kata-containers/sprt/zizmor-branch
ci: Run Zizmor on pushes to any branch
2025-09-11 11:52:06 -05:00
Aurélien Bombo
11655ef029 ci: Run Zizmor on pushes to any branch
This runs Zizmor on pushes to any branch, not just main.

This is useful for:

 1. Testing changes in feature branches with the manually-triggered CI.
 2. Forked repos that may use a different name than "main" for their
    default branch.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-09-11 09:33:25 -05:00
Ruoqing He
f6e93c2094 libs: Fix test_get_uds_with_sid_with_zero
Test case for `get_uds_with_sid` with an empty run directory would not
hit the 0 match arm, i.e. "sandbox with the provided prefix {short_id:?}
is not found", because `get_uds_with_sid` will try to create the
directory with provided short id before detecting `target_id`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-09-11 02:04:54 +00:00
Ruoqing He
b10e5a2250 libs: Fix test_get_uds_with_sid_ok
Preset directory `kata98654sandboxpath1` will produce more than one
`target_id` in `get_uds_with_sid`, which causes test to fail. Remove
that directory to make this test work.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-09-11 02:04:54 +00:00
Ruoqing He
efeba0b8ed libs: Detect guest protection before testing
`test_arch_guest_protection_*` test cases get triggered simultaneously,
which is impossible for a single machine to pass. Modify tests to detect
protection file before preceding.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-09-11 02:04:54 +00:00
Ruoqing He
a9ba18d48c libs: Fix test_execute_hook test
Case 4 of `test_execute_hook` would fail because `args` could not be
empty, while by providing `build_oci_hook` with `vec![]` would result in
empty args at execution stage.

Modify `build_oci_hook` to set args as `None` when empty vector is
provided.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-09-11 02:04:54 +00:00
Dan Mihai
5d59341f7f Merge pull request #11780 from ryansavino/snp-guest-kernel-upgrade-issue
packaging: add required modules for confidential guest kernel
2025-09-10 18:21:26 -07:00
Steve Horsman
58259aa5f4 Merge pull request #11754 from stevenhorsman/go.mod-1.24.6-bump
versions: Tidy up go.mod versions
2025-09-10 14:11:33 +01:00
Hyounggyu Choi
1737777d28 Merge pull request #11743 from BbolroC/enable-ci-qemu-se-runtime-rs
runtime-rs: Enable s390x nightly test for IBM SEL
2025-09-10 15:00:16 +02:00
Alex Lyn
1d26d07110 Merge pull request #11781 from lifupan/fupan_main_qemu
runtime-rs: log out the qemu console when debug enabled
2025-09-10 16:59:30 +08:00
Hyounggyu Choi
1060a94b08 GHA: Add s390x nightly test for runtime-rs on IBM SEL
A new internal nightly test has been established for runtime-rs.
This commit adds a new entry `cc-se-e2e-tests-rs` to the existing
matrix and renames the existing entry `cc-se-e2e-tests` to
`cc-se-e2e-tests-go`.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-09-10 10:57:40 +02:00
Hyounggyu Choi
37764d18d4 tests: Skip k8s tests for qemu-se-runtime-rs
Tests skipped because tests for `qemu-se` are skipped:
- k8s-empty-dirs.bats
- k8s-inotify.bats
- k8s-shared-volume.bats

Tests skipped because tests for `qemu-runtime-rs` are skipped:

- k8s-block-volume.bats
- k8s-cpu-ns.bats
- k8s-number-cpus.bats

Let's skip the tests above to run the nightly test
for runtime-rs on IBM SEL.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-09-10 10:57:40 +02:00
Steve Horsman
e502fa2feb Merge pull request #11731 from kata-containers/dependabot/go_modules/src/tools/csi-kata-directvolume/github.com/ulikunitz/xz-0.5.14
build(deps): bump github.com/ulikunitz/xz from 0.5.11 to 0.5.14 in /src/tools/csi-kata-directvolume
2025-09-10 09:47:28 +01:00
Steve Horsman
3f25b88f89 Merge pull request #11737 from kata-containers/dependabot/cargo/src/runtime-rs/tracing-subscriber-0.3.20
build(deps): bump tracing-subscriber from 0.3.17 to 0.3.20 in /src/runtime-rs
2025-09-10 09:47:07 +01:00
Steve Horsman
22bc29cb4a Merge pull request #11746 from stevenhorsman/bump-tests-go-mod-yaml-3.0.1
versions: Bump gopkg.in/yaml.v3
2025-09-10 09:46:18 +01:00
RuoqingHe
106c6cea59 Merge pull request #11774 from RuoqingHe/2025-09-09-disable-make-test-libs-temporarily
ci: gatekeeper: Mark `make test libs` not required
2025-09-10 14:52:33 +08:00
Fupan Li
16be168062 runtime-rs: log out the qemu console when debug enabled
When hypervisor's debug enabled, log out the qemu's console
messages for kernel boot debugging.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-09-10 14:19:15 +08:00
Fupan Li
5715408d61 runtime-rs: add the console device to kernel boot for qemu
Add the console device to kernel boot, thus we can log
out the kernel's boot message for debug.

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2025-09-10 14:10:45 +08:00
Ruoqing He
6a2d813196 ci: gatekeeper: Mark make test libs not required
There are still some issues to be address before we can mark `make test`
for `libs` as required. Mark this case as not required temporarily.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-09-10 03:52:20 +00:00
Ryan Savino
85779a6f1a packaging: add required modules for confidential guest kernel
SNP launch was failing after the confidential guest kernel was upgraded to 6.16.1.
Added required module CONFIG_MTRR enabled.
Added required module CONFIG_X86_PAT enabled.

Fixes: #11779

Signed-off-by: Ryan Savino <ryan.savino@amd.com>
2025-09-09 21:58:15 -05:00
Xuewei Niu
c1ee0985ed Merge pull request #11770 from stevenhorsman/agent-ctl-bump-hypervisor
agent-ctl: version: bump hypervisor
2025-09-09 11:59:25 +08:00
Aurélien Bombo
ceab55a871 Merge pull request #11772 from kata-containers/sprt/zizmor-hash
ci: security: Fix "commit hash does not point to a Git tag"
2025-09-08 13:56:25 -05:00
Aurélien Bombo
b640fe5a6a Merge pull request #11756 from kata-containers/sprt/curl-logging
ci: cri-containerd-amd64: add logging for curl failures
2025-09-08 11:55:29 -05:00
Aurélien Bombo
c0030c271c ci: security: Fix "commit hash does not point to a Git tag"
This fixes all such issues, ie.:

https://github.com/kata-containers/kata-containers/security/code-scanning/459
https://github.com/kata-containers/kata-containers/security/code-scanning/508
https://github.com/kata-containers/kata-containers/security/code-scanning/510

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-09-08 11:17:54 -05:00
Aurélien Bombo
cbcc7af6f3 Merge pull request #11615 from kata-containers/sprt/zizmor-pedantic
security: gha: Run Zizmor in auditor mode
2025-09-08 10:28:19 -05:00
stevenhorsman
87356269d8 versions: Tidy up go.mod versions
Update go 1.23 references to go 1.24.6 to match
versions.yaml

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-09-08 14:03:47 +01:00
stevenhorsman
2d28f3d267 agent-ctl: version: bump hypervisor
Bump the version of runtime-rs' hypervisor crate
to upgrade (indirectly) protobug and remediate vulnerability
RUSTSEC-2024-0437

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-09-08 13:23:03 +01:00
dependabot[bot]
5ae34ab240 build(deps): bump github.com/ulikunitz/xz
Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.11 to 0.5.14.
- [Commits](https://github.com/ulikunitz/xz/compare/v0.5.11...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 11:30:49 +01:00
Alex Lyn
4644a02871 Merge pull request #11752 from Apokleos/fix-hooks-devcgrp
runtime-rs: Remove default value of Linux.Resources.Devices and correctly set Hooks in OCI Spec to meet with Agent Policy requirements
2025-09-07 18:01:02 +08:00
stevenhorsman
66dc24566f versions: Bump gopkg.in/yaml.v3
Bump gopkg.in/yaml.v3 from 3.0.0 to 3.0.1 to remediate
CVE-2022-28948

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-09-05 16:36:48 +01:00
Aurélien Bombo
c480737ebd ci: cri-containerd-amd64: add logging for curl failures
This is to investigate #11755.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-09-05 10:35:45 -05:00
Aurélien Bombo
efbc69a2ec Merge pull request #11760 from kata-containers/sprt/oidc-fix
ci: aks: Refresh OIDC token in case access token expired
2025-09-05 10:29:35 -05:00
Dan Mihai
1f68f15995 Merge pull request #11759 from microsoft/danmihai1/policy-storages
genpolicy: print Input and Policy storages
2025-09-04 15:07:45 -07:00
Aurélien Bombo
f39517a18a ci: aks: Refresh OIDC token in case access token expired
It's possible that tests take a long time to run and hence that the access
token expires before we delete the cluster. In this case `az cli` will try
to refresh the access token using the OIDC token (which will have
definitely also expired because its lifetime is ~5 minutes).

To address this we refresh the OIDC token manually instead. Automatic
refresh isn't supported per Azure/azure-cli#28708.

Fixes: #11758

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-09-04 12:44:02 -05:00
Dan Mihai
9b0b7fc795 genpolicy: print Input and Policy storages
Print the Storage data structures, to help with debugging.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2025-09-04 16:03:03 +00:00
Cameron Baird
bdd98ec623 ci: Add test case for iptables, exercised via istio init container
Introduce new test case in k8s-iptables.bats which verifies that
workloads can configure iptables in the UVM.

Users discovered that they weren't able to do this for common usecases
such as istio. Proper support for this should be built into UVM
kernels. This test ensures that current and future kernel
configurations don't regress this functionality.

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-09-04 07:18:45 +02:00
Cameron Baird
d16026f7b9 kernel: add required configs for ip6tables support
Currently, the UVM kernel fails for istio deployments (at least with the
version we tested, 1.27.0). This is because the istio sidecar container
uses ip6tables and the required kernel configs are not built-in:

```
iptables binary ip6tables has no loaded kernel support and cannot be used, err: exit status 3 out: ip6tables v1.8.10 (legacy):
can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
```

Signed-off-by: Cameron Baird <cameronbaird@microsoft.com>
2025-09-04 07:18:45 +02:00
Aurélien Bombo
1dcc67c241 security: gha: Use Zizomor's auditor mode
This is the strictest possible setting for Zizmor.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2025-09-03 12:30:09 -05:00
Hyounggyu Choi
49ca96561b Merge pull request #11750 from BbolroC/use-pattern-working-for-both-runtimes
tests: Use "Failed" consistently for both runtimes
2025-09-03 13:06:05 +02:00
Alex Lyn
e235fc1efb runtime-rs: Remove default value of Linux.Resources.Devices in OCI Spec
In certain scenarios, particularly under CoCo/Agent Policy enforcement,
the default initial value of `Linux.Resources.Devices` is considered
non-compliant, leading to container creation failures. To address this
issue and ensure consistency with the behavior in `runtime-go`, this
commit removes the default value of `Linux.Resources.Devices` from the
OCI Spec.

This cleanup ensures that the OCI Spec aligns with runtime expectations
and prevents policy violations during container creation.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-09-03 18:42:34 +08:00
Alex Lyn
203f7090a6 runtime-rs: Ensure the setting of hooks when OCI Hooks is existing.
Only the StartContainer hook needs to be reserved for execution in the
guest, but we also make sure that the setting happens only when the OCI
Hooks does exist, otherwise we do nothing.

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2025-09-03 17:38:40 +08:00
Hyounggyu Choi
6d6202bbe3 tests: Use "Failed" consistently for both runtimes
In k8s-guest-pull-image.bats, `failed to pull image` is
not caught by assert_logs_contain() for runtime-rs.
To ensure consistency, this commit changes `failed` to
`Failed`, which works for both runtimes.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-09-03 09:09:13 +02:00
Hyounggyu Choi
150c90e32a Merge pull request #11728 from BbolroC/fix-sealed-secret-volume
runtime-rs: Adjust path for sealed secret mount check
2025-09-02 16:57:33 +02:00