Skip to content

ostree-ext: document symlinking pull secret to /run with transient /etc - #2601

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
yeetypete:feat/var-lib-auth-json
Nov 4, 2026
Merged

cgwalters merged 1 commit into
bootc-dev:mainfrom
yeetypete:feat/var-lib-auth-json

Conversation

@yeetypete

@yeetypete yeetypete commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

With a transient /etc, there is no persistent location for the pull secret since /etc/ostree/auth.json is reset on every reboot and /run is ephemeral. You could provide a secret in /usr/lib but then you would have to distribute it in the image which can be undesirable.

Add documentation for a tmpfiles.d-declared symlink from /var/lib/ostree/ to /run. In general the long-term fix is to use systemd creadentials (see #2601 (comment)).

Also add a small cleanup to ostree-container-auth(5), which listed /etc before /run, which is slightly off from the actual search order.

Assisted-by: AI

Copilot AI balanced review requested due to automatic review settings October 29, 2026 23:45
@github-actions github-actions Bot added area/install Issues related to `bootc install` area/ostree Issues related to ostree area/documentation Updates to the documentation labels Oct 29, 2026
@bootc-bot
bootc-bot Bot requested a review from henrywang October 29, 2026 23:46
@yeetypete
yeetypete force-pushed the feat/var-lib-auth-json branch from 27eb712 to 8ab8b70 Compare October 29, 2026 23:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the persistent authentication lookup change.

No open issues 🎉

What changed in this PR

Adds /var/lib/ostree/auth.json as a persistent pull-secret location for systems with transient /etc, extending bootc’s existing registry authentication lookup.

Changes:

  • Searches root authentication files in /run, /etc, /var/lib, then /usr/lib.
  • Extends unit tests to verify the new location’s precedence and fallback behavior.
  • Updates authentication documentation and clarifies the installer’s auth-propagation comment.
File Description
docs/​src/​building/​bootc-secrets.7.md Documents lookup order and persistent secrets with transient /etc.
crates/​ostree-ext/​src/​globals.rs Adds /var/lib/ostree lookup and tests its precedence.
crates/​ostree-ext/​man/​ostree-container-auth.md Corrects and extends the documented root lookup order.
crates/​lib/​src/​install/​completion.rs Clarifies the auth-propagation comment; no behavior change.

Review effort: Balanced

@yeetypete yeetypete changed the title ostree-ext: Read the pull secret from /var/lib/ostree/auth.json ostree-ext: Read pull secret from /var/lib/ostree/auth.json Oct 30, 2026
@cgwalters

cgwalters commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

I get the pain point. However, I think the best fix here is actually for us to support reading the pull secrets from systemd credentials. See containers/image#2600 which is related.

Then the pull secret cred could be pulled from the general stateful credstore in /var or other places.

A general thing here though for us to make use of credentials we do need a systemd unit, which would be a big change.

In the short term here's my suggestion for this case: ship a tmpfiles.d entry which symlinks from /run/ostree/auth.json to /var/lib/containers-auth.json or whatever you want.

(Edit:)

Technically you can work around this with a tmpfiles.d-declared symlink from /var/lib/ostree/ to /run but having bootc be aware of this override location is a bit cleaner.

Right sorry you came up with the same idea!

Let's document this?

I'm not hard opposed to this PR, but moving to draft for now for discussion.

@cgwalters
cgwalters marked this pull request as draft October 30, 2026 18:02
@yeetypete

Copy link
Copy Markdown
Contributor Author

Let's document this?

Yep as long as its an official workaround thats fine with me. I'd also prefer systemd credentials long term anyways. I'll make the change.

Document linking /run/ostree/auth.json to a pull secret in /var with
a tmpfiles.d entry. Also fix the search order in
ostree-container-auth(5), which listed /etc before /run.

Assisted-by: AI
Signed-off-by: Peter Siegel <psiegel2000@icloud.com>
@yeetypete
yeetypete force-pushed the feat/var-lib-auth-json branch from 8ab8b70 to f8097a4 Compare October 30, 2026 20:30
@yeetypete yeetypete changed the title ostree-ext: Read pull secret from /var/lib/ostree/auth.json ostree-ext: document symlinking pull secret to /run Oct 30, 2026
@yeetypete yeetypete changed the title ostree-ext: document symlinking pull secret to /run ostree-ext: document symlinking pull secret to /run with transient /etc Oct 30, 2026
@cgwalters
cgwalters marked this pull request as ready for review November 4, 2026 13:25
@cgwalters
cgwalters merged commit fb973f3 into bootc-dev:main Nov 4, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation area/install Issues related to `bootc install` area/ostree Issues related to ostree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants