Repository navigation
Conversation
urunc create now fails when urunc's configuration file can not be read or decoded. Only a missing file still means the default configuration. So the defaults never replace the fields of an existing file. ParseLogMetricsConfig still falls back to the defaults for the logs and the timestamps, and its warning now says so. LoadUruncConfig also checks the path fields: the path and socket_path of every monitor and the path of virtiofsd. urunc uses each configured path at the same place in the monitor rootfs, where a relative path has no meaning. Each path must also be clean. So a value with a trailing "/", like /opt/urunc/bin/qemu-system-x86_64/, fails when the configuration loads, not when urunc starts the monitor. LoadUruncConfig collects the errors of all the fields, so one error lists every invalid path. The check covers every monitor, even one no container uses. So a bad value fails every urunc create, also for the containers urunc hands to runc. A relative socket_path, which used to work, is now rejected too. urunc-deploy checks its path and socket_path overrides the same way, before the installation changes the host. A bad override then stops the installation, instead of breaking every create on the node. The configuration page and the k8s tutorial describe the new checks. Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com>
InitialSetup collected the resources of the monitor after preSetup, which changes the host. For a block rootfs, it copies the file mounts of the container into the rootfs and unmounts it. If collecting the resources then failed, e.g. on a host without /dev/kvm, create failed with the host already changed. Nothing restored it, since Delete has no state to work with before InitialSetup finishes. Collect them before preSetup. Only the block devices are still collected after it, since preSetup copies the file mounts of the container, which might be in a block volume, and getBlockDevs unmounts the block volumes. If finding their device nodes then fails, mount the volumes back. Signed-off-by: Charalampos Mainas <charalampos.mainas@gmail.com>
✅ Deploy Preview for urunc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cmainas
marked this pull request as ready for review
November 19, 2026 15:40
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
urunc createused to accept a broken configuration file. Whentoml.DecodeFilefailed,LoadUruncConfigreturned the default configuration andcreateignored the error. So a single syntax error silently replaced every field of the file, includingruntime.libcontainerand the monitor paths. A path field with a relative or invalid filepath, like/opt/urunc/bin/qemu-system-x86_64/, also passed, and failed only when urunc started the monitor.The first commit makes
LoadUruncConfigstrict:urunc createfails when the file can not be read or decoded. Only a missing file still means the default configuration.pathandsocket_pathof every monitor and thepathof virtiofsd must be absolute and clean. urunc uses each of them at the same place in the monitor rootfs, where a relative path has no meaning. The check covers every monitor in the file, and a single error names every monitor with an invalid path.The logs and the timestamps still fall back to the defaults, so the error still reaches the log.
A bad configuration must also fail before urunc performs changes that affect the host (e.g. block dev unmount). But
InitialSetupcollected the resources of the monitor afterpreSetup, which for a block rootfs copies the file mounts, moves the boot files and unmounts the rootfs. A failure there, e.g. on a host without/dev/kvm, left the device unmounted, andDeletehas no state to restore beforeInitialSetupfinishes. So the second commit collects the resources beforepreSetup. Only the block devices are still collected afterpreSetup, sincepreSetupcopies file mounts, which might live in a block volume. If finding their device nodes fails,getBlockResourcesmounts the block volumes back.The PR adds only cheap checks at create, with no new runtime work. No reason to handle unknown fields in the config file, since it is harmless. A missing file still means the defaults, also when
URUNC_CONFIG_FILEnames the file.uruncdoes not need to be exhaustive with the config file. We can think of ways to let a user know that a config is valid.Also, this is a partial fix for #859 in the case the device nodes are not found. A later failure in
InitialSetup, e.g. while saving the state, still leaves the block volumes unmounted. This will be handled later.At last,
data_pathis not checked. urunc joinsdata_pathwithqemuandseabioson the host and mounts the two directories at fixed places in the monitor rootfs, sodata_pathitself never appears in the monitor rootfs.Related issues
getBlockVolumesare silently discarded on error, permanently orphaning already-unmounted block volumes #859How was this tested?
With e2e tests
LLM usage
Opus 5.5
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).