Skip to content

Allow machine set to clear a custom kernel - #2546

Open
vincent-peng wants to merge 1 commit into
apple:mainfrom
vincent-peng:fix-machine-kernel-reset
Open

vincent-peng wants to merge 1 commit into
apple:mainfrom
vincent-peng:fix-machine-kernel-reset

Conversation

@vincent-peng

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

The documented container machine set -n dev kernel= command fails because splitting the setting drops its empty value. Preserve empty components so the existing configuration update clears the custom kernel override.

Add CLI integration coverage for the reset, unchanged boot settings, kernel paths containing =, both duplicate-setting orders, and rejection of malformed or empty non-kernel settings.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Built all test products with swift build --build-tests --jobs 6 -Xswiftc -warnings-as-errors -Xswiftc -enable-testing.

With isolated services, the new reset test fails on unchanged main at kernel= and passes with this change. The focused CLI run passes all 8 tests, including 4 invalid-setting cases:

swift test --skip-build --filter 'TestCLIMachineRuntimeSerial/testSet(KernelReset|RejectsInvalidSettings|Cpus|Memory|Multiple|InvalidKey|HomeMount|HomeMountInvalid)' --experimental-maximum-parallelization-width 1

The 41 tests selected by MachineConfigTests|ConfigurationLoaderTests|HelpCommandTests also pass. Swift formatting checks pass. Tested on Apple Silicon, macOS 27.2.1, Swift 6.4.2. These machine tests use --no-boot; the full VM integration suite was not run locally.

@vincent-peng
vincent-peng marked this pull request as ready for review November 21, 2026 00:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant