Skip to content

feat(podman): allow user-provided pod template to override embedded one#567

Merged
feloy merged 1 commit into
openkaiden:mainfrom
feloy:oneclipod-config
Jul 3, 2026
Merged

feat(podman): allow user-provided pod template to override embedded one#567
feloy merged 1 commit into
openkaiden:mainfrom
feloy:oneclipod-config

Conversation

@feloy

@feloy feloy commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The pod YAML template was compiled into the binary and had no override mechanism. Now, if the user places a custom template at /runtimes/podman/config/onecli-pod.yaml, it is used in place of the embedded default. The embedded template is still used when the file is absent.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@feloy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ab3dd30-a3e0-445b-ac91-419dd58d2c1e

📥 Commits

Reviewing files that changed from the base of the PR and between b0f5fbe and 5c2eb7a.

📒 Files selected for processing (4)
  • pkg/runtime/podman/create.go
  • pkg/runtime/podman/create_test.go
  • pkg/runtime/podman/podman.go
  • pkg/runtime/podman/podman_test.go
📝 Walkthrough

Walkthrough

The podman runtime's pod YAML rendering is refactored to support an optional custom template file at <storageDir>/config/onecli-pod.yaml, falling back to the embedded default template. Callers and tests are updated to pass template content explicitly, and a new test validates the loading behavior.

Changes

Custom pod template loading

Layer / File(s) Summary
Template loading and rendering refactor
pkg/runtime/podman/create.go, pkg/runtime/podman/podman.go
Adds loadPodYAMLTemplate() to read a custom template with fallback to the embedded default, changes renderPodYAML to accept template content as a parameter, updates writePodYAMLFile to use the loaded template, switches Create to call the instance method, and updates the related comment in writePodFiles.
Test updates for template argument and loader coverage
pkg/runtime/podman/create_test.go, pkg/runtime/podman/podman_test.go
Updates existing renderPodYAML test calls to explicitly pass pods.OnecliPodYAML, and adds TestLoadPodYAMLTemplate validating default and custom template file behaviors.

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

Sequence Diagram(s)

sequenceDiagram
  participant ComponentA
  participant ComponentB
  ComponentA->>ComponentB: observable interaction
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: letting a user-provided pod template override the embedded default.
Description check ✅ Passed The description matches the implemented Podman template override behavior and fallback to the embedded default.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
pkg/runtime/podman/create.go (1)

372-372: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting the template path segments into a shared constant.

"config" and "onecli-pod.yaml" are hardcoded here and duplicated again in podman_test.go (Line 389-394). A shared constant would keep the path in sync across code and tests.

Also applies to: 808-809

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/runtime/podman/create.go` at line 372, The podman template path segments
are hardcoded and duplicated in both create and test code, so extract the shared
`"config"` and `"onecli-pod.yaml"` parts into a reusable constant or helper near
`customPath` in `create.go` and update `podman_test.go` to use the same symbol.
Use the existing `customPath` construction and the podman test path setup as the
places to centralize the path so both stay in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pkg/runtime/podman/create.go`:
- Line 372: The podman template path segments are hardcoded and duplicated in
both create and test code, so extract the shared `"config"` and
`"onecli-pod.yaml"` parts into a reusable constant or helper near `customPath`
in `create.go` and update `podman_test.go` to use the same symbol. Use the
existing `customPath` construction and the podman test path setup as the places
to centralize the path so both stay in sync.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f154ccd-5032-45b9-9d24-11bbe6142bc3

📥 Commits

Reviewing files that changed from the base of the PR and between 7fb2187 and b0f5fbe.

📒 Files selected for processing (4)
  • pkg/runtime/podman/create.go
  • pkg/runtime/podman/create_test.go
  • pkg/runtime/podman/podman.go
  • pkg/runtime/podman/podman_test.go

@feloy feloy requested a review from jeffmaury July 3, 2026 11:35
The pod YAML template was compiled into the binary and had no override
mechanism. Now, if the user places a custom template at
<storageDir>/runtimes/podman/config/onecli-pod.yaml, it is used in
place of the embedded default. The embedded template is still used when
the file is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@feloy feloy force-pushed the oneclipod-config branch from b0f5fbe to 5c2eb7a Compare July 3, 2026 11:46
@feloy feloy merged commit f0ef5ed into openkaiden:main Jul 3, 2026
8 checks passed
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.

2 participants