confd: rename volume dir -> path, same as bind-mounted files

Also, update container YANG model descriptions and ensure 'path' is
mandatory for each list element and attach a regexp pattern to fix
the mountpoint to an absolute path inside the container.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-02-25 19:49:27 +01:00
parent cd4e8b0a9f
commit ff32314676
2 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ static int add(const char *name, struct lyd_node *cif)
fprintf(fp, " --read-only");
LYX_LIST_FOR_EACH(lyd_child(cif), node, "volume")
fprintf(fp, " -v %s-%s:%s", name, lydx_get_cattr(node, "name"), lydx_get_cattr(node, "dir"));
fprintf(fp, " -v %s-%s:%s", name, lydx_get_cattr(node, "name"), lydx_get_cattr(node, "path"));
LYX_LIST_FOR_EACH(lyd_child(cif), node, "file") {
const char *filenm = lydx_get_cattr(node, "name");
@@ -94,7 +94,18 @@ module infix-containers {
}
leaf image {
description "Docker image used for the container";
description "Docker image for the container: [transport]name[:tag|@digest]
quay.io/username/myimage -- Pull myimage:latest
docker://busybox -- Pull busybox:latest from Docker Hub
docker://ghcr.io/usr/img -- Pull img:latest from GitHub packages
dir:/media/usb/myimage:1.1 -- Use myimage v1.1 from USB media
docker-archive:/tmp/myimage -- Use myimage:latest from tarball
oci-archive:/tmp/myimage -- Use myimage:latest from OCI archive
Note: if a remote repository cannot be reached, the creation of the
container will be put on a queue that retries pull every time
there is a route change in the host's system.";
mandatory true;
type string;
}
@@ -186,10 +197,12 @@ module infix-containers {
type string;
}
leaf dir {
description "Directory to mount the volume on inside the container, e.g., /etc";
leaf path {
description "Directory to mount the volume on inside the container, e.g., /var/lib";
mandatory true;
type string;
type string {
pattern '/.*';
}
}
}
@@ -209,6 +222,7 @@ module infix-containers {
type string {
pattern '/.*';
}
mandatory true;
}
leaf content {