diff --git a/src/confd/src/infix-containers.c b/src/confd/src/infix-containers.c index a62e68f0..1c579930 100644 --- a/src/confd/src/infix-containers.c +++ b/src/confd/src/infix-containers.c @@ -492,6 +492,7 @@ int infix_containers_init(struct confd *confd) REGISTER_RPC(confd->session, CFG_XPATH "/container/start", action, NULL, &confd->sub); REGISTER_RPC(confd->session, CFG_XPATH "/container/stop", action, NULL, &confd->sub); REGISTER_RPC(confd->session, CFG_XPATH "/container/restart", action, NULL, &confd->sub); + REGISTER_RPC(confd->session, CFG_XPATH "/container/upgrade", action, NULL, &confd->sub); REGISTER_RPC(confd->session, "/infix-containers:oci-load", oci_load, NULL, &confd->sub); return SR_ERR_OK; diff --git a/src/confd/yang/confd/infix-containers.yang b/src/confd/yang/confd/infix-containers.yang index b4c90ada..07746d0e 100644 --- a/src/confd/yang/confd/infix-containers.yang +++ b/src/confd/yang/confd/infix-containers.yang @@ -22,8 +22,10 @@ module infix-containers { prefix infix-sys; } - revision 2025-09-09 { - description "Add dedicated 'ident' type for container and volume names."; + revision 2025-10-12 { + description "Two major changes: + - Add dedicated 'ident' type for container and volume names. + - New upgrade action (RPC) for containers with :latest image."; reference "internal"; } @@ -484,6 +486,18 @@ module infix-containers { action restart { description "Restart a running, or start, a stopped container."; } + + action upgrade { + description "Upgrade container to latest version of its image. + + This action fetches the latest version of the container's image + and recreates the container with the new image. Any named volumes + are preserved. + + Note: This action is primarily for containers using mutable tags + like ':latest'. For containers using immutable tags (e.g., + ':25.06.0'), the upgrade action will have no effect."; + } } } diff --git a/src/confd/yang/confd/infix-containers@2025-09-09.yang b/src/confd/yang/confd/infix-containers@2025-10-12.yang similarity index 100% rename from src/confd/yang/confd/infix-containers@2025-09-09.yang rename to src/confd/yang/confd/infix-containers@2025-10-12.yang diff --git a/src/confd/yang/containers.inc b/src/confd/yang/containers.inc index b9199119..11dfc5bc 100644 --- a/src/confd/yang/containers.inc +++ b/src/confd/yang/containers.inc @@ -1,5 +1,5 @@ # -*- sh -*- MODULES=( "infix-interfaces -e containers" - "infix-containers@2025-09-09.yang" + "infix-containers@2025-10-12.yang" )