-
Notifications
You must be signed in to change notification settings - Fork 11
confd: Add mount constraint for container config #1046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
59def71
to
cceb5c8
Compare
Did you verify that adding |
My question too. |
I have just checked. choice data {
case source {
leaf source {
mandatory true;
description "...";
type string {
pattern '/.*';
}
}
}
case content {
leaf content {
mandatory true;
description "...";
type binary;
}
}
} This looked like the ideal solution, but it seems that |
It actually works by placing
Error messages are not perfect though for CLI users who do not interact with YANG models:
There is no mention of |
79a3832
to
34456e9
Compare
This change ensures configuration correctness by enforcing that each container mount has either a source or content set. Without this, the system may generate invalid runtime arguments (src=(null)), leading to container startup failures.
If an invalid mount source path is specified, the container logs a "file not found" error and subsequently crashes. Adding a check inside the SR_EV_CHANGE event handler performs an early validation of the mount source path, allowing to reject configurations that reference non-existent or unreadable files before they are committed to the datastore.
d9c49ff
to
dfc350a
Compare
But for now, the user may need to look at the model to know whats happening. |
This PR adds a validation rule to prevent incomplete container mount configurations. Ensures that either "source" or "content" is present when "target" is specified, avoiding runtime errors caused by undefined mount sources.
Fixes #1040
Checklist
Tick relevant boxes, this PR is-a or has-a: