Skip to content

fix: generate valid TOML in storage.conf - #272

Draft
tolusha wants to merge 2 commits into
mainfrom
fix-storage-conf-toml-v2
Draft

tolusha wants to merge 2 commits into
mainfrom
fix-storage-conf-toml-v2

Conversation

@tolusha

@tolusha tolusha commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

podman info (and any podman use) fails in DevWorkspaces built from these images:

Error: configure storage: failed to mount overlay for metacopy check with "nodev" options: permission denied

Two independent causes:

  1. Corrupt storage.conf (invalid TOML) — the build-time sed in base/ubi10/Dockerfile / base/ubi9/Dockerfile appended a bare "/var/lib/shared", line after the commented # additionalimagestores = [] entry, producing invalid TOML. Podman >= 5 logs Failed to obtain podman configuration: decode configuration ... toml, silently falls back to default settings (overlay driver), and fails inside the workspace where unprivileged overlay mounts are denied.

  2. User storage.conf ignored by podman >= 5 — entrypoint.sh correctly writes ~/.config/containers/storage.conf (driver = "vfs" when /dev/fuse is unavailable), but podman 5.8.2 and 6.1.4 do not pick that file up on their own: on a clean state it auto-detects the overlay driver and fails, regardless of the user config.

🤖 Generated with Claude Code

The sed that adjusted /usr/share/containers/storage.conf appended a bare
"/var/lib/shared", line after the commented additionalimagestores entry,
producing invalid TOML. Podman >= 5 warns "Failed to obtain podman
configuration" and silently falls back to default settings (overlay
driver), which fails inside DevWorkspaces without /dev/fuse or
unprivileged overlay mounts ("failed to mount overlay for metacopy
check: permission denied").

Replace the append with a proper substitution that uncomments and sets
additionalimagestores = ["/var/lib/shared"].

Verified in a DevWorkspace against the ubi10 image: with a valid vfs
user storage.conf, podman info succeeds.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci

openshift-ci Bot commented Dec 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The UBI 9 and UBI 10 Dockerfiles now set additionalimagestores to an explicit array containing /var/lib/shared, replacing the previous append operation.

Changes: Storage configuration

Layer / File(s) Summary
Set the additional image store
base/ubi9/Dockerfile, base/ubi10/Dockerfile
Both Dockerfiles replace the previous append operation with an explicit additionalimagestores array containing /var/lib/shared. The UBI 9 edit also continues to uncomment mount_program.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • devfile/developer-images#271: It changes the same UBI Dockerfile lines to set additionalimagestores to an array containing /var/lib/shared.

Suggested reviewers: akurinnoy

Merge Risk: Minimal · up to 63348

The change fixes invalid storage configuration generation in the UBI 9 and UBI 10 images. No concrete merge-blocking risk was established; the one residual unknown is whether UBI 9 ships the commented form, and the PR's reported failure suggests it does.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix: generate valid TOML in storage.conf" matches the main change. The raw summary and objectives show both UBI 9 and UBI 10 Dockerfiles now set additionalimagestores to ["/var/lib/shared"]…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix: generate valid TOML in storage.conf" matches the main change. The raw summary and objectives show both UBI 9 and UBI 10 Dockerfiles now set additionalimagestores to ["/var/lib/shared"] instead of appending a bare quoted path after the commented entry. That append produced invalid TOML in storage.conf. The title states the fix and the affected file, and it is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 649c8f67-c7a6-464b-9f3b-7eb8969be301
Commits

Reviewing files that changed from the base of the PR and between 026c2d7 and 6334880.

Files selected for processing: 2

  • base/ubi10/Dockerfile
  • base/ubi9/Dockerfile

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@tolusha
tolusha marked this pull request as draft December 4, 2026 12:02
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Pull Request UBI 10 images published ✨

Base: quay.io/devfile/base-developer-image:ubi10-pr-272
UDI: quay.io/devfile/universal-developer-image:ubi10-pr-272

podman >= 5 does not pick up ~/.config/containers/storage.conf on its
own (verified with podman 5.8.2 and 6.1.4): on a clean state it
auto-detects the overlay driver and fails inside DevWorkspaces
("failed to mount overlay for metacopy check: permission denied"),
even though entrypoint.sh has written a valid vfs storage.conf.

Setting CONTAINERS_STORAGE_CONF makes podman read the file the
entrypoint generates (vfs, or overlay with fuse-overlayfs when
/dev/fuse is available), so `podman info` works out of the box in
freshly created workspaces.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Pull Request images published ✨

Base: quay.io/devfile/base-developer-image:pr-272
UDI: quay.io/devfile/universal-developer-image:pr-272

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Pull Request UBI 10 images published ✨

Base: quay.io/devfile/base-developer-image:ubi10-pr-272
UDI: quay.io/devfile/universal-developer-image:ubi10-pr-272

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Pull Request images published ✨

Base: quay.io/devfile/base-developer-image:pr-272
UDI: quay.io/devfile/universal-developer-image:pr-272

@tolusha

tolusha commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Follow-up needed before merge: podman build regression

This PR fixes podman info, but testing in a DevWorkspace revealed that images rebuilt with current UBI10 packages now ship buildah 1.45.2, which includes the build-context overlay introduced in buildah v1.44 — podman-container-tools/buildah#6892. The old ubi10-latest image (buildah 1.43.1) is not affected, so merging this without a mitigation would trade a working podman build for a working podman info.

Failure in the workspace (with vfs storage working correctly):

Error: mounting an overlay over build context directory: creating overlay scaffolding for
build context directory: mount overlay:/var/tmp/buildah-context-.../merge, data:
lowerdir=/projects,upperdir=/var/tmp/buildah-context-.../upper,...,userxattr: invalid argument

buildah ≥1.44 mounts an overlay over the build context and puts the scaffolding in $TMPDIR (default /var/tmp). Inside a container, /var/tmp sits on the container's overlay rootfs, which the kernel rejects as an overlay upperdir.

Verified workaround (from the upstream issue) — set in containers.conf:

[engine]
image_copy_tmp_dir = "/dev/shm"

/dev/shm is tmpfs, which accepts overlay mounts. Tested in the workspace: podman build and buildah build both succeed with this setting and no TMPDIR env. This is preferred over ENV TMPDIR=/dev/shm because it only affects podman/buildah instead of every process.

Proposed change: write this into /etc/containers/containers.conf in the Dockerfiles (or have entrypoint.sh write it to ~/.config/containers/containers.conf alongside the storage.conf it already creates).

Related upstream: fix PR buildah#7180 (make context overlay best-effort) is still open.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant