286 Commits
Author SHA1 Message Date
Agam DuaandGitHub d6de569420 Update default kernel to Kata Containers 3.32.0 debug build (#2143)
- Switch the default guest kernel from vmlinux-6.18.15-186
  (kata-static-3.28.0) to the newer version and variant
  vmlinux-6.18.35-197-debug (kata-static-3.32.0).
- The debug variant enables eBPF, kprobes, uprobes, ftrace
  and BTF (kata-containers/kata-containers#12567).

Signed-off-by: Agam Dua <agam_dua@apple.com>
2026-08-20 15:41:02 -07:00
RajandGitHub 04324afe63 Add identifier validation tests for the disk-usage routes (#2136) 2026-08-20 10:31:01 -07:00
Kathryn BaldaufandGitHub 44374a237b Do not set default maskedPaths and readonlyPaths for container machines (#2137)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-08-19 09:44:25 -07:00
b3357fdb2e Split K8sHelper, add WorkerProvisioner protocol, and add LinuxWorker … (#2110)
- Closes #2102.
- LinuxWorkerProvisioner sets up a kind-based node.
- Includes some test cleanups.

Co-authored-by: John Logan <john_logan@apple.com>
2026-08-18 13:12:06 -07:00
J LoganandGitHub d2213f49e6 Integration test: fix k8s test with scoped domain. (#2104) 2026-08-12 09:39:13 -07:00
J LoganandGitHub 497465635a Remove auto registry scheme. (#2100) 2026-08-10 09:55:53 -07:00
f13b7238d5 Refactor tmpfsMounts() to process tmpfs path correctly (#2103)
Co-authored-by: John Logan <john_logan@apple.com>
2026-08-10 09:49:58 -07:00
0190097d06 Migrate ProgressBarTests to Swift Testing (#2085)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-07 15:17:54 -07:00
J LoganandGitHub 0925ff6298 Refactor container k8s to use plugin resource management. (#2097) 2026-08-07 14:43:56 -07:00
jshi991andGitHub cec124f207 refactor: extract K8s logic into ContainerK8s library target (#2079)
- Closes #2078.
- Move all K8s sources from the container-k8s executable
  into a new ContainerK8s library target. Sources/Plugins/K8s/
  becomes a thin entry point (K8sMain.swift) that calls
  K8sCommand.main().
2026-08-07 10:08:16 -07:00
J LoganandGitHub abff4183b4 Integration test: fix username/uid flake. (#2086) 2026-08-06 20:31:13 -07:00
jshi991andGitHub 0d111be4c6 K8s plugin (#2044)
- closes #2043 
- introduces the k8s plugin, allowing users to make single
  node clusters with the kind base image 
- other functionality is included as well such as creation,
  deletion, and loading custom images
2026-08-05 19:25:27 -07:00
J LoganandGitHub 60612eef51 Integration test: cache warmup image tarfiles. (#2074)
- When pulling warmup images for concurrent tests, save
  the images to a cache directory under the application root.
- Serial tests that aren't testing pull can save time by restoring
  a cached warmup image.
2026-08-05 11:17:20 -07:00
Aditya RamaniandGitHub ddaf2ca5ac Add --read-only-path and --masked-path option to container run / create (#2069) 2026-08-04 19:04:50 -07:00
J LoganandGitHub cb8cad4562 Add readiness signal to DirectoryWatcher, fix DirectoryWatcherTest. (#2066) 2026-08-04 12:17:58 -07:00
J LoganandGitHub 520371cb38 Increase testExecDetachProcessRunning sleep margin to avoid CI flake (#2063) 2026-08-03 15:27:58 -07:00
jwhurandGitHub 4ed47cbe33 Move SSH builder test to Serialized tests (#2061) 2026-08-03 12:16:23 -07:00
Saehej KangandGitHub e87d3a030b [builder]: enable ssh forwarding for container build (#1508) 2026-08-03 08:34:48 -07:00
Saehej KangandGitHub da8bec6223 [container]: add container export for live containers (#1630)
- When container is not running, the runtime helper
  traverses the container's root fs and writes it to the
  specified tar archive or stdout.
- When the container is running, the helper performs
  the same operation but wraps it in freeze/thaw
  to ensure data integrity for the resulting archive.
2026-08-02 14:55:01 -07:00
48145ac7fb Fix image env vars, build context checks, TCP/UDP port forward buffer, and validate plugin name (#2027)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
Co-authored-by: John Logan <john_logan@apple.com>
Co-authored-by: Raj Aryan Singh <rajaryan_singh@apple.com>
2026-07-28 10:13:10 -07:00
divyanshandGitHub 13e976f88e fix: Increase XPC timeout for Machine API operations (#2006)
- Fixes #2003.
2026-07-27 13:49:18 -07:00
J LoganandGitHub d1d763530d Fix BuilderStart race, parallelize container build tests. (#2002)
- Closes #2001.
- Handle "container exists" error gracefully instead
  of failing, when trying to start the buildkit container.
- Move build tests to parallel suites, while the builder
  lifecycle tests remain serial. Parallel builds don't
  use the fixture lock that deletes and restarts the
  builder and runs a build block in isolation.
2026-07-23 15:50:59 -07:00
J LoganandGitHub 9af6e0e5e5 Integration test - miscellaneous fixture and test refinements. (#1993) 2026-07-22 17:19:14 -07:00
J LoganandGitHub f0b2b96a26 Use enum for warmup images. (#1990)
- Closes #1982.
- Makes warmup image code more readable in tests.
2026-07-22 09:45:33 -07:00
Kathryn BaldaufandGitHub a51d54b553 Container test fixture package (#1887)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-21 18:15:47 -07:00
J LoganandGitHub b130babb15 Use ordered journal mode for unpacked images. (#1974) 2026-07-21 17:12:01 -07:00
J LoganandGitHub 1e6f78255e Address flaky TestCLIKernelSetSerial suite. (#1976) 2026-07-21 10:40:49 -07:00
J LoganandGitHub e34b1b7fc8 Fix machine ID length test. (#1971) 2026-07-20 16:29:05 -07:00
Kathryn BaldaufandGitHub 3310f342e8 Do not follow destination symlink when copying user configuration (#1957)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-20 15:46:42 -07:00
Kathryn BaldaufandGitHub 9e1d6e8b6e Validate container ID from XPC requests (#1956)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-20 10:42:37 -07:00
0x4C33andGitHub 57b07fa2ac Verify kernel archive integrity (#1703)
Closes https://github.com/apple/container/issues/1687

The default kernel archive is downloaded from a remote release URL
during first-run setup and via `container system kernel set
--recommended`. Previously, the archive contents were not verified after
download, so integrity depended on HTTPS and the release artifact
remaining unchanged.

This change adds digest verification for kernel archives. The
recommended/default kernel now has pinned digest metadata using an
algorithm-prefixed value such as `sha256:<hex>`. `container system
kernel set --tar` accepts `--digest`; remote tar URLs require it, and
local tar archives can also be verified before unpacking and
installation.

The system config also supports `kernel.digest`, and a custom
`kernel.url` must provide a digest for that archive.
2026-07-13 13:04:39 -07:00
Noah ThorntonandGitHub edd6dee2db Integration coverage xpc helpers (#1551)
- This fixes the LLVM coverage data not properly being emitted for XPC
  services. It requires piping the `LLVM_PROFILE_FILE` environment
  variable through to all the services and plugins. The variable itself
  also required the "%c" formatter to ensure that it continuously emits
  coverage data, otherwise when XPC services are killed via "bootout" they
  do not emit coverage.
2026-07-06 15:43:30 -07:00
J LoganandGitHub 3ad6e9b8ba Removes obsolete CLITests directory. (#1886)
- Closes #1833.
2026-07-02 17:30:31 -07:00
J LoganandGitHub 76f387e3be Restore reverted migrations, migrate last tests. (#1880)
- Part of #1833.
- CLI progress and registry test migrations were inadventently reverted
by #1857.
- Migrate TestCLINoParallelCases to TestCLIImagePruneSerial and
TestCLINetworkPruneSerial.
- Clean up test selection patterns in Makefile.
- Remove all legacy CLITests files.
- Use swift-testing `withKnownIssue` to run but ignore failures on flaky
`testCreateNameLongestValid` and `testIsolatedNetwork`.
- Extracts a fixture helper for tests requiring a retry loop.
2026-07-02 15:34:46 -07:00
Kathryn BaldaufandGitHub d9fdf39af6 Add TestCLISystemLogs and TestCLITermIO integration tests in new integration test suite (#1879)
This PR adds two test suites that were missing from the new integration
test suite

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-01 20:18:31 -07:00
Kathryn BaldaufandGitHub 4a79060595 Ensure test filenames match test suite names and each file has a single suite defined (#1877)
This PR cleans up some of the new IntegrationTests files to ensure that
each file has a single test suite defined within it and the name of the
file matches the name of the test suite.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-07-01 16:03:03 -07:00
J LoganandGitHub 69a2505aeb Migrates container run integration tests. (#1857)
- Part of #1833.
2026-07-01 13:23:16 -07:00
J LoganandGitHub 9bd3c47345 Migrates container create, run-lifecycle, exec, remove, copy. (#1844)
- Part of #1833.
2026-06-30 17:37:51 -07:00
J LoganandGitHub 88ab3192f9 Migrate image, volume and miscellaneous system tests. (#1868)
- Part of #1833.
- Distributes fixture extensions for images and containers added as part
of previous builder PR to more sensible locations.
2026-06-30 15:25:16 -07:00
J LoganandGitHub 586fa07d2a Migrate registry tests to new test support types. (#1845)
- Part of #1833.
2026-06-30 10:40:26 -07:00
J LoganandGitHub d29e6edd5e Migrates network integration tests. (#1858)
- Part of #1833.
2026-06-30 10:00:34 -07:00
J LoganandGitHub 3842977f4a Migrate basic system tests to new test support types. (#1841)
- Part of #1833.
2026-06-29 16:40:06 -07:00
J LoganandGitHub c37c405bbd Migrates container machine tests. (#1856)
- Part of #1833.
2026-06-29 15:58:19 -07:00
J LoganandGitHub 6317a832d4 Adds build fixture and migrates build CLI tests. (#1848)
- Part of #1833.
- Also changes test directory names to include test ID so that they are
easily identifiable.
2026-06-29 12:12:31 -07:00
J LoganandGitHub be3b1f20c4 Migrate some container tests, remove concurrent demo tests. (#1840)
- Part of #1833.
- Tweaks `ContainerFixture.withContainer()` to support the legacy
`longRun()` pattern without boilerplate.
2026-06-26 14:17:18 -07:00
J LoganandGitHub 649164d9e2 Enhanced test fixtures for integration tests. (#1834)
- Part of #1833.
- Adds `ContainerFixture` with scoped resource lifecycle and cleanup in
place of implementation inheritance for test support functions. The
fixture also handles resource prefixing and uses a more ergonomic
`CommandResult` in place of a tuple for return values.
- `ImageWarmup` suite pre-pulls well-known images, and
`copyWarmupImage()` tags test-local refs, keeping the canonical image
store untouched.
- Three-phase `integration-new`: warmup, followed by concurrent tests
(managed by the swift test
`--experimental-maximum-parallelization-width` flag), followed by
serialized tests.
- `coverage-new` merges unit + integration-new profraw, replacing
`coverage` in CI as a migration progress indicator.
- Updates GH workflow so non-coverage invokes both the `integration` and
`integration-new` Makefile targets, while coverage runs invoke the
`coverage-new` target.
2026-06-26 12:00:44 -07:00
aa7fef3d1d Route container image save reference list to stderr in stdout mode (#1804)
- Fixes #1801.
- When `container image save` runs without `--output`,
  stdout carries the OCI tar archive. The command writes 
  the archive bytes to stdout and then `print(reference)`s
  each saved image reference to stdout afterward,
  appending non-archive text after the tar EOF marker,
  which will cause strict tar/OCI consumers to fail.
- This routes the saved-reference list to stderr in the
  no-`--output` branch, so stdout contains only archive
  bytes. When saving to a file via `--output`, stdout is
  free, so the references continue to print to stdout
  exactly as before.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:04:30 -07:00
Hugo, CY LAUandGitHub 0c95007763 perf(parser): add collection capacity hints to known-size loops (#1791)
- For result sets with known sizes, it's more efficient
  to supply the size as a capacity hint.
2026-06-25 19:42:37 -07:00
J LoganandGitHub 984c4c2c5a Disable flaky CLI test temporarily. (#1828)
- PRs are backed up. We need to rework the CLI tests
  to shorten test time and fix conflicts between tests.

## Testing
- [ ] Tested locally
- [x] Added/updated tests
- [ ] Added/updated docs
2026-06-25 08:42:01 -07:00
09489cba45 fix(cp): resolve relative host paths against current directory (#1741)
Fixes #1738

`container cp` fails when the host source path is relative (e.g.
`container cp file foo:/root/`), because `NSString.standardizingPath`
only canonicalizes paths but does not make them absolute. The unchanged
relative path is then interpreted as `/file` (root-absolute) by
`URL(fileURLWithPath:)` on the runtime side.

Fixed by resolving relative paths against the current working directory
before use, matching the pattern already used by `container export`,
`container image save`, and `container image load`.

The same fix was also applied to the copy-out destination path (line
68), which had the same issue.

## Type of Change

- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context

`container cp file foo:/root/` fails with `"copyIn: source not found
'/file'"` because the relative path `file` is never expanded to an
absolute path. Using `$PWD/file` works, but relative paths should work
too — every other command in the codebase handles this correctly.

## Testing

- [x] Tested locally — builds and all existing tests pass
- [ ] Added/updated tests
- [ ] Added/updated docs

---------

Co-authored-by: jwhur <57657645+JaewonHur@users.noreply.github.com>
2026-06-22 11:54:00 -07:00