Skip to content

Remove the app-root config snapshot when the user config is deleted - #2517

Open
resker wants to merge 1 commit into
apple:mainfrom
resker:config-stale-copy
Open

resker wants to merge 1 commit into
apple:mainfrom
resker:config-stale-copy

Conversation

@resker

@resker resker commented Nov 13, 2026

Copy link
Copy Markdown

Fixes #2516

Type of Change

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

Motivation and Context

Deleting ~/.config/container/config.toml had no effect, because system start kept loading the copy it made earlier.

If the user config is gone, the copy is now removed too, so the defaults apply. Nothing is lost: the copy is only ever written from the user config, on each start. unlink(2) matches the existing rename(2) handling and doesn't follow a symlink.

Testing

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

Added two tests: the stale copy is removed, and a symlink at the destination is removed without touching its target. swift test --filter ConfigurationLoaderTests passes. I also ran the issue's steps against this branch: after deleting the config and restarting, the snapshot is gone and container system property ls no longer shows the domain.

`copyConfigurationToReadOnly` returned early when the user's config.toml
was missing, so a snapshot copied by an earlier `container system start`
kept applying after the user deleted their config. Unlink the snapshot
in that case; a missing snapshot is not an error.

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.

[Bug]: Deleting ~/.config/container/config.toml has no effect; the old snapshot keeps applying

1 participant