Skip to content

feat(config): allow overriding the config path via URUNC_CONFIG_FILE - #989

Open
Anand-240 wants to merge 1 commit into
urunc-dev:mainfrom
Anand-240:feat/configurable-config-path
Open

feat(config): allow overriding the config path via URUNC_CONFIG_FILE#989
Anand-240 wants to merge 1 commit into
urunc-dev:mainfrom
Anand-240:feat/configurable-config-path

Conversation

@Anand-240

@Anand-240 Anand-240 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

The config path was hardcoded to /etc/urunc/config.toml, which does not work on immutable or read-only hosts like Talos where /etc is not writable. This adds a URUNC_CONFIG_PATH env var to set the path, falling back to /etc/urunc/config.toml when it is unset. Per #987 this is the temporary env var approach, before config handling moves to the shim.

Related issues

How was this tested?

Added unit tests for the resolver (env set and unset) and ran golangci-lint locally with no issues.

LLM usage

The design, the discussion on #979 and #987, and the review were mine. Claude Opus 4.8 helped write the implementation, tests and docs.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for urunc ready!

Name Link
🔨 Latest commit d57b36c
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a8f464c94faae00084a7466
😎 Deploy Preview https://deploy-preview-989--urunc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cmainas

cmainas commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Hello @Anand-240 ,

testing through unit tests that the same PR adds is not enough. This should be tested end-to-end. Also, the LLM usage refers to the model used and not in the agent. The data generation (what we care) comes from the LLM.

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @Anand-240 ,

The code as code is good, the comments and documentation are not. I have added comments. When you are done you can make one of your open PRs drafts and mark this read for review.

Comment thread docs/configuration.md Outdated
Comment thread pkg/unikontainers/urunc_config.go Outdated
@Anand-240
Anand-240 force-pushed the feat/configurable-config-path branch from 81890c5 to d309136 Compare August 24, 2026 13:46
@Anand-240

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review @cmainas. Pushed the changes. I trimmed the ResolveUruncConfigPath comment so it ends at "otherwise", and cleaned up the docs line, dropped the second person and the Talos bit and kept one sentence with an example. Also fixed the LLM usage in the description to point to the model (Claude Opus 4.8) and not the agent.

For the end to end testing, the e2e harness only sets guest env vars right now, not the runtime or shim env, so there isn't a clean way to pass URUNC_CONFIG_PATH into the shim from the test cases yet. Want me to extend the harness so a case can set the runtime env, or would you rather validate it another way?

@Anand-240
Anand-240 marked this pull request as ready for review August 24, 2026 14:00

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @Anand-240 ,

thank you for the updates. We should rename the environment variable to URUNC_CONFIG_FILE, since it is a file and not any path. Also, we should add a example.

Comment thread docs/configuration.md
@Anand-240 Anand-240 changed the title feat(config): allow overriding the config path via URUNC_CONFIG_PATH feat(config): allow overriding the config path via URUNC_CONFIG_FILE Aug 26, 2026
@Anand-240
Anand-240 force-pushed the feat/configurable-config-path branch from d309136 to 37da8f6 Compare August 26, 2026 12:32
@Anand-240

Copy link
Copy Markdown
Contributor Author

Thanks @cmainas. Renamed the env var to URUNC_CONFIG_FILE everywhere (code, tests and docs) and updated the title. Also added the docs example with the wrapper script approach. Let me know if you'd prefer it closer to your snippet.

The config path was hardcoded to /etc/urunc/config.toml, which breaks on
immutable or read-only hosts like Talos where /etc is not writable. Add
ResolveUruncConfigPath, which reads the URUNC_CONFIG_FILE env var and
falls back to /etc/urunc/config.toml when it is unset, and use it at the
three places that load the config. Setting the var in the shim is enough
since the urunc process it spawns inherits the environment.

Fixes: urunc-dev#987
Signed-off-by: Anand-240 <anandprakashsrivastava68@gmail.com>
@Anand-240
Anand-240 force-pushed the feat/configurable-config-path branch from 37da8f6 to d57b36c Compare August 26, 2026 20:02
@Anand-240

Copy link
Copy Markdown
Contributor Author

@cmainas I pushed a fix for the spell check, it was flagging "subtests" in a test comment so I reworded it.

For the e2e failures, I had a look at the logs and they seem to fail during setup with "cannot verify s3.nbfc.io's certificate" (wget exit code 5) while pulling the test assets, before any container actually runs. Build and unit tests are green, and the change is a no-op when URUNC_CONFIG_FILE is unset since it resolves to the same /etc/urunc/config.toml as before, so I don't think it's coming from this PR, but please let me know if I'm reading it wrong.

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.

Allow uses to define the path for the urunc configuraton

2 participants