Skip to content

Fix installRoot config path in ConfigurationLoader load() docstring.#1897

Open
anxkhn wants to merge 1 commit into
apple:mainfrom
anxkhn:docs/configurationloader-installroot-path
Open

Fix installRoot config path in ConfigurationLoader load() docstring.#1897
anxkhn wants to merge 1 commit into
apple:mainfrom
anxkhn:docs/configurationloader-installroot-path

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 5, 2026

Copy link
Copy Markdown

Type of Change

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

Motivation and Context

The load() docstring in Sources/ContainerPersistence/ConfigurationLoader.swift
described the default system config layer as
<installRoot>/etc/container/config/config.toml, but the code produces
<installRoot>/etc/container/config.toml.

The path builder configurationFile(in:of:) only inserts the config directory
for the .appRoot case; the .installRoot case appends etc/container and the
config filename directly:

case .appRoot: base.appending(configDirectory).appending(configFilename)   // <base>/config/config.toml
case .installRoot: base.appending("etc/container").appending(configFilename) // <base>/etc/container/config.toml

The extra /config/ segment was also self-contradictory: the sibling
configurationFile(in:of:) docstring in the same file already documents
.installRoot as <base>/etc/container/config.toml (with the example
/usr/local/etc/container/config.toml).

This drops the spurious /config/ segment so the load() docstring matches both
the code and the sibling docstring. The <appRoot>/config/config.toml half of the
same line is correct and is left unchanged.

Testing

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

Docstring-only change, so no unit test applies. Verified with:

  • swift format lint --strict on the file: clean.
  • swift build --target ContainerPersistence: builds.

Diff (+1/-1):

     /// Providers are consulted in the order given — values from earlier files override
     /// later ones. The default order is user config (`<appRoot>/config/config.toml`)
-    /// > system config (`<installRoot>/etc/container/config/config.toml`).
+    /// > system config (`<installRoot>/etc/container/config.toml`).

The load() docstring described the default system config layer as
<installRoot>/etc/container/config/config.toml, but the path builder
returns <installRoot>/etc/container/config.toml: the .installRoot case in
configurationFile(in:of:) appends only "etc/container" and the config
filename, without the "config" directory that .appRoot uses. The spurious
segment also contradicted the sibling configurationFile(in:of:) docstring,
which already documents .installRoot as <base>/etc/container/config.toml.
Drop the extra /config/ segment so the docstring matches the code.
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